From 3b14135cad3621710c0aed15a3ed93c3dcbce00b Mon Sep 17 00:00:00 2001 From: Huamin Chen Date: Wed, 21 Oct 2015 11:52:02 -0400 Subject: [PATCH] mount returns more verbose message upon error Signed-off-by: Huamin Chen --- pkg/util/mount/mount_linux.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/util/mount/mount_linux.go b/pkg/util/mount/mount_linux.go index 54e926ac45b..18c16edf2e1 100644 --- a/pkg/util/mount/mount_linux.go +++ b/pkg/util/mount/mount_linux.go @@ -99,7 +99,7 @@ func doMount(source string, target string, fstype string, options []string) erro command := exec.Command("mount", mountArgs...) output, err := command.CombinedOutput() if err != nil { - glog.Errorf("Mount failed: %v\nMounting arguments: %s %s %s %v\nOutput: %s\n", + return fmt.Errorf("Mount failed: %v\nMounting arguments: %s %s %s %v\nOutput: %s\n", err, source, target, fstype, options, string(output)) } return err @@ -130,8 +130,7 @@ func (mounter *Mounter) Unmount(target string) error { command := exec.Command("umount", target) output, err := command.CombinedOutput() if err != nil { - glog.Errorf("Unmount failed: %v\nUnmounting arguments: %s\nOutput: %s\n", err, target, string(output)) - return err + return fmt.Errorf("Unmount failed: %v\nUnmounting arguments: %s\nOutput: %s\n", err, target, string(output)) } return nil }