]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Passing privileged user to create nova assisted snapshots
authorBharat Kumar Kobagana <bharat.kobagana@redhat.com>
Wed, 18 Feb 2015 10:46:28 +0000 (16:16 +0530)
committerBharat Kumar Kobagana <bharat.kobagana@redhat.com>
Wed, 18 Feb 2015 10:46:50 +0000 (16:16 +0530)
This patch passes privileged user to create nova assisted
snapshots. We can pass privileged user credentials through
cinder.conf as below:
  os_privileged_user_name = <user>
  os_privileged_user_password = <password>
  os_privileged_user_tenant = <tenant>

Closes-Bug: 1308736
Change-Id: I004f3962f7c83113bed6bd9e3ccd002f017bd260

cinder/compute/nova.py

index 2a2fc82d9eb201808684462eef1f1e9b20021de3..a5b84e4d2968c7874ac1ef761b81386fb831e1ff 100644 (file)
@@ -169,14 +169,14 @@ class API(base.Base):
                                                          new_volume_id)
 
     def create_volume_snapshot(self, context, volume_id, create_info):
-        nova = novaclient(context, admin_endpoint=True)
+        nova = novaclient(context, admin_endpoint=True, privileged_user=True)
 
         nova.assisted_volume_snapshots.create(
             volume_id,
             create_info=create_info)
 
     def delete_volume_snapshot(self, context, snapshot_id, delete_info):
-        nova = novaclient(context, admin_endpoint=True)
+        nova = novaclient(context, admin_endpoint=True, privileged_user=True)
 
         nova.assisted_volume_snapshots.delete(
             snapshot_id,