mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Update bare exceptions to specify Exception.
This will keep us from accidentally catching program-exiting exceptions like KeyboardInterupt and SystemExit.
This commit is contained in:
@@ -332,7 +332,7 @@ def create(module, names=None, flavor=None, image=None, meta=None, key_name=None
|
||||
for server in servers:
|
||||
try:
|
||||
server.get()
|
||||
except:
|
||||
except Exception:
|
||||
server.status = 'ERROR'
|
||||
|
||||
if not filter(lambda s: s.status not in FINAL_STATUSES,
|
||||
@@ -346,7 +346,7 @@ def create(module, names=None, flavor=None, image=None, meta=None, key_name=None
|
||||
for server in servers:
|
||||
try:
|
||||
server.get()
|
||||
except:
|
||||
except Exception:
|
||||
server.status = 'ERROR'
|
||||
instance = rax_to_dict(server, 'server')
|
||||
if server.status == 'ACTIVE' or not wait:
|
||||
@@ -418,7 +418,7 @@ def delete(module, instance_ids=None, wait=True, wait_timeout=300, kept=None):
|
||||
instance_id = server.id
|
||||
try:
|
||||
server.get()
|
||||
except:
|
||||
except Exception:
|
||||
instances[instance_id]['status'] = 'DELETED'
|
||||
instances[instance_id]['rax_status'] = 'DELETED'
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ def rax_keypair(module, name, public_key, state):
|
||||
elif state == 'absent':
|
||||
try:
|
||||
keypair = cs.keypairs.find(name=name)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if keypair:
|
||||
|
||||
Reference in New Issue
Block a user