Convert nova.volume.api.API to use volume objects

Change-Id: If6b78f7de814116bc93b273ec300dba02e63593d
This commit is contained in:
Brian Waldon
2012-01-13 11:22:50 -08:00
parent 313c8ee83b
commit 195ecaf4ff
6 changed files with 58 additions and 84 deletions

View File

@@ -246,9 +246,9 @@ class API(base.Base):
vol_ref = self.volume_api.create(context,
vol_size,
None,
vol_name,
vol['description'],
None,
volume_type=vol_type,
metadata=dict(to_vsa_id=str(vsa_id)),
availability_zone=availability_zone)
@@ -349,7 +349,7 @@ class API(base.Base):
vol_name = volume['name']
LOG.info(_("VSA ID %(vsa_id)s: Deleting %(direction)s "\
"volume %(vol_name)s"), locals())
self.volume_api.delete(context, volume['id'])
self.volume_api.delete(context, volume)
except exception.ApiError:
LOG.info(_("Unable to delete volume %s"), volume['name'])
if force_delete:

View File

@@ -136,7 +136,7 @@ class VsaManager(manager.SchedulerDependentManager):
locals())
if status == 'available':
try:
# self.volume_api.update(context, volume['id'],
# self.volume_api.update(context, volume,
# dict(attach_status="attached"))
pass
except Exception as ex: