mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00: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:
@@ -55,7 +55,7 @@ class ActionModule(ActionBase):
|
||||
|
||||
try:
|
||||
name, port = parse_address(new_name, allow_ranges=False)
|
||||
except:
|
||||
except Exception:
|
||||
# not a parsable hostname, but might still be usable
|
||||
name = new_name
|
||||
port = None
|
||||
|
||||
@@ -32,7 +32,7 @@ from ansible.utils.display import Display
|
||||
|
||||
try:
|
||||
from library.module_utils.network.f5.common import f5_provider_spec
|
||||
except:
|
||||
except Exception:
|
||||
from ansible.module_utils.network.f5.common import f5_provider_spec
|
||||
|
||||
display = Display()
|
||||
|
||||
@@ -30,7 +30,7 @@ from ansible.module_utils.six.moves.urllib.parse import urlsplit
|
||||
|
||||
try:
|
||||
from library.module_utils.network.f5.common import f5_provider_spec
|
||||
except:
|
||||
except Exception:
|
||||
from ansible.module_utils.network.f5.common import f5_provider_spec
|
||||
|
||||
from ansible.utils.display import Display
|
||||
|
||||
@@ -32,7 +32,7 @@ from ansible.utils.display import Display
|
||||
|
||||
try:
|
||||
from library.module_utils.network.f5.common import f5_provider_spec
|
||||
except:
|
||||
except Exception:
|
||||
from ansible.module_utils.network.f5.common import f5_provider_spec
|
||||
|
||||
display = Display()
|
||||
|
||||
@@ -47,7 +47,7 @@ class ActionModule(ActionBase):
|
||||
module = self._templar.template("{{hostvars['%s']['ansible_facts']['service_mgr']}}" % self._task.delegate_to)
|
||||
else:
|
||||
module = self._templar.template('{{ansible_facts.service_mgr}}')
|
||||
except:
|
||||
except Exception:
|
||||
pass # could not get it from template!
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user