remove used assert method outside of test

This commit is contained in:
Robert Kaussow 2019-04-11 11:57:30 +02:00
parent 9cb5b734ab
commit f0f5e20a23
2 changed files with 23 additions and 23 deletions

View File

@ -27,25 +27,25 @@ def get_settings(args):
def get_standards(filepath): def get_standards(filepath):
sys.path.append(os.path.abspath(os.path.expanduser(filepath))) sys.path.append(os.path.abspath(os.path.expanduser(filepath)))
try: try:
standards = importlib.import_module("standards") standards = importlib.import_module("standards")
except ImportError as e: except ImportError as e:
utils.sysexit_with_message( utils.sysexit_with_message(
"Could not import standards from directory %s: %s" % (filepath, str(e))) "Could not import standards from directory %s: %s" % (filepath, str(e)))
if getattr(standards, "ansible_min_version", None) and \ if getattr(standards, "ansible_min_version", None) and \
LooseVersion(standards.ansible_min_version) > LooseVersion(ansible.__version__): LooseVersion(standards.ansible_min_version) > LooseVersion(ansible.__version__):
utils.sysexit_with_message("Standards require ansible version %s (current version %s). " utils.sysexit_with_message("Standards require ansible version %s (current version %s). "
"Please upgrade ansible." % "Please upgrade ansible." %
(standards.ansible_min_version, ansible.__version__)) (standards.ansible_min_version, ansible.__version__))
if getattr(standards, "ansible_review_min_version", None) and \ if getattr(standards, "ansible_review_min_version", None) and \
LooseVersion(standards.ansible_review_min_version) > LooseVersion( LooseVersion(standards.ansible_review_min_version) > LooseVersion(
utils.get_property("__version__")): utils.get_property("__version__")):
utils.sysexit_with_message( utils.sysexit_with_message(
"Standards require ansible-later version %s (current version %s). " "Standards require ansible-later version %s (current version %s). "
"Please upgrade ansible-later." % "Please upgrade ansible-later." %
(standards.ansible_review_min_version, utils.get_property("__version__"))) (standards.ansible_review_min_version, utils.get_property("__version__")))
return standards.standards return standards.standards

View File

@ -27,11 +27,11 @@ colorama.init(autoreset=True, strip=not _should_do_markup())
def flag_extra(extra): def flag_extra(extra):
"""Ensure extra args are prefixed.""" """Ensure extra args are prefixed."""
assert isinstance(extra, dict)
flagged = dict() flagged = dict()
for key, value in iteritems(extra):
flagged["later_" + key] = value if isinstance(extra, dict):
for key, value in iteritems(extra):
flagged["later_" + key] = value
return flagged return flagged