X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2Fssh.py;h=90ac0be2dc2d5ad830514272dddfeb73799ddb42;hp=4b3838bbb79159212e8c0efa4193fb7f532a879c;hb=cf561a6e3d4c4fbd78ab6c9d0a9aa817bb3300fc;hpb=677ae40a2be6db9f49b19ada3c4299a8904f7784 diff --git a/resources/libraries/python/ssh.py b/resources/libraries/python/ssh.py index 4b3838bbb7..90ac0be2dc 100644 --- a/resources/libraries/python/ssh.py +++ b/resources/libraries/python/ssh.py @@ -301,7 +301,7 @@ def exec_cmd(node, cmd, timeout=600, sudo=False): ssh = SSH() try: ssh.connect(node) - except Exception as err: + except SSHException as err: logger.error("Failed to connect to node" + str(err)) return None, None, None @@ -311,7 +311,7 @@ def exec_cmd(node, cmd, timeout=600, sudo=False): else: (ret_code, stdout, stderr) = ssh.exec_command_sudo(cmd, timeout=timeout) - except Exception as err: + except SSHException as err: logger.error(err) return None, None, None