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

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