X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=rwcal%2Fplugins%2Fvala%2Frwcal_openstack%2Frift%2Frwcal%2Fopenstack%2Fcinder%2Fcinder_drv.py;h=5bb5cc4ae1a385b9524cb665d9534e48651b7715;hb=2b489616b8246c340072e46eb6dc8fb0ffa912ee;hp=76bc8fe0e2939389b0fe145330712120de187494;hpb=249c1132daf54bca919455a1b6d00cf8c2ef2798;p=osm%2FSO.git diff --git a/rwcal/plugins/vala/rwcal_openstack/rift/rwcal/openstack/cinder/cinder_drv.py b/rwcal/plugins/vala/rwcal_openstack/rift/rwcal/openstack/cinder/cinder_drv.py index 76bc8fe0..5bb5cc4a 100644 --- a/rwcal/plugins/vala/rwcal_openstack/rift/rwcal/openstack/cinder/cinder_drv.py +++ b/rwcal/plugins/vala/rwcal_openstack/rift/rwcal/openstack/cinder/cinder_drv.py @@ -18,6 +18,7 @@ import logging from cinderclient import client as ciclient import cinderclient.exceptions as CinderException +import keystoneauth1 class CinderAPIVersionException(Exception): @@ -29,12 +30,16 @@ class CinderAPIVersionException(Exception): return self.__repr__() def __repr__(self): - msg = "{} : Following Exception(s) have occured during Neutron API discovery".format(self.__class__) + msg = "{} : Following Exception(s) have occured during Cinder API discovery".format(self.__class__) for n,e in enumerate(self.errors): msg += "\n" msg += " {}: {}".format(n, str(e)) return msg +class CinderEndpointException(Exception): + "Cinder Endpoint is absent" + pass + class CinderDriver(object): """ CinderDriver Class for image management @@ -89,6 +94,12 @@ class CinderDriver(object): else: raise CinderAPIVersionException(errors) + try: + self._ci_drv.client.get_endpoint() + except keystoneauth1.exceptions.catalog.EndpointNotFound: + self.log.info("Cinder endpoint not found") + raise CinderEndpointException() + @property def cinder_endpoint(self): return self._ci_drv.client.get_endpoint()