From 7257750be6bd90e3e37433a54be589e3fa33d927 Mon Sep 17 00:00:00 2001 From: ZhiQiang Fan Date: Sat, 22 Feb 2014 11:58:38 +0800 Subject: [PATCH] Remove redundant default value None for dict.get The default value for dict.get is None, no need to specify again. Change-Id: I86006df029c0275da1aad0109b4390fdca19d967 --- heat/api/cfn/v1/stacks.py | 2 +- heat/api/openstack/v1/stacks.py | 2 +- heat/engine/resources/neutron/security_group.py | 2 +- heat/tests/v1_1/fakes.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/heat/api/cfn/v1/stacks.py b/heat/api/cfn/v1/stacks.py index e215b941a..7ae5eba64 100644 --- a/heat/api/cfn/v1/stacks.py +++ b/heat/api/cfn/v1/stacks.py @@ -501,7 +501,7 @@ class StackController(object): return self._id_format(result) con = req.context - stack_name = req.params.get('StackName', None) + stack_name = req.params.get('StackName') try: identity = stack_name and self._get_identity(con, stack_name) events = self.engine_rpcapi.list_events(con, identity) diff --git a/heat/api/openstack/v1/stacks.py b/heat/api/openstack/v1/stacks.py index 509d46937..fe794e122 100644 --- a/heat/api/openstack/v1/stacks.py +++ b/heat/api/openstack/v1/stacks.py @@ -343,7 +343,7 @@ class StackController(object): """ 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 { 'resource_types': self.engine.list_resource_types(req.context, support_status)} diff --git a/heat/engine/resources/neutron/security_group.py b/heat/engine/resources/neutron/security_group.py index 23e44db49..fd58e1360 100644 --- a/heat/engine/resources/neutron/security_group.py +++ b/heat/engine/resources/neutron/security_group.py @@ -174,7 +174,7 @@ class SecurityGroup(neutron.NeutronResource): rule[self.RULE_REMOTE_GROUP_ID] = None 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]) return rule diff --git a/heat/tests/v1_1/fakes.py b/heat/tests/v1_1/fakes.py index 0e7e91804..b88b7d013 100644 --- a/heat/tests/v1_1/fakes.py +++ b/heat/tests/v1_1/fakes.py @@ -60,7 +60,7 @@ class FakeHTTPClient(base_client.HTTPClient): (method, url, callback)) # 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) if hasattr(status, 'items'):