From 4e7de449ee3b4c4281532a0387808ef00d45ef94 Mon Sep 17 00:00:00 2001 From: Hou Junjie Date: Tue, 5 Jan 2021 13:27:19 +0800 Subject: [PATCH] fix format placeholders --- src/csi/driver/controller.go | 5 +++++ src/storage/fusionstorage/smartx/smartx.go | 2 +- src/storage/fusionstorage/volume/san.go | 2 +- src/tools/passwdEncrypt/passwdEncrypt.go | 4 ++-- src/utils/utils.go | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/csi/driver/controller.go b/src/csi/driver/controller.go index cfb073ec..b2468369 100644 --- a/src/csi/driver/controller.go +++ b/src/csi/driver/controller.go @@ -319,3 +319,8 @@ func (d *Driver) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequ func (d *Driver) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error) { return nil, status.Error(codes.Unimplemented, "") } + +func (d *Driver) ControllerGetVolume(ctx context.Context, req *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error) { + // todo + return nil, nil +} diff --git a/src/storage/fusionstorage/smartx/smartx.go b/src/storage/fusionstorage/smartx/smartx.go index 90cdd3db..bb1037c4 100644 --- a/src/storage/fusionstorage/smartx/smartx.go +++ b/src/storage/fusionstorage/smartx/smartx.go @@ -79,7 +79,7 @@ func (p *QoS) AddQoS(volName string, params map[string]int) (string, error) { err := p.RemoveQoS(volName) if err != nil { - log.Errorf("Revert Create qos %s error: %v", params, err) + log.Errorf("Revert Create qos %v error: %v", params, err) return "", err } diff --git a/src/storage/fusionstorage/volume/san.go b/src/storage/fusionstorage/volume/san.go index a62cb746..78e5b6fe 100644 --- a/src/storage/fusionstorage/volume/san.go +++ b/src/storage/fusionstorage/volume/san.go @@ -292,7 +292,7 @@ func (p *SAN) preExpandCheckCapacity(params, taskResult map[string]interface{}) expandSize := params["expandSize"].(int64) pool, err := p.cli.GetPoolById(localParentId) if err != nil || pool == nil { - log.Errorf("Get storage pool %s info error: %v", localParentId, err) + log.Errorf("Get storage pool %v info error: %v", localParentId, err) return nil, err } totalCapacity := int64(pool["totalCapacity"].(float64)) diff --git a/src/tools/passwdEncrypt/passwdEncrypt.go b/src/tools/passwdEncrypt/passwdEncrypt.go index 3ad636b6..8a5221c3 100644 --- a/src/tools/passwdEncrypt/passwdEncrypt.go +++ b/src/tools/passwdEncrypt/passwdEncrypt.go @@ -17,7 +17,7 @@ func main() { fmt.Print("Enter password: ") input, err := terminal.ReadPassword(0) if err != nil { - fmt.Println("Input password error: %v", err) + fmt.Printf("Input password error: %v", err) os.Exit(1) } @@ -27,7 +27,7 @@ func main() { encrypted, err := pwd.Encrypt(plainText) if err != nil { - fmt.Println("Encrypt password error: %v", err) + fmt.Printf("Encrypt password error: %v", err) os.Exit(1) } diff --git a/src/utils/utils.go b/src/utils/utils.go index ddc03c43..62225ed9 100644 --- a/src/utils/utils.go +++ b/src/utils/utils.go @@ -220,7 +220,7 @@ func CopyMap(srcMap interface{}) map[string]interface{} { func StrToBool(str string) bool { b, err := strconv.ParseBool(str) if err != nil { - log.Warningf("Parse bool string %s error, return false") + log.Warningf("Parse bool string %s error, return false", err) return false }