diff --git a/pywisp_emibcn/pywisp.py b/pywisp_emibcn/pywisp.py index 6b0833a..9966fcc 100755 --- a/pywisp_emibcn/pywisp.py +++ b/pywisp_emibcn/pywisp.py @@ -276,7 +276,7 @@ def main(): # Get devices devices = pywisp.wisp.get_host( pywisp.args.host, deep=pywisp.args.deep, from_br=pywisp.args.from_br) - if devices == None or len(devices) == 0: + if devices is None or len(devices) == 0: pywisp.log.error("No devices found: '%s'" % (pywisp.args.host)) return 1 diff --git a/pywisp_emibcn/sshdevice.py b/pywisp_emibcn/sshdevice.py index 53aa598..a849aa3 100644 --- a/pywisp_emibcn/sshdevice.py +++ b/pywisp_emibcn/sshdevice.py @@ -81,7 +81,7 @@ def setBackupName(self, backup_file=""): def login(self): '''Open SSH connection only if it is not already opened''' - if self.client == False: + if self.client is False: # Start SSH connection self.client = paramiko.SSHClient() @@ -99,7 +99,7 @@ def login(self): def logout(self): '''Close SSH connection only if it is opened''' - if self.client != False: + if self.client is not False: self.client.close() # Higiene del self.client diff --git a/tests/test_pywisp.py b/tests/test_pywisp.py index d0f9b0a..7295d19 100644 --- a/tests/test_pywisp.py +++ b/tests/test_pywisp.py @@ -29,7 +29,7 @@ def get_host(self, name, deep=False, from_br=None): # Get devices device = pywisp.wisp.get_host(pywisp.args.host) -assert device != None, 'get_host should have returned a list or a device' +assert device is not None, 'get_host should have returned a list or a device' if not len(device): raise AssertionError( 'get_host should have returned a list with at least one device')