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:
Toshio Kuratomi 2018-09-07 17:59:46 -07:00
commit 3fba006207
320 changed files with 659 additions and 656 deletions

View file

@ -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'

View file

@ -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: