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:
@@ -103,7 +103,7 @@ class Display(with_metaclass(Singleton, object)):
|
||||
self.cows_available = set([to_text(c) for c in out.split()])
|
||||
if C.ANSIBLE_COW_WHITELIST:
|
||||
self.cows_available = set(C.ANSIBLE_COW_WHITELIST).intersection(self.cows_available)
|
||||
except:
|
||||
except Exception:
|
||||
# could not execute cowsay for some reason
|
||||
self.b_cowsay = False
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ try:
|
||||
from passlib.utils.handlers import HasRawSalt
|
||||
|
||||
PASSLIB_AVAILABLE = True
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
display = Display()
|
||||
@@ -126,7 +126,7 @@ class PasslibHash(BaseHash):
|
||||
|
||||
try:
|
||||
self.crypt_algo = getattr(passlib.hash, algorithm)
|
||||
except:
|
||||
except Exception:
|
||||
raise AnsibleError("passlib does not support '%s' algorithm" % algorithm)
|
||||
|
||||
def hash(self, secret, salt=None, salt_size=None, rounds=None):
|
||||
|
||||
@@ -69,7 +69,7 @@ def _validate_mutable_mappings(a, b):
|
||||
for x in [a, b]:
|
||||
try:
|
||||
myvars.append(dumps(x))
|
||||
except:
|
||||
except Exception:
|
||||
myvars.append(to_native(x))
|
||||
raise AnsibleError("failed to combine variables, expected dicts but got a '{0}' and a '{1}': \n{2}\n{3}".format(
|
||||
a.__class__.__name__, b.__class__.__name__, myvars[0], myvars[1])
|
||||
|
||||
Reference in New Issue
Block a user