mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-04 15:29:10 -07:00
Use 'except ... as' syntax in contrib/ and test/ too
This commit is contained in:
parent
eb99aa8c68
commit
9ae66a7f5c
14 changed files with 25 additions and 25 deletions
|
@ -101,7 +101,7 @@ except:
|
|||
from chube.linode_obj import Linode
|
||||
|
||||
sys.path = old_path
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
raise Exception("could not import chube")
|
||||
|
||||
load_chube_config()
|
||||
|
@ -184,7 +184,7 @@ class LinodeInventory(object):
|
|||
try:
|
||||
for node in Linode.search(status=Linode.STATUS_RUNNING):
|
||||
self.add_node(node)
|
||||
except chube_api.linode_api.ApiError, e:
|
||||
except chube_api.linode_api.ApiError as e:
|
||||
print "Looks like Linode's API is down:"
|
||||
print
|
||||
print e
|
||||
|
@ -194,7 +194,7 @@ class LinodeInventory(object):
|
|||
"""Gets details about a specific node."""
|
||||
try:
|
||||
return Linode.find(api_id=linode_id)
|
||||
except chube_api.linode_api.ApiError, e:
|
||||
except chube_api.linode_api.ApiError as e:
|
||||
print "Looks like Linode's API is down:"
|
||||
print
|
||||
print e
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue