summaryrefslogtreecommitdiff
path: root/openstackclient/common/clientmanager.py
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-04-23 09:49:35 +0000
committerGerrit Code Review <review@openstack.org>2018-04-23 09:49:35 +0000
commit06263bd5852aad9cd03a76f50140fbbb2d0751ba (patch)
tree1b2c493ee53b5cdd95325e4fd5513e4287446cc8 /openstackclient/common/clientmanager.py
parentb59de7b8494ddbde3570780214378cdb2208c482 (diff)
parent24b06ef273e193819624fd2e021282d2735977b0 (diff)
downloadpython-openstackclient-06263bd5852aad9cd03a76f50140fbbb2d0751ba.tar.gz
Merge "Fix limits show command without Nova and Cinder"
Diffstat (limited to 'openstackclient/common/clientmanager.py')
-rw-r--r--openstackclient/common/clientmanager.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/openstackclient/common/clientmanager.py b/openstackclient/common/clientmanager.py
index 89781052..aa1045e4 100644
--- a/openstackclient/common/clientmanager.py
+++ b/openstackclient/common/clientmanager.py
@@ -125,6 +125,25 @@ class ClientManager(clientmanager.ClientManager):
# use Network API by default
return self.is_service_available('network') is not False
+ def is_compute_endpoint_enabled(self):
+ """Check if Compute endpoint is enabled"""
+
+ return self.is_service_available('compute') is not False
+
+ def is_volume_endpoint_enabled(self, volume_client):
+ """Check if volume endpoint is enabled"""
+ # NOTE(jcross): Cinder did some interesting things with their service
+ # name so we need to figure out which version to look
+ # for when calling is_service_available()
+ volume_version = volume_client.api_version.ver_major
+ if self.is_service_available(
+ "volumev%s" % volume_version) is not False:
+ return True
+ elif self.is_service_available('volume') is not False:
+ return True
+ else:
+ return False
+
# Plugin Support