summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-06-11 16:33:01 +0000
committerGerrit Code Review <review@openstack.org>2014-06-11 16:33:01 +0000
commit3ac07c2316435606f2aa5af168746703e1a1b024 (patch)
treea2989fad0fd3edc125c5407dd89b93967586307b
parent433a27f52e0811cf759b8c0bdafb4e30e7a77ae9 (diff)
parent05b0ff1155004ed4bbf80213ad5bfd33d3457643 (diff)
downloadheat-2014.2.b1.tar.gz
Merge "Remove optional imports from clients.py"2014.2.b1
-rw-r--r--heat/engine/clients.py52
1 files changed, 6 insertions, 46 deletions
diff --git a/heat/engine/clients.py b/heat/engine/clients.py
index ff70fe993..6b841a717 100644
--- a/heat/engine/clients.py
+++ b/heat/engine/clients.py
@@ -11,10 +11,16 @@
# License for the specific language governing permissions and limitations
# under the License.
+from ceilometerclient import client as ceilometerclient
+from cinderclient import client as cinderclient
+from glanceclient import client as glanceclient
from heatclient import client as heatclient
+from neutronclient.v2_0 import client as neutronclient
from novaclient import client as novaclient
from novaclient import shell as novashell
from oslo.config import cfg
+from swiftclient import client as swiftclient
+from troveclient import client as troveclient
from heat.common import heat_keystoneclient as hkc
from heat.openstack.common.gettextutils import _
@@ -24,40 +30,6 @@ from heat.openstack.common import log as logging
LOG = logging.getLogger(__name__)
-try:
- from swiftclient import client as swiftclient
-except ImportError:
- swiftclient = None
- LOG.info(_('swiftclient not available'))
-try:
- from neutronclient.v2_0 import client as neutronclient
-except ImportError:
- neutronclient = None
- LOG.info(_('neutronclient not available'))
-try:
- from cinderclient import client as cinderclient
-except ImportError:
- cinderclient = None
- LOG.info(_('cinderclient not available'))
-
-try:
- from troveclient import client as troveclient
-except ImportError:
- troveclient = None
- LOG.info(_('troveclient not available'))
-
-try:
- from ceilometerclient import client as ceilometerclient
-except ImportError:
- ceilometerclient = None
- LOG.info(_('ceilometerclient not available'))
-
-try:
- from glanceclient import client as glanceclient
-except ImportError:
- glanceclient = None
- LOG.info(_('glanceclient not available'))
-
_default_backend = "heat.engine.clients.OpenStackClients"
cloud_opts = [
@@ -132,8 +104,6 @@ class OpenStackClients(object):
return client
def swift(self):
- if swiftclient is None:
- return None
if self._swift:
return self._swift
@@ -156,8 +126,6 @@ class OpenStackClients(object):
return self._swift
def glance(self):
- if glanceclient is None:
- return None
if self._glance:
return self._glance
@@ -181,8 +149,6 @@ class OpenStackClients(object):
return self._glance
def neutron(self):
- if neutronclient is None:
- return None
if self._neutron:
return self._neutron
@@ -208,8 +174,6 @@ class OpenStackClients(object):
return self._neutron
def cinder(self):
- if cinderclient is None:
- return None
if self._cinder:
return self._cinder
@@ -235,8 +199,6 @@ class OpenStackClients(object):
return self._cinder
def trove(self, service_type="database"):
- if troveclient is None:
- return None
if self._trove:
return self._trove
@@ -262,8 +224,6 @@ class OpenStackClients(object):
return self._trove
def ceilometer(self):
- if ceilometerclient is None:
- return None
if self._ceilometer:
return self._ceilometer