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
|
@ -124,7 +124,7 @@ def create_bucket(module, blade):
|
|||
attr.account = Reference(name=module.params['account'])
|
||||
blade.buckets.create_buckets(names=[module.params['name']], account=attr)
|
||||
changed = True
|
||||
except:
|
||||
except Exception:
|
||||
module.fail_json(msg='Object Store Bucket {0}: Creation failed'.format(module.params['name']))
|
||||
module.exit_json(changed=changed)
|
||||
|
||||
|
@ -140,9 +140,9 @@ def delete_bucket(module, blade):
|
|||
try:
|
||||
blade.buckets.delete_buckets(names=[module.params['name']])
|
||||
changed = True
|
||||
except:
|
||||
except Exception:
|
||||
module.fail_json(msg='Object Store Bucket {0}: Eradication failed'.format(module.params['name']))
|
||||
except:
|
||||
except Exception:
|
||||
module.fail_json(msg='Object Store Bucket {0}: Deletion failed'.format(module.params['name']))
|
||||
module.exit_json(changed=changed)
|
||||
|
||||
|
@ -154,7 +154,7 @@ def recover_bucket(module, blade):
|
|||
blade.buckets.update_buckets(names=[module.params['name']],
|
||||
destroyed=Bucket(destroyed=False))
|
||||
changed = True
|
||||
except:
|
||||
except Exception:
|
||||
module.fail_json(msg='Object Store Bucket {0}: Recovery failed'.format(module.params['name']))
|
||||
module.exit_json(changed=changed)
|
||||
|
||||
|
@ -165,7 +165,7 @@ def eradicate_bucket(module, blade):
|
|||
try:
|
||||
blade.buckets.delete_buckets(names=[module.params['name']])
|
||||
changed = True
|
||||
except:
|
||||
except Exception:
|
||||
module.fail_json(msg='Object Store Bucket {0}: Eradication failed'.format(module.params['name']))
|
||||
module.exit_json(changed=changed)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue