mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Bring groups handling in ini.py up-to-date
Since c8f2483d, ini.py expects to always be passed in a pre-created list
of groups, and can no longer deal sensibly with an empty list; this just
makes that expectation clear.
This commit is contained in:
@@ -38,15 +38,12 @@ class InventoryParser(object):
|
||||
with their associated hosts and variable settings.
|
||||
"""
|
||||
|
||||
def __init__(self, loader, groups=None, filename=C.DEFAULT_HOST_LIST):
|
||||
if groups is None:
|
||||
groups = dict()
|
||||
|
||||
def __init__(self, loader, groups, filename=C.DEFAULT_HOST_LIST):
|
||||
self._loader = loader
|
||||
self.filename = filename
|
||||
|
||||
# Start with an empty host list and the default 'all' and
|
||||
# 'ungrouped' groups.
|
||||
# Start with an empty host list and whatever groups we're passed in
|
||||
# (which should include the default 'all' and 'ungrouped' groups).
|
||||
|
||||
self.hosts = {}
|
||||
self.patterns = {}
|
||||
|
||||
Reference in New Issue
Block a user