summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster/mount_ops.py
diff options
context:
space:
mode:
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster/mount_ops.py')
-rwxr-xr-x[-rw-r--r--]glustolibs-gluster/glustolibs/gluster/mount_ops.py21
1 files changed, 9 insertions, 12 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/mount_ops.py b/glustolibs-gluster/glustolibs/gluster/mount_ops.py
index 637af24..cc63d05 100644..100755
--- a/glustolibs-gluster/glustolibs/gluster/mount_ops.py
+++ b/glustolibs-gluster/glustolibs/gluster/mount_ops.py
@@ -251,18 +251,15 @@ def is_mounted(volname, mpoint, mserver, mclient, mtype, user='root'):
if mtype == "smb":
if mpoint == "*":
return False
- else:
- cmd = powershell("net use %s" % mpoint)
- ret, out, err = g.run(mclient, cmd, user)
- if ret != 0:
- return False
- else:
- expected_output = ("Remote name \\\%s\gluster-%s" %
- (mserver, volname))
- if expected_output in out:
- return True
- else:
- return False
+ cmd = powershell("net use %s" % mpoint)
+ ret, out, err = g.run(mclient, cmd, user)
+ if ret != 0:
+ return False
+ expected_output = (r"\\\%s\gluster-%s" %
+ (mserver, volname))
+ if "Remote name" in out and expected_output in out:
+ return True
+ return False
else:
ret, _, _ = g.run(mclient, "mount | grep %s | grep %s | grep \"%s\""
% (volname, mpoint, mserver), user)