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

« back to all changes in this revision

Viewing changes to debian/patches/upstream/0005-Populate-image-properties-with-project_id-again.patch

  • 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:
1
 
From 6e988ed75c5ba507d79818bc24a1bd2f8250ce2b Mon Sep 17 00:00:00 2001
2
 
From: Adam Gandelman <adamg@canonical.com>
3
 
Date: Tue, 10 Apr 2012 16:44:27 -0700
4
 
Subject: [PATCH 5/5] Populate image properties with project_id again
5
 
 
6
 
This allows ec2 image publishing to function on Essex for users
7
 
who are still using deprecated auth.  This isn't targetted toward
8
 
master and is proposed to stable/essex for the sake of aiding
9
 
users transition to Keystone during upgrades from diablo +
10
 
deprecated_auth.
11
 
 
12
 
Fixes bug 977765
13
 
 
14
 
Change-Id: I809b669e88fe25234569d0c744d14aff6bbd4713
15
 
---
16
 
 nova/api/ec2/cloud.py |    6 +++++-
17
 
 nova/image/s3.py      |    3 +++
18
 
 2 files changed, 8 insertions(+), 1 deletions(-)
19
 
 
20
 
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py
21
 
index 8e187d6..88590db 100644
22
 
--- a/nova/api/ec2/cloud.py
23
 
+++ b/nova/api/ec2/cloud.py
24
 
@@ -1398,7 +1398,11 @@ class CloudController(object):
25
 
         ramdisk_id = image['properties'].get('ramdisk_id')
26
 
         if ramdisk_id:
27
 
             i['ramdiskId'] = ec2utils.image_ec2_id(ramdisk_id, 'ari')
28
 
-        i['imageOwnerId'] = image.get('owner')
29
 
+
30
 
+        if FLAGS.auth_strategy == 'deprecated':
31
 
+            i['imageOwnerId'] = image['properties'].get('owner_id')
32
 
+        else:
33
 
+            i['imageOwnerId'] = image.get('owner')
34
 
 
35
 
         img_loc = image['properties'].get('image_location')
36
 
         if img_loc:
37
 
diff --git a/nova/image/s3.py b/nova/image/s3.py
38
 
index fdf9555..36cf818 100644
39
 
--- a/nova/image/s3.py
40
 
+++ b/nova/image/s3.py
41
 
@@ -232,6 +232,9 @@ class S3ImageService(object):
42
 
         properties = metadata['properties']
43
 
         properties['architecture'] = arch
44
 
 
45
 
+        if FLAGS.auth_strategy == 'deprecated':
46
 
+            properties['project_id'] = context.project_id
47
 
+
48
 
         def _translate_dependent_image_id(image_key, image_id):
49
 
             image_uuid = ec2utils.ec2_id_to_glance_id(context, image_id)
50
 
             properties[image_key] = image_uuid
51
 
1.7.9.1
52