diff options
-rw-r--r-- | nova/rpc.py | 4 | ||||
-rw-r--r-- | nova/utils.py | 11 |
2 files changed, 2 insertions, 13 deletions
diff --git a/nova/rpc.py b/nova/rpc.py index 8b0c6df67..f5dd49982 100644 --- a/nova/rpc.py +++ b/nova/rpc.py @@ -17,7 +17,7 @@ # under the License. -from nova.utils import load_module +from nova.utils import import_object from nova.rpc_backends.common import RemoteError, LOG from nova import flags @@ -26,7 +26,7 @@ flags.DEFINE_string('rpc_backend', 'nova.rpc_backends.amqp', "The messaging module to use, defaults to AMQP.") -RPCIMPL = load_module(FLAGS.rpc_backend) +RPCIMPL = import_object(FLAGS.rpc_backend) def create_connection(new=True): diff --git a/nova/utils.py b/nova/utils.py index ad31f88bd..8784a227d 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -809,14 +809,3 @@ class Bootstrapper(object): for key in FLAGS: value = FLAGS.get(key, None) logging.audit(_("%(key)s : %(value)s" % locals())) - - -def load_module(name): - mod = __import__(name) - - components = name.split('.') - - for comp in components[1:]: - mod = getattr(mod, comp) - - return mod |