mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-22 22:11:44 -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
|
@ -481,7 +481,7 @@ class LinuxService(Service):
|
|||
res = version_re.search(stdout)
|
||||
if res:
|
||||
self.upstart_version = LooseVersion(res.groups()[0])
|
||||
except:
|
||||
except Exception:
|
||||
pass # we'll use the default of 0.0.0
|
||||
|
||||
self.svc_cmd = location['initctl']
|
||||
|
@ -720,7 +720,7 @@ class LinuxService(Service):
|
|||
if self.changed:
|
||||
try:
|
||||
write_to_override_file(override_file_name, override_state)
|
||||
except:
|
||||
except Exception:
|
||||
self.module.fail_json(msg='Could not modify override file')
|
||||
|
||||
return
|
||||
|
@ -1007,7 +1007,7 @@ class FreeBsdService(Service):
|
|||
rc, stdout, stderr = self.execute_command("%s %s %s %s" % (self.svc_cmd, self.name, 'rcvar', self.arguments))
|
||||
try:
|
||||
rcvars = shlex.split(stdout, comments=True)
|
||||
except:
|
||||
except Exception:
|
||||
# TODO: add a warning to the output with the failure
|
||||
pass
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue