From b1fc01b6006a72e9a9828d64159ce19562a0956b Mon Sep 17 00:00:00 2001 From: kshithijiyer Date: Tue, 31 Dec 2019 13:23:46 +0530 Subject: [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 --- glustolibs-gluster/glustolibs/gluster/lib_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'glustolibs-gluster/glustolibs') diff --git a/glustolibs-gluster/glustolibs/gluster/lib_utils.py b/glustolibs-gluster/glustolibs/gluster/lib_utils.py index 61498176d..516cd76c8 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) -- cgit