Merge pull request #56 from nak3/debug-friendly

Logging command and options for debug friendly
This commit is contained in:
Huamin Chen 2018-08-07 14:14:31 -04:00 committed by GitHub
commit 50bbfb5bae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,6 +22,7 @@ import (
"fmt"
"os/exec"
"github.com/golang/glog"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
@ -35,6 +36,7 @@ func execCommand(command string, args ...string) ([]byte, error) {
}
func execCommandAndValidate(program string, args ...string) error {
glog.V(4).Infof("cephfs: executing command: %s with args: %s", program, args)
out, err := execCommand(program, args...)
if err != nil {
return fmt.Errorf("cephfs: %s failed with following error: %s\ncephfs: %s output: %s", program, err, program, out)
@ -122,6 +124,8 @@ func newMounter(volOptions *volumeOptions) volumeMounter {
mounter = DefaultVolumeMounter
}
glog.V(4).Infof("cephfs: setting volume mounter to: %s", mounter)
switch mounter {
case volumeMounter_fuse:
return &fuseMounter{}