from snaps.config.volume import VolumeConfig
from snaps.openstack.openstack_creator import OpenStackVolumeObject
-from snaps.openstack.utils import cinder_utils
+from snaps.openstack.utils import cinder_utils, keystone_utils
__author__ = 'spisarski'
self.volume_settings = volume_settings
self.__volume = None
+ self.__keystone = None
def initialize(self):
"""
"""
super(self.__class__, self).initialize()
+ self.__keystone = keystone_utils.keystone_client(self._os_creds)
self.__volume = cinder_utils.get_volume(
- self._cinder, volume_settings=self.volume_settings)
+ self._cinder, self.__keystone,
+ volume_settings=self.volume_settings,
+ project_name=self._os_creds.project_name)
return self.__volume
def create(self, block=False):
if not self.__volume:
self.__volume = cinder_utils.create_volume(
- self._cinder, self.volume_settings)
+ self._cinder, self.__keystone, self.volume_settings)
logger.info(
'Created volume with name - %s', self.volume_settings.name)