Skip to content

Commit

Permalink
Better exception handling. Cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
pkittenis committed Aug 31, 2016
1 parent 6646005 commit ec32daf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pssh/pssh_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,9 +603,9 @@ def get_output(self, cmd, output):
exc = sys.exc_info()
try:
host = ex.args[1]
except IndexError, ex:
except IndexError, _ex:
logger.error("Got exception with no host argument - "
"cannot update output data with %s", ex)
"cannot update output data with %s", _ex)
raise exc[1], None, exc[2]
self._update_host_output(output, host, None, None, None, None, None, cmd,
exception=ex)
Expand Down
4 changes: 2 additions & 2 deletions pssh/ssh_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ def _connect_tunnel(self):
except channel_exception, ex:
error_type = ex.args[1] if len(ex.args) > 1 else ex.args[0]
raise ConnectionErrorException("Error connecting to host '%s:%s' - %s",
self.host, self.port,
str(error_type))
self.host, self.port,
str(error_type))

def _connect(self, client, host, port, sock=None, retries=1):
"""Connect to host
Expand Down

0 comments on commit ec32daf

Please sign in to comment.