diff --git a/confluent_client/bin/confetty b/confluent_client/bin/confetty index 11272271..d32ad5d2 100755 --- a/confluent_client/bin/confetty +++ b/confluent_client/bin/confetty @@ -1042,7 +1042,7 @@ def main(): except IOError: pass if powerstate is None or powertime < time.time() - 10: # Check powerstate every 10 seconds - if powerstate == None: + if powerstate is None: powerstate = True powertime = time.time() check_power_state() diff --git a/confluent_client/bin/nodeconfig b/confluent_client/bin/nodeconfig index ba1b861e..4746c4b6 100755 --- a/confluent_client/bin/nodeconfig +++ b/confluent_client/bin/nodeconfig @@ -170,7 +170,7 @@ def parse_config_line(arguments, single=False): if '=' in param or param[-1] == ':' or forceset: if setmode is None: setmode = True - if setmode != True: + if not setmode: bailout('Cannot do set and query in same command: Query detected but "{0}" appears to be set'.format(param)) if '=' in param: key, _, value = param.partition('=') @@ -182,7 +182,7 @@ def parse_config_line(arguments, single=False): else: if setmode is None: setmode = False - if setmode != False: + if setmode: bailout('Cannot do set and query in same command: Set mode detected but "{0}" appears to be a query'.format(param)) if '.' not in param: if param == 'bmc': diff --git a/confluent_server/confluent/pam.py b/confluent_server/confluent/pam.py index 4d613dc1..4823358d 100644 --- a/confluent_server/confluent/pam.py +++ b/confluent_server/confluent/pam.py @@ -178,8 +178,10 @@ class pam(): return 0 # python3 ctypes prefers bytes - if isinstance(username, str): username = username.encode(encoding) - if isinstance(service, str): service = service.encode(encoding) + if isinstance(username, str): + username = username.encode(encoding) + if isinstance(service, str): + service = service.encode(encoding) if b'\x00' in username or b'\x00' in service: self.code = 4 # PAM_SYSTEM_ERR in Linux-PAM diff --git a/imgutil/imgutil b/imgutil/imgutil index 58f022ab..118e9b29 100644 --- a/imgutil/imgutil +++ b/imgutil/imgutil @@ -5,7 +5,7 @@ import ctypes import ctypes.util import datetime import inspect -from shutil import copytree as copytree +from shutil import copytree if hasattr(inspect, 'getfullargspec') and 'dirs_exist_ok' in inspect.getfullargspec(copytree).args: def copy_tree(src, dst): copytree(src, dst, dirs_exist_ok=True)