From c10083a0166969ec5474fd8a92cfd35cf0536ffe Mon Sep 17 00:00:00 2001 From: Vitalii Koriakov Date: Fri, 26 Oct 2018 13:18:28 +0300 Subject: Using a raw strings for fixing flake warnings Change-Id: Ie134790ea05919a4b396657c11cbc3fc7a7fc529 Signed-off-by: Vitalii Koriakov --- glustolibs-gluster/glustolibs/gluster/mount_ops.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) mode change 100644 => 100755 glustolibs-gluster/glustolibs/gluster/mount_ops.py (limited to 'glustolibs-gluster/glustolibs/gluster/mount_ops.py') diff --git a/glustolibs-gluster/glustolibs/gluster/mount_ops.py b/glustolibs-gluster/glustolibs/gluster/mount_ops.py old mode 100644 new mode 100755 index 637af24b1..cc63d0588 --- 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) -- cgit