summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster/tiering_ops.py
diff options
context:
space:
mode:
authorkshithijiyer <kshithij.ki@gmail.com>2020-01-08 15:53:31 +0530
committerBala Konda Reddy M <bmekala@redhat.com>2020-01-09 06:34:21 +0000
commit86d16d2a98af540ba458721edc2ac8a530c01635 (patch)
tree87ed772c0cfa44807835df4e4bf81d9e0eaeb21d /glustolibs-gluster/glustolibs/gluster/tiering_ops.py
parentb708cf61e66e810a9d6f1da8d3bbadcf8b38ee3b (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/tiering_ops.py')
-rw-r--r--glustolibs-gluster/glustolibs/gluster/tiering_ops.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/tiering_ops.py b/glustolibs-gluster/glustolibs/gluster/tiering_ops.py
index 7e48a48..357b3d4 100644
--- a/glustolibs-gluster/glustolibs/gluster/tiering_ops.py
+++ b/glustolibs-gluster/glustolibs/gluster/tiering_ops.py
@@ -48,7 +48,7 @@ def add_extra_servers_to_cluster(mnode, extra_servers):
add_extra_servers_to_cluster("abc.com", ['peer_node1','peer_node2'])
"""
- if isinstance(extra_servers, str):
+ if not isinstance(extra_servers, list):
extra_servers = [extra_servers]
ret = start_glusterd(servers=extra_servers)
@@ -97,7 +97,7 @@ def tier_attach(mnode, volname, num_bricks_to_add, extra_servers,
tier_attach("abc.com", testvol, '2', ['extra_server1','extra_server2'],
extra_server_info)
"""
- if isinstance(extra_servers, str):
+ if not isinstance(extra_servers, list):
extra_servers = [extra_servers]
replica = int(replica)