projects
/
osm
/
SO.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix DTS updates in package manager publisher
[osm/SO.git]
/
rwcal
/
plugins
/
vala
/
rwcal_openstack
/
rift
/
rwcal
/
openstack
/
openstack_drv.py
diff --git
a/rwcal/plugins/vala/rwcal_openstack/rift/rwcal/openstack/openstack_drv.py
b/rwcal/plugins/vala/rwcal_openstack/rift/rwcal/openstack/openstack_drv.py
index
ffab014
..
6ee2cb6
100644
(file)
--- a/
rwcal/plugins/vala/rwcal_openstack/rift/rwcal/openstack/openstack_drv.py
+++ b/
rwcal/plugins/vala/rwcal_openstack/rift/rwcal/openstack/openstack_drv.py
@@
-132,10
+132,13
@@
class OpenstackDriver(object):
self.glance_drv = gl_drv.GlanceDriver(self.sess_drv,
region_name = region,
logger = self.log)
self.glance_drv = gl_drv.GlanceDriver(self.sess_drv,
region_name = region,
logger = self.log)
-
- self.cinder_drv = ci_drv.CinderDriver(self.sess_drv,
+
+ try:
+ self.cinder_drv = ci_drv.CinderDriver(self.sess_drv,
region_name = region,
logger = self.log)
region_name = region,
logger = self.log)
+ except Exception as e:
+ self.cinder_drv = None
self.ceilo_drv = ce_drv.CeilometerDriver(self.sess_drv,
region_name = region,
self.ceilo_drv = ce_drv.CeilometerDriver(self.sess_drv,
region_name = region,
@@
-223,8
+226,15
@@
class OpenstackDriver(object):
self.log.info("Discovering images")
self.glance_cache['images'] = self._cache_populate(self.glance_image_list,
list())
self.log.info("Discovering images")
self.glance_cache['images'] = self._cache_populate(self.glance_image_list,
list())
+
return self.glance_cache['images']
return self.glance_cache['images']
+ def _build_cinder_volume_list(self):
+ self.log.info("Discovering volumes")
+ vollist = self.cinder_volume_list()
+ self.cinder_cache['volumes'] = self._cache_populate(self.cinder_volume_list,
+ list())
+ return self.cinder_cache['volumes']
def build_nova_resource_cache(self):
self.log.info("Building nova resource cache")
def build_nova_resource_cache(self):
self.log.info("Building nova resource cache")
@@
-239,8
+249,9
@@
class OpenstackDriver(object):
self._build_neutron_subnet_prefix_list()
def build_cinder_resource_cache(self):
self._build_neutron_subnet_prefix_list()
def build_cinder_resource_cache(self):
- pass
-
+ self.log.info("Building cinder resource cache")
+ if self.cinder_drv is not None:
+ self._build_cinder_volume_list()
def build_glance_resource_cache(self):
self.log.info("Building glance resource cache")
def build_glance_resource_cache(self):
self.log.info("Building glance resource cache")
@@
-293,6
+304,13
@@
class OpenstackDriver(object):
else:
return self._build_glance_image_list()
else:
return self._build_glance_image_list()
+ @property
+ def _cinder_volume_list(self):
+ if 'volumes' in self.cinder_cache:
+ return self.cinder_cache['volumes']
+ else:
+ return self._build_cinder_volume_list()
+
def validate_account_creds(self):
try:
self.sess_drv.invalidate_auth_token()
def validate_account_creds(self):
try:
self.sess_drv.invalidate_auth_token()