mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07: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:
parent
5147e792d3
commit
3fba006207
320 changed files with 659 additions and 656 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue