diff --git a/driver.go b/driver.go index 4cfee79..3e4bac3 100644 --- a/driver.go +++ b/driver.go @@ -431,8 +431,8 @@ func (d *rbdDriver) lockImage(pool, name, lockID string) (string, error) { // Lock the image err := exec.Command( - d.cmd["rbd"], "lock add", - "--pool", pool, + d.cmd["rbd"], "lock", + "add", "--pool", pool, name, lockID, ).Run() @@ -442,7 +442,7 @@ func (d *rbdDriver) lockImage(pool, name, lockID string) (string, error) { // List the locks out, err := exec.Command( - d.cmd["rbd"], "lock list", + d.cmd["rbd"], "lock", "list", "--pool", pool, name, ).Output() @@ -472,7 +472,7 @@ func (d *rbdDriver) unlockImage(pool, name, lockID, locker string) error { // Unlock the image err := exec.Command( - d.cmd["rbd"], "lock remove", + d.cmd["rbd"], "lock", "remove", name, lockID, locker, ).Run() diff --git a/main.go b/main.go index ad587fc..087ea9e 100644 --- a/main.go +++ b/main.go @@ -69,6 +69,9 @@ func init() { usage() } + // Change the flags on the default logger: + log.SetFlags(log.LstdFlags | log.Lshortfile) + // Parse commandline flags: flag.Usage = usage flag.Parse()