Merge "Remove redundant default value None for dict.get"

This commit is contained in:
Jenkins 2014-03-03 19:35:56 +00:00 committed by Gerrit Code Review
commit 7d47acb3cb
4 changed files with 4 additions and 4 deletions

View File

@ -503,7 +503,7 @@ class StackController(object):
return self._id_format(result) return self._id_format(result)
con = req.context con = req.context
stack_name = req.params.get('StackName', None) stack_name = req.params.get('StackName')
try: try:
identity = stack_name and self._get_identity(con, stack_name) identity = stack_name and self._get_identity(con, stack_name)
events = self.rpc_client.list_events(con, identity) events = self.rpc_client.list_events(con, identity)

View File

@ -356,7 +356,7 @@ class StackController(object):
""" """
Returns a list of valid resource types that may be used in a template. Returns a list of valid resource types that may be used in a template.
""" """
support_status = req.params.get('support_status', None) support_status = req.params.get('support_status')
return { return {
'resource_types': 'resource_types':
self.rpc_client.list_resource_types(req.context, support_status)} self.rpc_client.list_resource_types(req.context, support_status)}

View File

@ -174,7 +174,7 @@ class SecurityGroup(neutron.NeutronResource):
rule[self.RULE_REMOTE_GROUP_ID] = None rule[self.RULE_REMOTE_GROUP_ID] = None
for key in (self.RULE_PORT_RANGE_MIN, self.RULE_PORT_RANGE_MAX): for key in (self.RULE_PORT_RANGE_MIN, self.RULE_PORT_RANGE_MAX):
if rule.get(key, None) is not None: if rule.get(key) is not None:
rule[key] = str(rule[key]) rule[key] = str(rule[key])
return rule return rule

View File

@ -60,7 +60,7 @@ class FakeHTTPClient(base_client.HTTPClient):
(method, url, callback)) (method, url, callback))
# Note the call # Note the call
self.callstack.append((method, url, kwargs.get('body', None))) self.callstack.append((method, url, kwargs.get('body')))
status, body = getattr(self, callback)(**kwargs) status, body = getattr(self, callback)(**kwargs)
if hasattr(status, 'items'): if hasattr(status, 'items'):