~zulcss/nova/nova-precise-g3

« back to all changes in this revision

Viewing changes to nova/virt/libvirt/volume.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Adam Gandelman, Chuck Short
  • Date: 2012-04-12 14:14:29 UTC
  • Revision ID: package-import@ubuntu.com-20120412141429-dt69y6cd5e0uqbmk
Tags: 2012.1-0ubuntu2
[ Adam Gandelman ]
* debian/rules: Properly create empty doc/build/man dir for builds that
  skip doc building
* debian/control: Set 'Conflicts: nova-compute-hypervisor' for the various
  nova-compute-$type packages. (LP: #975616)
* debian/control: Set 'Breaks: nova-api' for the various nova-api-$service
  sub-packages. (LP: #966115)

[ Chuck Short ]
* Resynchronize with stable/essex:
  - b1d11b8 Use project_id in ec2.cloud._format_image()
  - 6e988ed Fixes image publication using deprecated auth. (LP: #977765)
  - 6e988ed Populate image properties with project_id again
  - 3b14c74 Fixed bug 962840, added a test case.
  - d4e96fe Allow unprivileged RADOS users to access rbd volumes.
  - 4acfab6 Stop libvirt test from deleting instances dir
  - 155c7b2 fix bug where nova ignores glance host in imageref
* debian/nova.conf: Enabled ec2_private_dns_show_ip so that juju can
  connect to openstack instances.
* debian/patches/fix-docs-build-without-network.patch: Fix docs build
  when there is no network access.

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
        driver = self._pick_volume_driver()
77
77
        protocol = connection_info['driver_volume_type']
78
78
        name = connection_info['data']['name']
79
 
        xml = """<disk type='network'>
80
 
                     <driver name='%s' type='raw' cache='none'/>
81
 
                     <source protocol='%s' name='%s'/>
82
 
                     <target dev='%s' bus='virtio'/>
83
 
                 </disk>""" % (driver, protocol, name, mount_device)
 
79
        if connection_info['data'].get('auth_enabled'):
 
80
            username = connection_info['data']['auth_username']
 
81
            secret_type = connection_info['data']['secret_type']
 
82
            secret_uuid = connection_info['data']['secret_uuid']
 
83
            xml = """<disk type='network'>
 
84
                         <driver name='%s' type='raw' cache='none'/>
 
85
                         <source protocol='%s' name='%s'/>
 
86
                         <auth username='%s'>
 
87
                             <secret type='%s' uuid='%s'/>
 
88
                         </auth>
 
89
                         <target dev='%s' bus='virtio'/>
 
90
                     </disk>""" % (driver, protocol, name, username,
 
91
                                   secret_type, secret_uuid, mount_device)
 
92
        else:
 
93
            xml = """<disk type='network'>
 
94
                         <driver name='%s' type='raw' cache='none'/>
 
95
                         <source protocol='%s' name='%s'/>
 
96
                         <target dev='%s' bus='virtio'/>
 
97
                     </disk>""" % (driver, protocol, name, mount_device)
84
98
        return xml
85
99
 
86
100