|
@@ -10,8 +10,8 @@ type volumeDriverRequest struct {
|
|
|
}
|
|
|
|
|
|
type volumeDriverResponse struct {
|
|
|
- Mountpoint string `json:",ommitempty"`
|
|
|
- Err error `json:",ommitempty"`
|
|
|
+ Mountpoint string `json:",omitempty"`
|
|
|
+ Err string `json:",omitempty"`
|
|
|
}
|
|
|
|
|
|
type volumeDriverProxy struct {
|
|
@@ -23,7 +23,7 @@ func (pp *volumeDriverProxy) Create(name string) error {
|
|
|
var ret volumeDriverResponse
|
|
|
err := pp.c.Call("VolumeDriver.Create", args, &ret)
|
|
|
if err != nil {
|
|
|
- return pp.fmtError(name, err)
|
|
|
+ return pp.fmtError(name, err.Error())
|
|
|
}
|
|
|
return pp.fmtError(name, ret.Err)
|
|
|
}
|
|
@@ -33,7 +33,7 @@ func (pp *volumeDriverProxy) Remove(name string) error {
|
|
|
var ret volumeDriverResponse
|
|
|
err := pp.c.Call("VolumeDriver.Remove", args, &ret)
|
|
|
if err != nil {
|
|
|
- return pp.fmtError(name, err)
|
|
|
+ return pp.fmtError(name, err.Error())
|
|
|
}
|
|
|
return pp.fmtError(name, ret.Err)
|
|
|
}
|
|
@@ -42,7 +42,7 @@ func (pp *volumeDriverProxy) Path(name string) (string, error) {
|
|
|
args := volumeDriverRequest{name}
|
|
|
var ret volumeDriverResponse
|
|
|
if err := pp.c.Call("VolumeDriver.Path", args, &ret); err != nil {
|
|
|
- return "", pp.fmtError(name, err)
|
|
|
+ return "", pp.fmtError(name, err.Error())
|
|
|
}
|
|
|
return ret.Mountpoint, pp.fmtError(name, ret.Err)
|
|
|
}
|
|
@@ -51,7 +51,7 @@ func (pp *volumeDriverProxy) Mount(name string) (string, error) {
|
|
|
args := volumeDriverRequest{name}
|
|
|
var ret volumeDriverResponse
|
|
|
if err := pp.c.Call("VolumeDriver.Mount", args, &ret); err != nil {
|
|
|
- return "", pp.fmtError(name, err)
|
|
|
+ return "", pp.fmtError(name, err.Error())
|
|
|
}
|
|
|
return ret.Mountpoint, pp.fmtError(name, ret.Err)
|
|
|
}
|
|
@@ -61,13 +61,13 @@ func (pp *volumeDriverProxy) Unmount(name string) error {
|
|
|
var ret volumeDriverResponse
|
|
|
err := pp.c.Call("VolumeDriver.Unmount", args, &ret)
|
|
|
if err != nil {
|
|
|
- return pp.fmtError(name, err)
|
|
|
+ return pp.fmtError(name, err.Error())
|
|
|
}
|
|
|
return pp.fmtError(name, ret.Err)
|
|
|
}
|
|
|
|
|
|
-func (pp *volumeDriverProxy) fmtError(name string, err error) error {
|
|
|
- if err == nil {
|
|
|
+func (pp *volumeDriverProxy) fmtError(name string, err string) error {
|
|
|
+ if len(err) == 0 {
|
|
|
return nil
|
|
|
}
|
|
|
return fmt.Errorf("External volume driver request failed for %s: %v", name, err)
|