~ubuntu-branches/ubuntu/saucy/nova/saucy-proposed

« back to all changes in this revision

Viewing changes to nova/api/openstack/volume/volumes.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-05-24 13:12:53 UTC
  • mfrom: (1.1.55)
  • Revision ID: package-import@ubuntu.com-20120524131253-ommql08fg1en06ut
Tags: 2012.2~f1-0ubuntu1
* New upstream release.
* Prepare for quantal:
  - Dropped debian/patches/upstream/0006-Use-project_id-in-ec2.cloud._format_image.patch
  - Dropped debian/patches/upstream/0005-Populate-image-properties-with-project_id-again.patch
  - Dropped debian/patches/upstream/0004-Fixed-bug-962840-added-a-test-case.patch
  - Dropped debian/patches/upstream/0003-Allow-unprivileged-RADOS-users-to-access-rbd-volumes.patch
  - Dropped debian/patches/upstream/0002-Stop-libvirt-test-from-deleting-instances-dir.patch
  - Dropped debian/patches/upstream/0001-fix-bug-where-nova-ignores-glance-host-in-imageref.patch 
  - Dropped debian/patches/0001-fix-useexisting-deprecation-warnings.patch
* debian/control: Add python-keystone as a dependency. (LP: #907197)
* debian/patches/kombu_tests_timeout.patch: Refreshed.
* debian/nova.conf, debian/nova-common.postinst: Convert to new ini
  file configuration
* debian/patches/nova-manage_flagfile_location.patch: Refreshed

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
"""The volumes api."""
17
17
 
 
18
import webob
18
19
from webob import exc
19
 
import webob
20
20
 
21
21
from nova.api.openstack import common
22
22
from nova.api.openstack import wsgi
48
48
    """Maps keys for attachment summary view."""
49
49
    d = {}
50
50
 
51
 
    # TODO(bcwaldon): remove str cast once we use uuids
52
 
    volume_id = str(vol['id'])
 
51
    volume_id = vol['id']
53
52
 
54
53
    # NOTE(justinsb): We use the volume id as the id of the attachment object
55
54
    d['id'] = volume_id
56
55
 
57
56
    d['volume_id'] = volume_id
58
 
    if vol.get('instance'):
59
 
        d['server_id'] = vol['instance']['uuid']
 
57
    d['server_id'] = vol['instance_uuid']
60
58
    if vol.get('mountpoint'):
61
59
        d['device'] = vol['mountpoint']
62
60
 
77
75
    """Maps keys for volumes summary view."""
78
76
    d = {}
79
77
 
80
 
    # TODO(bcwaldon): remove str cast once we use uuids
81
 
    d['id'] = str(vol['id'])
 
78
    d['id'] = vol['id']
82
79
    d['status'] = vol['status']
83
80
    d['size'] = vol['size']
84
81
    d['availability_zone'] = vol['availability_zone']
99
96
        d['volume_type'] = str(vol['volume_type_id'])
100
97
 
101
98
    d['snapshot_id'] = vol['snapshot_id']
102
 
    # TODO(bcwaldon): remove str cast once we use uuids
103
 
    if d['snapshot_id'] is not None:
104
 
        d['snapshot_id'] = str(d['snapshot_id'])
105
99
 
106
100
    LOG.audit(_("vol=%s"), vol, context=context)
107
101