From be2ca8dec38fde05cb7d9c0db8df7c5d46064f42 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Fri, 8 Apr 2016 09:41:09 +0200 Subject: [PATCH] Add path to log messages. It is useful to see the path that failed to mount in the log messages. --- pkg/util/mount/nsenter_mount.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/util/mount/nsenter_mount.go b/pkg/util/mount/nsenter_mount.go index 7c4ed261c8..b1d233c14c 100644 --- a/pkg/util/mount/nsenter_mount.go +++ b/pkg/util/mount/nsenter_mount.go @@ -118,7 +118,7 @@ func (n *NsenterMounter) doNsenterMount(source, target, fstype string, options [ exec := exec.New() outputBytes, err := exec.Command(nsenterPath, args...).CombinedOutput() if len(outputBytes) != 0 { - glog.V(5).Infof("Output from mount command: %v", string(outputBytes)) + glog.V(5).Infof("Output of mounting %s to %s: %v", source, target, string(outputBytes)) } return err @@ -151,7 +151,7 @@ func (n *NsenterMounter) Unmount(target string) error { exec := exec.New() outputBytes, err := exec.Command(nsenterPath, args...).CombinedOutput() if len(outputBytes) != 0 { - glog.V(5).Infof("Output from mount command: %v", string(outputBytes)) + glog.V(5).Infof("Output of unmounting %s: %v", target, string(outputBytes)) } return err @@ -176,7 +176,7 @@ func (n *NsenterMounter) IsLikelyNotMountPoint(file string) (bool, error) { exec := exec.New() out, err := exec.Command(nsenterPath, args...).CombinedOutput() if err != nil { - glog.V(2).Infof("Failed findmnt command: %v", err) + glog.V(2).Infof("Failed findmnt command for path %s: %v", file, err) // Different operating systems behave differently for paths which are not mount points. // On older versions (e.g. 2.20.1) we'd get error, on newer ones (e.g. 2.26.2) we'd get "/". // It's safer to assume that it's not a mount point. @@ -184,7 +184,7 @@ func (n *NsenterMounter) IsLikelyNotMountPoint(file string) (bool, error) { } strOut := strings.TrimSuffix(string(out), "\n") - glog.V(5).Infof("IsLikelyNotMountPoint findmnt output: %v", strOut) + glog.V(5).Infof("IsLikelyNotMountPoint findmnt output for path %s: %v", file, strOut) if strOut == file { return false, nil }