From 70998571aa6e77ce4a465338a95e506e3a620163 Mon Sep 17 00:00:00 2001 From: Prasanna Kumar Kalever Date: Fri, 4 Jun 2021 11:54:52 +0530 Subject: [PATCH] cleanup: change variable name from path to metaDataPath path is used by standard package. Signed-off-by: Prasanna Kumar Kalever --- internal/rbd/rbd_util.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/rbd/rbd_util.go b/internal/rbd/rbd_util.go index 85386ddfd..328539da2 100644 --- a/internal/rbd/rbd_util.go +++ b/internal/rbd/rbd_util.go @@ -1395,7 +1395,7 @@ func (ri *rbdImageMetadataStash) String() string { // stashRBDImageMetadata stashes required fields into the stashFileName at the passed in path, in // JSON format. -func stashRBDImageMetadata(volOptions *rbdVolume, path string) error { +func stashRBDImageMetadata(volOptions *rbdVolume, metaDataPath string) error { imgMeta := rbdImageMetadataStash{ // there are no checks for this at present Version: 3, // nolint:gomnd // number specifies version. @@ -1416,7 +1416,7 @@ func stashRBDImageMetadata(volOptions *rbdVolume, path string) error { return fmt.Errorf("failed to marshall JSON image metadata for image (%s): %w", volOptions, err) } - fPath := filepath.Join(path, stashFileName) + fPath := filepath.Join(metaDataPath, stashFileName) err = ioutil.WriteFile(fPath, encodedBytes, 0o600) if err != nil { return fmt.Errorf("failed to stash JSON image metadata for image (%s) at path (%s): %w", volOptions, fPath, err) @@ -1426,10 +1426,10 @@ func stashRBDImageMetadata(volOptions *rbdVolume, path string) error { } // lookupRBDImageMetadataStash reads and returns stashed image metadata at passed in path. -func lookupRBDImageMetadataStash(path string) (rbdImageMetadataStash, error) { +func lookupRBDImageMetadataStash(metaDataPath string) (rbdImageMetadataStash, error) { var imgMeta rbdImageMetadataStash - fPath := filepath.Join(path, stashFileName) + fPath := filepath.Join(metaDataPath, stashFileName) encodedBytes, err := ioutil.ReadFile(fPath) // #nosec - intended reading from fPath if err != nil { if !os.IsNotExist(err) { @@ -1448,8 +1448,8 @@ func lookupRBDImageMetadataStash(path string) (rbdImageMetadataStash, error) { } // cleanupRBDImageMetadataStash cleans up any stashed metadata at passed in path. -func cleanupRBDImageMetadataStash(path string) error { - fPath := filepath.Join(path, stashFileName) +func cleanupRBDImageMetadataStash(metaDataPath string) error { + fPath := filepath.Join(metaDataPath, stashFileName) if err := os.Remove(fPath); err != nil { return fmt.Errorf("failed to cleanup stashed JSON data (%s): %w", fPath, err) }