diff options
author | binary <me@rgoncalves.se> | 2021-02-14 12:01:27 +0100 |
---|---|---|
committer | binary <me@rgoncalves.se> | 2021-02-14 12:01:27 +0100 |
commit | 68e20f54eda6de055adb9bda5969bedf20cf928b (patch) | |
tree | 0555e6ea0877f4ff9ffa31a0fbcada0653e860dd | |
parent | bd83904d446597821d613ad2c8710ba7580dfd0d (diff) | |
download | infrastructure-68e20f54eda6de055adb9bda5969bedf20cf928b.tar.gz |
Load empty structure on empty yaml input file.
Previously, python used to create an NoneType object when loading
an empty yaml input file.
-rwxr-xr-x | dynamic.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -35,7 +35,7 @@ class AnsibleInput: def __init__(self, filepath): with open(filepath) as file: - self.data = yaml.load(file, Loader=yaml.FullLoader) + self.data = yaml.load(file, Loader=yaml.FullLoader) or {} self.name = os.path.splitext(os.path.basename(filepath))[0] |