From 50d75f8d6d5c570bfc1a13a8da6162531a2a947e Mon Sep 17 00:00:00 2001 From: Abhijit Menon-Sen Date: Wed, 30 Sep 2015 15:13:37 +0530 Subject: 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. --- lib/ansible/inventory/ini.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/ansible/inventory/ini.py b/lib/ansible/inventory/ini.py index d7b28fde2e..cd1a320531 100644 --- a/lib/ansible/inventory/ini.py +++ b/lib/ansible/inventory/ini.py @@ -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 = {} -- cgit v1.2.1