From 33b12d3c18a35f85785227267347f9ac7f7273a4 Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Mon, 14 Jan 2013 12:54:43 -0500 Subject: Implement importutils.try_import. Adds a new (simple) importutils.try_import function which can return a module name or a default (by default this is None). This should help clean up some of our try: import foo except... blocks in modules. This commit also drops the dependency on python-extras which is no longer needed. Fixes LP Bug #1099501. Change-Id: I8591f79983bdad67a50d1aaae6dce8428dfce084 --- openstack/common/service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'openstack/common/service.py') diff --git a/openstack/common/service.py b/openstack/common/service.py index 740378f..6b180aa 100644 --- a/openstack/common/service.py +++ b/openstack/common/service.py @@ -27,17 +27,17 @@ import sys import time import eventlet -import extras import logging as std_logging from openstack.common import cfg from openstack.common import eventlet_backdoor from openstack.common.gettextutils import _ +from openstack.common import importutils from openstack.common import log as logging from openstack.common import threadgroup -rpc = extras.try_import('openstack.common.rpc') +rpc = importutils.try_import('openstack.common.rpc') CONF = cfg.CONF LOG = logging.getLogger(__name__) -- cgit