Remove the mutable default arguments "[]"
Remove the default arguments "[]" when the function is defined. Ref: http://docs.python-guide.org/en/latest/writing/gotchas/ Change-Id: I92340596a6c9d1489b428b23adbfbddf2c5f4e59
This commit is contained in:
parent
614e6a380c
commit
6305abbbf8
@ -33,7 +33,9 @@ from six.moves.urllib import parse
|
||||
from cinderclient.openstack.common.apiclient import client
|
||||
|
||||
|
||||
def assert_has_keys(dct, required=[], optional=[]):
|
||||
def assert_has_keys(dct, required=None, optional=None):
|
||||
required = required or []
|
||||
optional = optional or []
|
||||
for k in required:
|
||||
try:
|
||||
assert k in dct
|
||||
|
Loading…
x
Reference in New Issue
Block a user