We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9790aab commit 5283d43Copy full SHA for 5283d43
suzieq/poller/controller/source/ansible.py
@@ -23,6 +23,7 @@ class AnsibleSourceModel(SourceModel):
23
def validate_and_set(cls, path: str):
24
"""checks if the path is valid
25
"""
26
+ inventory = None
27
if isinstance(path, str):
28
if not Path(path).is_file():
29
raise ValueError(
@@ -38,6 +39,10 @@ def validate_and_set(cls, path: str):
38
39
40
elif isinstance(path, Dict):
41
inventory = path
42
+
43
+ if not inventory:
44
+ raise ValueError('Unknown inventory format: expect path or dict')
45
46
if '_meta' not in inventory \
47
or 'hostvars' not in inventory['_meta']:
48
if isinstance(inventory, list) and 'namespace' in inventory[0]:
0 commit comments