From 6305abbbf8b604ad297dc35be656540f855147ff Mon Sep 17 00:00:00 2001 From: Shaojiang Deng Date: Fri, 18 Dec 2015 10:45:30 +0800 Subject: [PATCH] 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 --- cinderclient/openstack/common/apiclient/fake_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cinderclient/openstack/common/apiclient/fake_client.py b/cinderclient/openstack/common/apiclient/fake_client.py index dcc2a5be6..802718652 100644 --- a/cinderclient/openstack/common/apiclient/fake_client.py +++ b/cinderclient/openstack/common/apiclient/fake_client.py @@ -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