~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, Adam Gandleman, Chuck Short
  • Date: 2012-03-02 11:04:04 UTC
  • mfrom: (1.1.47)
  • Revision ID: package-import@ubuntu.com-20120302110404-fr230yakr8hov3dj
Tags: 2012.1~e4-0ubuntu1
[ Adam Gandleman ]
* debian/patches/libvirt-use-console-pipe.patch: Refreshed. 
* debain/nova-volume.upstart.in: Ensure lock directory is created
  (LP: #940780)
* debain/control: Fix nova-compute-$flavor Depends
* debian/control: Add python-iso8601 to python-nova Depends

[ Chuck Short ]
* debian/rules: Fix FTBFS.
* Merge Ubuntu/Debian packaging:
  - Thanks to Julien Danjou, Ghe Rivero, and Thomas Goirand
  - debian/copyright: Update copyright file.
  - debian/nova-api.init, debian/nova-compute.init,
    debian/nova-network.init, debian/nova-objectstore,
    debian/nova-scheduler, debian/nova-volume.init:
    Synchronize init scripts.
  - nova-common.install, debian/rules: Install policy.json
  - debian/rules, debian/nova-xcp-network.install,
    debian/nova-xcp-plugins.install, nova-xcp-plugins.postrm,
    debian/nova-xcp-plugins.doc, debian/nova-xcp-plugins.postinst,
    debian/README.xcp_and_openstack, debian/control,
    debian/ubuntu_xen-openvswitch-nova.rules,
    debian/patches/path-to-the-xenhost.conf-fixup.patch:
    Add Xen XCP support.
  - debian/control,
    debian/nova-compute-{kvm,lxc,qemu,xen,uml}.postinst: Make
    nova-compute a virtual package.
  - Dropped ubuntu_ubuntu_control_vars: We dont use it
* New upstream release.
* Dropped python-babel, it will be handled by langpacks.
* debian/patches/ec2-fixes.patch: Backport turnk fix for ec2
  permissions.
* debian/patches/path-to-the-xenhost.conf-fixup.patch: Refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
    """Maps keys for attachment summary view."""
49
49
    d = {}
50
50
 
51
 
    volume_id = vol['id']
 
51
    # TODO(bcwaldon): remove str cast once we use uuids
 
52
    volume_id = str(vol['id'])
52
53
 
53
54
    # NOTE(justinsb): We use the volume id as the id of the attachment object
54
55
    d['id'] = volume_id
76
77
    """Maps keys for volumes summary view."""
77
78
    d = {}
78
79
 
79
 
    d['id'] = vol['id']
 
80
    # TODO(bcwaldon): remove str cast once we use uuids
 
81
    d['id'] = str(vol['id'])
80
82
    d['status'] = vol['status']
81
83
    d['size'] = vol['size']
82
84
    d['availabilityZone'] = vol['availability_zone']
83
85
    d['createdAt'] = vol['created_at']
84
86
 
 
87
    d['attachments'] = []
85
88
    if vol['attach_status'] == 'attached':
86
 
        d['attachments'] = [_translate_attachment_detail_view(context, vol)]
87
 
    else:
88
 
        d['attachments'] = [{}]
 
89
        attachment = _translate_attachment_detail_view(context, vol)
 
90
        d['attachments'].append(attachment)
89
91
 
90
92
    d['displayName'] = vol['display_name']
91
93
    d['displayDescription'] = vol['display_description']
93
95
    if vol['volume_type_id'] and vol.get('volume_type'):
94
96
        d['volumeType'] = vol['volume_type']['name']
95
97
    else:
96
 
        d['volumeType'] = vol['volume_type_id']
 
98
        # TODO(bcwaldon): remove str cast once we use uuids
 
99
        d['volumeType'] = str(vol['volume_type_id'])
97
100
 
98
101
    d['snapshotId'] = vol['snapshot_id']
 
102
    # TODO(bcwaldon): remove str cast once we use uuids
 
103
    if d['snapshotId'] is not None:
 
104
        d['snapshotId'] = str(d['snapshotId'])
 
105
 
99
106
    LOG.audit(_("vol=%s"), vol, context=context)
100
107
 
101
108
    if vol.get('volume_metadata'):