diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c888f7..6317dfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ * BUGFIX * add `role_name` config option to overwrite name of the role * fix not aborting overwrite dialog + * fix failed loading of empty yaml files * FEATURE * add basic hugo theme diff --git a/ansibledoctor/DocumentationParser.py b/ansibledoctor/DocumentationParser.py index c1f1595..6136c4a 100644 --- a/ansibledoctor/DocumentationParser.py +++ b/ansibledoctor/DocumentationParser.py @@ -35,7 +35,7 @@ class Parser: if any(fnmatch.fnmatch(rfile, "*/defaults/*." + ext) for ext in YAML_EXTENSIONS): with open(rfile, "r", encoding="utf8") as yaml_file: try: - data = defaultdict(dict, ruamel.yaml.safe_load(yaml_file)) + data = defaultdict(dict, (ruamel.yaml.safe_load(yaml_file) or {})) for key, value in data.items(): self._data["var"][key] = {"value": {key: value}} except (ruamel.yaml.composer.ComposerError, ruamel.yaml.scanner.ScannerError) as e: