From da70ed50dc5ef36c0ec7f162173bbb8363492e15 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Mon, 6 Sep 2021 17:53:07 +0530 Subject: [PATCH] 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 --- internal/cephfs/util.go | 7 ------- internal/cephfs/volumemounter.go | 6 ++++++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/internal/cephfs/util.go b/internal/cephfs/util.go index 42ecb03ce..49b63e48f 100644 --- a/internal/cephfs/util.go +++ b/internal/cephfs/util.go @@ -20,7 +20,6 @@ import ( "context" "time" - "github.com/ceph/ceph-csi/internal/util" "github.com/ceph/ceph-csi/internal/util/log" "github.com/golang/protobuf/ptypes" @@ -29,12 +28,6 @@ import ( 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) { tm, err := ptypes.TimestampProto(createTime) if err != nil { diff --git a/internal/cephfs/volumemounter.go b/internal/cephfs/volumemounter.go index 04ad0f5b0..0fa4f4757 100644 --- a/internal/cephfs/volumemounter.go +++ b/internal/cephfs/volumemounter.go @@ -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 // Called from driver.go's Run(). func loadAvailableMounters(conf *util.Config) error {