summaryrefslogtreecommitdiffstats
path: root/openstack/common/rpc/impl_zmq.py
diff options
context:
space:
mode:
authorEric Windisch <eric@cloudscaling.com>2013-01-30 20:48:05 -0500
committerEric Windisch <eric@cloudscaling.com>2013-01-30 20:58:46 -0500
commitd0b39463831ac818ba97ff7489685da1d8db5f60 (patch)
treec715975658c6af0e196adeb9c2d839be0ec40371 /openstack/common/rpc/impl_zmq.py
parentc29263c4a81d2e71a3d6e36eb32e5df9d2c8fb05 (diff)
downloadoslo-d0b39463831ac818ba97ff7489685da1d8db5f60.tar.gz
oslo-d0b39463831ac818ba97ff7489685da1d8db5f60.tar.xz
oslo-d0b39463831ac818ba97ff7489685da1d8db5f60.zip
Use importutils for matchmaker import.
Per Vish's suggestion. this should be simplier, cull redundant code, and otherwise cut the fat. Change-Id: I9fa3effdc8e9e2f3f124690ecf77ee8bb7d4d39e
Diffstat (limited to 'openstack/common/rpc/impl_zmq.py')
-rw-r--r--openstack/common/rpc/impl_zmq.py16
1 files changed, 1 insertions, 15 deletions
diff --git a/openstack/common/rpc/impl_zmq.py b/openstack/common/rpc/impl_zmq.py
index 86d2bc5..ea461a7 100644
--- a/openstack/common/rpc/impl_zmq.py
+++ b/openstack/common/rpc/impl_zmq.py
@@ -17,7 +17,6 @@
import os
import pprint
import socket
-import string
import sys
import types
import uuid
@@ -780,18 +779,5 @@ def _get_ctxt():
def _get_matchmaker():
global matchmaker
if not matchmaker:
- # rpc_zmq_matchmaker should be set to a 'module.Class'
- mm_path = CONF.rpc_zmq_matchmaker.split('.')
- mm_module = '.'.join(mm_path[:-1])
- mm_class = mm_path[-1]
-
- # Only initialize a class.
- if mm_path[-1][0] not in string.ascii_uppercase:
- LOG.error(_("Matchmaker could not be loaded.\n"
- "rpc_zmq_matchmaker is not a class."))
- raise RPCException(_("Error loading Matchmaker."))
-
- mm_impl = importutils.import_module(mm_module)
- mm_constructor = getattr(mm_impl, mm_class)
- matchmaker = mm_constructor()
+ matchmaker = importutils.import_object(CONF.rpc_zmq_matchmaker)
return matchmaker