Merge "Don't use default mutable parameter"

This commit is contained in:
Zuul 2019-04-17 06:41:00 +00:00 committed by Gerrit Code Review
commit 7704797493
8 changed files with 8 additions and 8 deletions

View File

@ -70,7 +70,7 @@ class OpenStackActionGenerator(action_generator.ActionGenerator):
base_action_class = None
@classmethod
def prepare_action_inputs(cls, origin_inputs, added=[]):
def prepare_action_inputs(cls, origin_inputs, added=()):
"""Modify action input string.
Sometimes we need to change the default action input definition for

View File

@ -16,7 +16,7 @@ from pecan import hooks
class ContentTypeHook(hooks.PecanHook):
def __init__(self, content_type, methods=['GET']):
def __init__(self, content_type, methods=('GET',)):
"""Content type hook.
This hook is needed for changing content type of

View File

@ -158,7 +158,7 @@ class BaseSpec(object):
_version = '2.0'
@classmethod
def get_schema(cls, includes=['meta', 'definitions']):
def get_schema(cls, includes=('meta', 'definitions')):
schema = copy.deepcopy(cls._schema)
schema['properties'] = utils.merge_dicts(

View File

@ -107,7 +107,7 @@ class OnClauseSpec(base.BaseSpec):
self._next = prepare_next_clause(data.get('next'))
@classmethod
def get_schema(cls, includes=['definitions']):
def get_schema(cls, includes=('definitions',)):
return super(OnClauseSpec, cls).get_schema(includes)
def get_publish(self):

View File

@ -34,7 +34,7 @@ class PoliciesSpec(base.BaseSpec):
}
@classmethod
def get_schema(cls, includes=['definitions']):
def get_schema(cls, includes=('definitions',)):
return super(PoliciesSpec, cls).get_schema(includes)
def __init__(self, data, validate):

View File

@ -37,7 +37,7 @@ class PublishSpec(base.BaseSpec):
self._atomic = self._data.get('atomic')
@classmethod
def get_schema(cls, includes=['definitions']):
def get_schema(cls, includes=('definitions',)):
return super(PublishSpec, cls).get_schema(includes)
def validate_semantics(self):

View File

@ -51,7 +51,7 @@ class RetrySpec(base.BaseSpec):
}
@classmethod
def get_schema(cls, includes=['definitions']):
def get_schema(cls, includes=('definitions',)):
return super(RetrySpec, cls).get_schema(includes)
def __init__(self, data, validate):

View File

@ -50,7 +50,7 @@ class TaskDefaultsSpec(base.BaseSpec):
}
@classmethod
def get_schema(cls, includes=['definitions']):
def get_schema(cls, includes=('definitions',)):
return super(TaskDefaultsSpec, cls).get_schema(includes)
def __init__(self, data, validate):