mirror of
https://github.com/thegeeklab/ansible-doctor.git
synced 2024-11-24 13:50:42 +00:00
fix failed loading of empty yaml files
This commit is contained in:
parent
850ba35a06
commit
3ab72a32a4
@ -1,5 +1,6 @@
|
|||||||
* BUGFIX
|
* BUGFIX
|
||||||
* add `role_name` config option to overwrite name of the role
|
* add `role_name` config option to overwrite name of the role
|
||||||
* fix not aborting overwrite dialog
|
* fix not aborting overwrite dialog
|
||||||
|
* fix failed loading of empty yaml files
|
||||||
* FEATURE
|
* FEATURE
|
||||||
* add basic hugo theme
|
* add basic hugo theme
|
||||||
|
@ -35,7 +35,7 @@ class Parser:
|
|||||||
if any(fnmatch.fnmatch(rfile, "*/defaults/*." + ext) for ext in YAML_EXTENSIONS):
|
if any(fnmatch.fnmatch(rfile, "*/defaults/*." + ext) for ext in YAML_EXTENSIONS):
|
||||||
with open(rfile, "r", encoding="utf8") as yaml_file:
|
with open(rfile, "r", encoding="utf8") as yaml_file:
|
||||||
try:
|
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():
|
for key, value in data.items():
|
||||||
self._data["var"][key] = {"value": {key: value}}
|
self._data["var"][key] = {"value": {key: value}}
|
||||||
except (ruamel.yaml.composer.ComposerError, ruamel.yaml.scanner.ScannerError) as e:
|
except (ruamel.yaml.composer.ComposerError, ruamel.yaml.scanner.ScannerError) as e:
|
||||||
|
Loading…
Reference in New Issue
Block a user