projects
/
osm
/
SO.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update from RIFT as of 696b75d2fe9fb046261b08c616f1bcf6c0b54a9b second try
[osm/SO.git]
/
rwcal
/
plugins
/
vala
/
rwcal_openstack
/
rift
/
rwcal
/
openstack
/
cinder
/
cinder_drv.py
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
76bc8fe
..
9c4bdb2
100644
(file)
--- 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 logging
from cinderclient import client as ciclient
import cinderclient.exceptions as CinderException
+import keystoneauth1
class CinderAPIVersionException(Exception):
class CinderAPIVersionException(Exception):
@@
-29,12
+30,16
@@
class CinderAPIVersionException(Exception):
return self.__repr__()
def __repr__(self):
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
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
class CinderDriver(object):
"""
CinderDriver Class for image management
@@
-89,6
+94,12
@@
class CinderDriver(object):
else:
raise CinderAPIVersionException(errors)
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()
@property
def cinder_endpoint(self):
return self._ci_drv.client.get_endpoint()
@@
-144,6
+155,8
@@
class CinderDriver(object):
"""
try:
vol = self._ci_drv.volumes.get(volume_id)
"""
try:
vol = self._ci_drv.volumes.get(volume_id)
+ except ciclient.exceptions.NotFound:
+ return None
except Exception as e:
self.log.error("Get volume operation failed. Exception: %s", str(e))
raise
except Exception as e:
self.log.error("Get volume operation failed. Exception: %s", str(e))
raise