mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Allow creating empty inventory
Instantiating the Inventory class with host_list=None now results in an empty inventory instead of an error.
This commit is contained in:
@@ -70,7 +70,9 @@ class Inventory(object):
|
||||
host_list = host_list.split(",")
|
||||
host_list = [ h for h in host_list if h and h.strip() ]
|
||||
|
||||
if isinstance(host_list, list):
|
||||
if host_list is None:
|
||||
self.parser = None
|
||||
elif isinstance(host_list, list):
|
||||
self.parser = None
|
||||
all = Group('all')
|
||||
self.groups = [ all ]
|
||||
|
||||
Reference in New Issue
Block a user