cleanup: move execCommandErr to volumemounter

Moved execCommandErr to the volumemounter.go
which is the only caller of this function and
moving the execCommandErr helps in reducing the
util file.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2021-09-06 17:53:07 +05:30 committed by mergify[bot]
parent 31696a6ce0
commit da70ed50dc
2 changed files with 6 additions and 7 deletions

View File

@ -20,7 +20,6 @@ import (
"context" "context"
"time" "time"
"github.com/ceph/ceph-csi/internal/util"
"github.com/ceph/ceph-csi/internal/util/log" "github.com/ceph/ceph-csi/internal/util/log"
"github.com/golang/protobuf/ptypes" "github.com/golang/protobuf/ptypes"
@ -29,12 +28,6 @@ import (
type volumeID string type volumeID string
func execCommandErr(ctx context.Context, program string, args ...string) error {
_, _, err := util.ExecCommand(ctx, program, args...)
return err
}
func parseTime(ctx context.Context, createTime time.Time) (*timestamp.Timestamp, error) { func parseTime(ctx context.Context, createTime time.Time) (*timestamp.Timestamp, error) {
tm, err := ptypes.TimestampProto(createTime) tm, err := ptypes.TimestampProto(createTime)
if err != nil { if err != nil {

View File

@ -66,6 +66,12 @@ var (
} }
) )
func execCommandErr(ctx context.Context, program string, args ...string) error {
_, _, err := util.ExecCommand(ctx, program, args...)
return err
}
// Load available ceph mounters installed on system into availableMounters // Load available ceph mounters installed on system into availableMounters
// Called from driver.go's Run(). // Called from driver.go's Run().
func loadAvailableMounters(conf *util.Config) error { func loadAvailableMounters(conf *util.Config) error {