diff --git a/ansiblelater/standard.py b/ansiblelater/standard.py index 5fd3c6b..4a66bc7 100644 --- a/ansiblelater/standard.py +++ b/ansiblelater/standard.py @@ -321,7 +321,7 @@ class StandardLoader(): try: spec.loader.exec_module(module) except (ImportError, NameError) as e: - sysexit_with_message(f"Failed to load roles file {filename}: \n {str(e)}") + sysexit_with_message(f"Failed to load roles file {filename}: \n {e!s}") try: for _name, obj in inspect.getmembers(module): diff --git a/ansiblelater/utils/yamlhelper.py b/ansiblelater/utils/yamlhelper.py index 57fcb42..05207a9 100644 --- a/ansiblelater/utils/yamlhelper.py +++ b/ansiblelater/utils/yamlhelper.py @@ -490,7 +490,7 @@ def extract_from_list(blocks, candidates): results.extend(add_action_type(block[candidate], candidate, meta_data)) elif block[candidate] is not None: raise RuntimeError( - f"Key '{candidate}' defined, but bad value: '{str(block[candidate])}'" + f"Key '{candidate}' defined, but bad value: '{block[candidate]!s}'" ) return results