mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-27 18:50:21 -07:00
Change exceptions to python3 syntax.
This commit is contained in:
parent
62c08d96e5
commit
6747f82547
22 changed files with 38 additions and 38 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue