Merge "Use Cinder v2 API within Generic driver"

This commit is contained in:
Jenkins 2015-01-06 01:41:38 +00:00 committed by Gerrit Code Review
commit d2a022d64d
4 changed files with 9 additions and 11 deletions

View File

@ -246,7 +246,7 @@ class API(base.Base):
for volume in volumes: for volume in volumes:
volume_data = cinder.cinderclient(context).volumes.get(volume.id) volume_data = cinder.cinderclient(context).volumes.get(volume.id)
volume.name = volume_data.display_name volume.name = volume_data.name
return volumes return volumes

View File

@ -26,7 +26,7 @@ from manila.volume import cinder
class Volume(object): class Volume(object):
def __init__(self, volume_id): def __init__(self, volume_id):
self.id = volume_id self.id = volume_id
self.display_name = volume_id self.name = volume_id
class FakeNovaClient(object): class FakeNovaClient(object):

View File

@ -28,7 +28,6 @@ class FakeVolume(object):
self.id = kwargs.pop('id', 'fake_vol_id') self.id = kwargs.pop('id', 'fake_vol_id')
self.status = kwargs.pop('status', 'available') self.status = kwargs.pop('status', 'available')
self.device = kwargs.pop('device', '') self.device = kwargs.pop('device', '')
self.display_name = kwargs.pop('display_name', 'fake_vol_name')
for key, value in kwargs.items(): for key, value in kwargs.items():
setattr(self, key, value) setattr(self, key, value)
@ -40,7 +39,6 @@ class FakeVolumeSnapshot(object):
def __init__(self, **kwargs): def __init__(self, **kwargs):
self.id = kwargs.pop('id', 'fake_volsnap_id') self.id = kwargs.pop('id', 'fake_volsnap_id')
self.status = kwargs.pop('status', 'available') self.status = kwargs.pop('status', 'available')
self.display_name = kwargs.pop('display_name', 'fake_volsnap_name')
for key, value in kwargs.items(): for key, value in kwargs.items():
setattr(self, key, value) setattr(self, key, value)

View File

@ -22,7 +22,7 @@ import sys
from cinderclient import exceptions as cinder_exception from cinderclient import exceptions as cinder_exception
from cinderclient import service_catalog from cinderclient import service_catalog
from cinderclient.v1 import client as cinder_client from cinderclient.v2 import client as cinder_client
from oslo.config import cfg from oslo.config import cfg
from manila.db import base from manila.db import base
@ -136,8 +136,8 @@ def _untranslate_volume_summary_view(context, vol):
else: else:
d['attach_status'] = 'detached' d['attach_status'] = 'detached'
d['display_name'] = vol.display_name d['name'] = vol.name
d['display_description'] = vol.display_description d['description'] = vol.description
d['volume_type_id'] = vol.volume_type d['volume_type_id'] = vol.volume_type
d['snapshot_id'] = vol.snapshot_id d['snapshot_id'] = vol.snapshot_id
@ -161,8 +161,8 @@ def _untranslate_snapshot_summary_view(context, snapshot):
d['progress'] = snapshot.progress d['progress'] = snapshot.progress
d['size'] = snapshot.size d['size'] = snapshot.size
d['created_at'] = snapshot.created_at d['created_at'] = snapshot.created_at
d['display_name'] = snapshot.display_name d['name'] = snapshot.name
d['display_description'] = snapshot.display_description d['description'] = snapshot.description
d['volume_id'] = snapshot.volume_id d['volume_id'] = snapshot.volume_id
d['project_id'] = snapshot.project_id d['project_id'] = snapshot.project_id
d['volume_size'] = snapshot.size d['volume_size'] = snapshot.size
@ -289,8 +289,8 @@ class API(base.Base):
snapshot_id = None snapshot_id = None
kwargs = dict(snapshot_id=snapshot_id, kwargs = dict(snapshot_id=snapshot_id,
display_name=name, name=name,
display_description=description, description=description,
volume_type=volume_type, volume_type=volume_type,
user_id=context.user_id, user_id=context.user_id,
project_id=context.project_id, project_id=context.project_id,