Skip to content

Commit eb452a7

Browse files
committed
Inventory: properly create groups with plurals:False (netbox-community#141)
1 parent e04f90d commit eb452a7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

plugins/inventory/nb_inventory.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,10 @@ def add_host_to_groups(self, host, hostname):
668668
if not groups_for_host:
669669
continue
670670

671+
# Make groups_for_host a list if it isn't already
672+
if not isinstance(groups_for_host, list):
673+
groups_for_host = [groups_for_host]
674+
671675
for group_for_host in groups_for_host:
672676
if self.group_names_raw:
673677
group_name = group_for_host

0 commit comments

Comments
 (0)