Change exceptions to python3 syntax.

This commit is contained in:
ian 2015-04-13 12:35:20 -04:00
parent 62c08d96e5
commit 6747f82547
22 changed files with 38 additions and 38 deletions

View file

@ -170,7 +170,7 @@ class Connection(object):
key_filename=key_filename, password=self.password,
timeout=self.runner.timeout, port=self.port)
except Exception, e:
except Exception as e:
msg = str(e)
if "PID check failed" in msg:
@ -197,7 +197,7 @@ class Connection(object):
self.ssh.get_transport().set_keepalive(5)
chan = self.ssh.get_transport().open_session()
except Exception, e:
except Exception as e:
msg = "Failed to open session"
if len(str(e)) > 0:
@ -284,7 +284,7 @@ class Connection(object):
try:
self.sftp = self.ssh.open_sftp()
except Exception, e:
except Exception as e:
raise errors.AnsibleError("failed to open a SFTP connection (%s)" % e)
try:
@ -308,7 +308,7 @@ class Connection(object):
try:
self.sftp = self._connect_sftp()
except Exception, e:
except Exception as e:
raise errors.AnsibleError("failed to open a SFTP connection (%s)", e)
try: