diff options
author | kshithijiyer <kshithij.ki@gmail.com> | 2020-01-08 15:53:31 +0530 |
---|---|---|
committer | Bala Konda Reddy M <bmekala@redhat.com> | 2020-01-09 06:34:21 +0000 |
commit | 86d16d2a98af540ba458721edc2ac8a530c01635 (patch) | |
tree | 87ed772c0cfa44807835df4e4bf81d9e0eaeb21d /glustolibs-gluster/glustolibs/gluster/heal_libs.py | |
parent | b708cf61e66e810a9d6f1da8d3bbadcf8b38ee3b (diff) |
[py2to3] Change str to list in isinstance()
Use 'list' object type in comparisons instead of 'str'
Because it is differently treated in py2 and py3.
Example:
In py2 isinstance(u'foo', str) is False
In py3 isinstance(u'foo', str) is True
Change-Id: I7663d42494bf59d74550ff4897379d35cc357db4
Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster/heal_libs.py')
-rwxr-xr-x | glustolibs-gluster/glustolibs/gluster/heal_libs.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/heal_libs.py b/glustolibs-gluster/glustolibs/gluster/heal_libs.py index 8b7c3b437..2b0e9ed33 100755 --- a/glustolibs-gluster/glustolibs/gluster/heal_libs.py +++ b/glustolibs-gluster/glustolibs/gluster/heal_libs.py @@ -341,7 +341,7 @@ def get_self_heal_daemon_pid(nodes): """ glustershd_pids = {} _rc = True - if isinstance(nodes, str): + if not isinstance(nodes, list): nodes = [nodes] cmd = r"pgrep -f glustershd | grep -v ^$$\$" g.log.info("Executing cmd: %s on node %s" % (cmd, nodes)) @@ -447,7 +447,7 @@ def is_shd_daemonized(nodes, timeout=120): """ counter = 0 flag = 0 - if isinstance(nodes, str): + if not isinstance(nodes, list): nodes = [nodes] while counter < timeout: ret, pids = get_self_heal_daemon_pid(nodes) @@ -483,7 +483,7 @@ def bring_self_heal_daemon_process_offline(nodes): bool : True on successfully bringing self-heal daemon process offline. False otherwise """ - if isinstance(nodes, str): + if not isinstance(nodes, list): nodes = [nodes] failed_nodes = [] |