Fix the driver name empty case

As drivername maybe "" in hostconfig, so we should not
directly print dirvername with var drivername,
instead, we use the real driver name property to print it.

Fixes: #20900
Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
This commit is contained in:
Kai Qiang Wu(Kennan) 2016-03-03 07:23:49 +00:00
parent 361a63e5f2
commit 6c78edaf7f
1 changed files with 3 additions and 1 deletions

View File

@ -194,12 +194,14 @@ func (s *VolumeStore) create(name, driverName string, opts map[string]string) (v
}
}
logrus.Debugf("Registering new volume reference: driver %q, name %q", driverName, name)
vd, err := volumedrivers.GetDriver(driverName)
if err != nil {
return nil, &OpErr{Op: "create", Name: name, Err: err}
}
logrus.Debugf("Registering new volume reference: driver %q, name %q", vd.Name(), name)
if v, _ := vd.Get(name); v != nil {
return v, nil
}