summaryrefslogtreecommitdiffstats
path: root/openstack/common/rpc/impl_qpid.py
diff options
context:
space:
mode:
authorDoug Hellmann <doug.hellmann@dreamhost.com>2012-11-07 14:33:24 -0500
committerDoug Hellmann <doug.hellmann@dreamhost.com>2012-11-07 14:33:24 -0500
commitcf849e0b41e363f7efe18deaf4880f1e8c6235cd (patch)
treedecdc2d7c1325067478ba6f2236a836079c04b74 /openstack/common/rpc/impl_qpid.py
parentac4515559fb7bd1a480f7260b7143ebf84e2202a (diff)
Clean up dictionary use in RPC drivers
Initialize the base dictionary before setting overrides. Do not modify the argument passed to Connection.__init__. Change-Id: I5479483509efe6966094b50af2703e566a99dace Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Diffstat (limited to 'openstack/common/rpc/impl_qpid.py')
-rw-r--r--openstack/common/rpc/impl_qpid.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/openstack/common/rpc/impl_qpid.py b/openstack/common/rpc/impl_qpid.py
index 1b81cd9..c29da5d 100644
--- a/openstack/common/rpc/impl_qpid.py
+++ b/openstack/common/rpc/impl_qpid.py
@@ -294,17 +294,13 @@ class Connection(object):
self.consumer_thread = None
self.conf = conf
- if server_params is None:
- server_params = {}
-
- default_params = dict(hostname=self.conf.qpid_hostname,
- port=self.conf.qpid_port,
- username=self.conf.qpid_username,
- password=self.conf.qpid_password)
-
- params = server_params
- for key in default_params.keys():
- params.setdefault(key, default_params[key])
+ params = {
+ 'hostname': self.conf.qpid_hostname,
+ 'port': self.conf.qpid_port,
+ 'username': self.conf.qpid_username,
+ 'password': self.conf.qpid_password,
+ }
+ params.update(server_params or {})
self.broker = params['hostname'] + ":" + str(params['port'])
# Create the connection - this does not open the connection