summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster/lib_utils.py
diff options
context:
space:
mode:
authorkshithijiyer <kshithij.ki@gmail.com>2019-12-31 13:23:46 +0530
committerkshithijiyer <kshithij.ki@gmail.com>2019-12-31 15:42:23 +0530
commitb1fc01b6006a72e9a9828d64159ce19562a0956b (patch)
tree2d4866a1c0294cde55b3982e3ae6216dc6b4da37 /glustolibs-gluster/glustolibs/gluster/lib_utils.py
parent51034d275c15b2d06f78c32316ae69a6f10ea616 (diff)
[Fix] Fix for variable type check in lib_utils.py
isinstance() was missing at some places due to which variable type check for string was failing in the following functions: 1.set_passwd() 2.group_add() 3.add_user() Change-Id: Iafe47967f8d6df686c9ecdd6d87dac3c81bdb5db Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster/lib_utils.py')
-rwxr-xr-xglustolibs-gluster/glustolibs/gluster/lib_utils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/lib_utils.py b/glustolibs-gluster/glustolibs/gluster/lib_utils.py
index 6149817..516cd76 100755
--- a/glustolibs-gluster/glustolibs/gluster/lib_utils.py
+++ b/glustolibs-gluster/glustolibs/gluster/lib_utils.py
@@ -975,7 +975,7 @@ def add_user(servers, username, group=None):
else:
cmd = "useradd -G %s %s" % (group, username)
- if servers != list:
+ if not isinstance(servers, list):
servers = [servers]
results = g.run_parallel(servers, cmd)
@@ -1019,7 +1019,7 @@ def group_add(servers, groupname):
False otherwise.
"""
- if servers != list:
+ if not isinstance(servers, list):
servers = [servers]
cmd = "groupadd %s" % groupname
@@ -1093,7 +1093,7 @@ def set_passwd(servers, username, passwd):
False otherwise.
"""
- if servers != list:
+ if not isinstance(servers, list):
servers = [servers]
cmd = "echo %s:%s | chpasswd" % (username, passwd)
results = g.run_parallel(servers, cmd)