Fix mutable default argument

This commit is contained in:
Victor Salgado
2015-09-16 16:49:45 -03:00
parent 33e79203ce
commit 54f1560d3e
3 changed files with 11 additions and 3 deletions

View File

@@ -36,7 +36,9 @@ from ansible.module_utils.basic import json_dict_bytes_to_unicode
class InventoryScript:
''' Host inventory parser for ansible using external inventory scripts. '''
def __init__(self, loader, groups=dict(), filename=C.DEFAULT_HOST_LIST):
def __init__(self, loader, groups=None, filename=C.DEFAULT_HOST_LIST):
if groups is None:
groups = dict()
self._loader = loader
self.groups = groups