From 48abbce20a6e2f555257ee47ff5771060fb6696c Mon Sep 17 00:00:00 2001 From: Marc Villacorta Date: Tue, 24 Nov 2015 15:32:16 +0100 Subject: [PATCH] Fix exec.Command arguments --- driver.go | 8 ++++---- main.go | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) 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()