diff options
author | gduke <godfrey.duke@gmail.com> | 2015-10-20 22:13:23 -0700 |
---|---|---|
committer | gduke <godfrey.duke@gmail.com> | 2015-10-20 22:13:23 -0700 |
commit | 744679601fa3612c4700ee4c52486ba512d10eff (patch) | |
tree | c204ae16ef1dcefaa4455d0a21868370dbb6daec | |
parent | 10e2fc6f60c242c5d0da0336a539ce886a744a9e (diff) | |
download | ansible-744679601fa3612c4700ee4c52486ba512d10eff.tar.gz |
Remove mutable default arguments.
-rw-r--r-- | lib/ansible/module_utils/cloudstack.py | 4 | ||||
-rw-r--r-- | lib/ansible/module_utils/urls.py | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/ansible/module_utils/cloudstack.py b/lib/ansible/module_utils/cloudstack.py index d20b750f7e..549f6afcba 100644 --- a/lib/ansible/module_utils/cloudstack.py +++ b/lib/ansible/module_utils/cloudstack.py @@ -150,7 +150,9 @@ class AnsibleCloudStack(object): return False - def _get_by_key(self, key=None, my_dict={}): + def _get_by_key(self, key=None, my_dict=None): + if my_dict is None: + my_dict = {} if key: if key in my_dict: return my_dict[key] diff --git a/lib/ansible/module_utils/urls.py b/lib/ansible/module_utils/urls.py index 5fa5f08183..f68f8133cc 100644 --- a/lib/ansible/module_utils/urls.py +++ b/lib/ansible/module_utils/urls.py @@ -400,7 +400,9 @@ class RequestWithMethod(urllib2.Request): Originally contained in library/net_infrastructure/dnsmadeeasy ''' - def __init__(self, url, method, data=None, headers={}): + def __init__(self, url, method, data=None, headers=None): + if headers is None: + headers = {} self._method = method urllib2.Request.__init__(self, url, data, headers) |