summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs
diff options
context:
space:
mode:
Diffstat (limited to 'glustolibs-gluster/glustolibs')
-rwxr-xr-x[-rw-r--r--]glustolibs-gluster/glustolibs/gluster/bitrot_ops.py2
-rwxr-xr-x[-rw-r--r--]glustolibs-gluster/glustolibs/gluster/glusterfile.py2
-rwxr-xr-x[-rw-r--r--]glustolibs-gluster/glustolibs/gluster/heal_libs.py2
-rw-r--r--glustolibs-gluster/glustolibs/gluster/heal_ops.py2
-rwxr-xr-x[-rw-r--r--]glustolibs-gluster/glustolibs/gluster/lib_utils.py4
-rwxr-xr-x[-rw-r--r--]glustolibs-gluster/glustolibs/gluster/mount_ops.py21
-rw-r--r--glustolibs-gluster/glustolibs/gluster/nfs_ganesha_libs.py2
-rwxr-xr-x[-rw-r--r--]glustolibs-gluster/glustolibs/gluster/quota_libs.py2
8 files changed, 17 insertions, 20 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/bitrot_ops.py b/glustolibs-gluster/glustolibs/gluster/bitrot_ops.py
index cab205cbb..bbfcd93a4 100644..100755
--- a/glustolibs-gluster/glustolibs/gluster/bitrot_ops.py
+++ b/glustolibs-gluster/glustolibs/gluster/bitrot_ops.py
@@ -566,7 +566,7 @@ def get_scrub_status(mnode, volname):
temp_list = re.findall(regex, info, re.S)
corrupt_list = []
for node in temp_list:
- tmp_reg = ('Node: (\S+)\n.*Error count.*'
+ tmp_reg = (r'Node: (\S+)\n.*Error count.*'
'Corrupted object.*?:(.*)\n=.*')
m = re.search(tmp_reg, node, re.S)
if m is None:
diff --git a/glustolibs-gluster/glustolibs/gluster/glusterfile.py b/glustolibs-gluster/glustolibs/gluster/glusterfile.py
index 9b9b57f0c..2f1c45e7b 100644..100755
--- a/glustolibs-gluster/glustolibs/gluster/glusterfile.py
+++ b/glustolibs-gluster/glustolibs/gluster/glusterfile.py
@@ -366,7 +366,7 @@ def get_pathinfo(host, fqpath):
"""
pathinfo = {}
pathinfo['raw'] = get_fattr(host, fqpath, 'trusted.glusterfs.pathinfo')
- pathinfo['brickdir_paths'] = re.findall(".*?POSIX.*?:(\S+)\>",
+ pathinfo['brickdir_paths'] = re.findall(r".*?POSIX.*?:(\S+)\>",
pathinfo['raw'])
return pathinfo
diff --git a/glustolibs-gluster/glustolibs/gluster/heal_libs.py b/glustolibs-gluster/glustolibs/gluster/heal_libs.py
index e71835d78..e4f2b2fdf 100644..100755
--- a/glustolibs-gluster/glustolibs/gluster/heal_libs.py
+++ b/glustolibs-gluster/glustolibs/gluster/heal_libs.py
@@ -343,7 +343,7 @@ def get_self_heal_daemon_pid(nodes):
_rc = True
if isinstance(nodes, str):
nodes = [nodes]
- cmd = "pgrep -f glustershd | grep -v ^$$\$"
+ cmd = r"pgrep -f glustershd | grep -v ^$$\$"
g.log.info("Executing cmd: %s on node %s" % (cmd, nodes))
results = g.run_parallel(nodes, cmd)
for node in results:
diff --git a/glustolibs-gluster/glustolibs/gluster/heal_ops.py b/glustolibs-gluster/glustolibs/gluster/heal_ops.py
index daae9a37d..c200f5c11 100644
--- a/glustolibs-gluster/glustolibs/gluster/heal_ops.py
+++ b/glustolibs-gluster/glustolibs/gluster/heal_ops.py
@@ -184,7 +184,7 @@ def heal_info_summary(mnode, volname):
The third element 'err' is of type 'str' and is the stderr value
of the command execution.
"""
- cmd = ("gluster volume heal %s info | grep 'entries\|Brick\|Status'" %
+ cmd = (r"gluster volume heal %s info | grep 'entries\|Brick\|Status'" %
volname)
return g.run(mnode, cmd)
diff --git a/glustolibs-gluster/glustolibs/gluster/lib_utils.py b/glustolibs-gluster/glustolibs/gluster/lib_utils.py
index 682152f5f..44ac6e3f3 100644..100755
--- a/glustolibs-gluster/glustolibs/gluster/lib_utils.py
+++ b/glustolibs-gluster/glustolibs/gluster/lib_utils.py
@@ -247,7 +247,7 @@ def get_pathinfo(mnode, filename, volname):
umount_volume(mnode, mount_point)
g.run(mnode, "rm -rf " + mount_point)
- return re.findall(".*?POSIX.*?:(\S+)\>", pathinfo)
+ return re.findall(r".*?POSIX.*?:(\S+)\>", pathinfo)
def list_files(mnode, dir_path, parse_str="", user="root"):
@@ -815,7 +815,7 @@ def is_core_file_created(nodes, testrun_timestamp,
g.log.info("checking core file created or not")
for file1 in dir_list:
if (re.search(r'\bcore\.[\S]+\b', file1)):
- file_path_list = re.split('[\s]+', cmd)
+ file_path_list = re.split(r'[\s]+', cmd)
file_path = file_path_list[1] + '/' + file1
time_cmd = 'stat ' + '-c ' + '%X ' + file_path
ret, file_timestamp, _ = g.run(node, time_cmd)
diff --git a/glustolibs-gluster/glustolibs/gluster/mount_ops.py b/glustolibs-gluster/glustolibs/gluster/mount_ops.py
index 637af24b1..cc63d0588 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)
diff --git a/glustolibs-gluster/glustolibs/gluster/nfs_ganesha_libs.py b/glustolibs-gluster/glustolibs/gluster/nfs_ganesha_libs.py
index 390a6b916..fd7d8f4a5 100644
--- a/glustolibs-gluster/glustolibs/gluster/nfs_ganesha_libs.py
+++ b/glustolibs-gluster/glustolibs/gluster/nfs_ganesha_libs.py
@@ -105,7 +105,7 @@ class NfsGaneshaClusterSetupClass(GlusterBaseClass):
ganesha_ha_contents = fh.read()
g.rpyc_close_connection(
host=cls.servers_in_nfs_ganesha_cluster[0], user="root")
- servers_in_existing_cluster = re.findall('VIP_(.*)\=.*',
+ servers_in_existing_cluster = re.findall(r'VIP_(.*)\=.*',
ganesha_ha_contents)
ret = teardown_nfs_ganesha_cluster(
diff --git a/glustolibs-gluster/glustolibs/gluster/quota_libs.py b/glustolibs-gluster/glustolibs/gluster/quota_libs.py
index 6cb770167..5da4d8698 100644..100755
--- a/glustolibs-gluster/glustolibs/gluster/quota_libs.py
+++ b/glustolibs-gluster/glustolibs/gluster/quota_libs.py
@@ -99,7 +99,7 @@ def quota_fetch_daemon_pid(nodes):
_rc = True
if isinstance(nodes, str):
nodes = [nodes]
- cmd = "pgrep -f quotad | grep -v ^$$\$"
+ cmd = r"pgrep -f quotad | grep -v ^$$\$"
g.log.info("Executing cmd: %s on node %s" % (cmd, nodes))
results = g.run_parallel(nodes, cmd)
for node in results: