Merge "Do not use mutable object as func default param"

This commit is contained in:
Jenkins 2016-10-04 15:20:25 +00:00 committed by Gerrit Code Review
commit 24a06550fa
2 changed files with 6 additions and 2 deletions

View File

@ -858,7 +858,9 @@ class DracRAID(base.RAIDInterface):
node.driver_internal_info = driver_internal_info
node.save()
def _delete_cached_config_job_id(self, node, finished_config_job_ids=[]):
def _delete_cached_config_job_id(self, node, finished_config_job_ids=None):
if finished_config_job_ids is None:
finished_config_job_ids = []
driver_internal_info = node.driver_internal_info
unfinished_job_ids = [job_id for job_id
in driver_internal_info['raid_config_job_ids']

View File

@ -184,7 +184,8 @@ class BaseApiTest(base.DbTestCase):
return response
def get_json(self, path, expect_errors=False, headers=None,
extra_environ=None, q=[], path_prefix=PATH_PREFIX, **params):
extra_environ=None, q=None, path_prefix=PATH_PREFIX,
**params):
"""Sends simulated HTTP GET request to Pecan test app.
:param path: url path of target service
@ -198,6 +199,7 @@ class BaseApiTest(base.DbTestCase):
:param path_prefix: prefix of the url path
:param params: content for wsgi.input of request
"""
q = q if q is not None else []
full_path = path_prefix + path
query_params = {'q.field': [],
'q.value': [],