import logging
from cinderclient import client as ciclient
import cinderclient.exceptions as CinderException
+import keystoneauth1
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
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()
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)
+ except Exception as e:
+ self.cinder_drv = None
self.ceilo_drv = ce_drv.CeilometerDriver(self.sess_drv,
region_name = region,
def build_cinder_resource_cache(self):
self.log.info("Building cinder resource cache")
- self._build_cinder_volume_list()
+ 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")
# Important information about openstack installation. This needs to be manually verified
#
openstack_info = {
- 'username' : 'xxxxxx',
+ 'username' : 'xxxx',
'password' : 'xxxxxx',
- 'auth_url' : 'http://10.66.4.102:5000/v2.0/',
- 'project_name' : 'xxxxxx',
+ 'auth_url' : 'http://10.66.4.19:5000/v2.0/',
+ 'project_name' : 'xxxxx',
'mgmt_network' : 'private',
'reserved_flavor' : 'm1.medium',
'reserved_image' : 'Fedora-x86_64-20-20131211.1-sda-ping.qcow2',
self.assertEqual(found, True)
logger.info("Openstack-CAL-Test: Passed VDU list" )
- #@unittest.skip("Skipping test_create_delete_virtual_link_and_vdu")
+ @unittest.skip("Skipping test_create_delete_virtual_link_and_vdu")
def test_create_delete_virtual_link_and_vdu(self):
"""
Test to create VDU
self.assertEqual(found, True)
logger.info("Openstack-CAL-Test: Passed VDU list" )
+ @unittest.skip("Skipping test_validate_creds")
+ def test_validate_creds(self):
+ """
+ Test validate creds
+ """
+ logger.info("Openstack-CAL-Test: Test validate creds")
+ status = self.cal.validate_cloud_creds(self._acct)
+ logger.info("Openstack-CAL-Test: Passed validate creds")
+
class VmData(object):
"""A convenience class that provides all the stats and EPA Attributes
from the VM provided