Skip to content

Commit a187381

Browse files
claudiolorddutt
authored andcommitted
sq-poller: fix crash when inventory is not mapping
Signed-off-by: Claudio Lorina <[email protected]>
1 parent 357ce70 commit a187381

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

suzieq/poller/controller/utils/inventory_utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ def find_error(
106106
if not inventory:
107107
raise InventorySourceError('The inventory is empty')
108108

109+
if not isinstance(inventory, dict):
110+
raise InventorySourceError(
111+
'Expected mapping instead of list. Check the docs to know how to '
112+
'build the inventory file')
113+
109114
try:
110115
inv_model = InventoryModel(**inventory)
111116
except ValidationError as e:

0 commit comments

Comments
 (0)