From ec12e6cc9d9f0a760906c70affd6d881d26a74b0 Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Mon, 5 Jun 2017 17:07:33 +0200 Subject: [PATCH] Improve error reporting when flex driver has failed to initialize. --- pkg/volume/flexvolume/driver-call.go | 4 ++-- pkg/volume/plugins.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/volume/flexvolume/driver-call.go b/pkg/volume/flexvolume/driver-call.go index 3866e535c4..0c6ac4fb2c 100644 --- a/pkg/volume/flexvolume/driver-call.go +++ b/pkg/volume/flexvolume/driver-call.go @@ -143,7 +143,7 @@ func (dc *DriverCall) Run() (*DriverStatus, error) { if isCmdNotSupportedErr(err) { dc.plugin.unsupported(dc.Command) } else { - glog.Warningf("FlexVolume: driver call failed: executable: %s, args: %s, error: %s, output: %s", execPath, dc.args, execErr.Error(), output) + glog.Warningf("FlexVolume: driver call failed: executable: %s, args: %s, error: %s, output: %q", execPath, dc.args, execErr.Error(), output) } return nil, err } @@ -215,7 +215,7 @@ func isCmdNotSupportedErr(err error) bool { func handleCmdResponse(cmd string, output []byte) (*DriverStatus, error) { var status DriverStatus if err := json.Unmarshal(output, &status); err != nil { - glog.Errorf("Failed to unmarshal output for command: %s, output: %s, error: %s", cmd, string(output), err.Error()) + glog.Errorf("Failed to unmarshal output for command: %s, output: %q, error: %s", cmd, string(output), err.Error()) return nil, err } else if status.Status == StatusNotSupported { glog.V(5).Infof("%s command is not supported by the driver", cmd) diff --git a/pkg/volume/plugins.go b/pkg/volume/plugins.go index 41721d1eea..611d9b55e0 100644 --- a/pkg/volume/plugins.go +++ b/pkg/volume/plugins.go @@ -362,7 +362,7 @@ func (pm *VolumePluginMgr) InitPlugins(plugins []VolumePlugin, host VolumeHost) } err := plugin.Init(host) if err != nil { - glog.Errorf("Failed to load volume plugin %s, error: %s", plugin, err.Error()) + glog.Errorf("Failed to load volume plugin %s, error: %s", name, err.Error()) allErrs = append(allErrs, err) continue }