quantumclient = None
logger.info('quantumclient not available')
try:
- from cinderclient.v1 import client as cinderclient
- from cinderclient import exceptions as cinder_exceptions
+ from cinderclient import client as cinderclient
except ImportError:
cinderclient = None
logger.info('cinderclient not available')
return None
logger.debug('cinder args %s', args)
- self._cinder = cinderclient.Client(**args)
+ self._cinder = cinderclient.Client('1', **args)
if con.password is None and con.auth_token is not None:
management_url = self.url_for(service_type='volume')
self._cinder.client.auth_token = con.auth_token
try:
vol = self.cinder().volumes.get(volume_id)
- except cinder_exceptions.NotFound:
+ except cinderclient.exceptions.NotFound:
logger.warning('Volume %s - not found' %
(volume_id))
return
pass
vol.get()
logger.info('volume status of %s now %s' % (volume_id, vol.status))
- except cinder_exceptions.NotFound:
+ except cinderclient.exceptions.NotFound:
logger.warning('Volume %s - not found' %
(volume_id))
raise exception.Error("Volume in use")
self.cinder().volumes.delete(self.resource_id)
- except clients.cinder_exceptions.NotFound:
+ except clients.cinderclient.exceptions.NotFound:
pass
if volume_backups is not None:
self.cinder_fc.volumes.delete('vol-123').AndReturn(None)
self.cinder_fc.volumes.get('vol-123').AndRaise(
- clients.cinder_exceptions.NotFound('Not found'))
+ clients.cinderclient.exceptions.NotFound('Not found'))
self.m.ReplayAll()
t = template_format.parse(volume_template)