1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #12847 from godfreyduke/devel

Remove mutable default arguments.
This commit is contained in:
Toshio Kuratomi 2015-10-20 23:25:49 -07:00
commit 6b419db9fa
2 changed files with 6 additions and 2 deletions

View file

@ -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]

View file

@ -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)