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
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 +
14
Change-Id: I809b669e88fe25234569d0c744d14aff6bbd4713
16
nova/api/ec2/cloud.py | 6 +++++-
17
nova/image/s3.py | 3 +++
18
2 files changed, 8 insertions(+), 1 deletions(-)
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')
27
i['ramdiskId'] = ec2utils.image_ec2_id(ramdisk_id, 'ari')
28
- i['imageOwnerId'] = image.get('owner')
30
+ if FLAGS.auth_strategy == 'deprecated':
31
+ i['imageOwnerId'] = image['properties'].get('owner_id')
33
+ i['imageOwnerId'] = image.get('owner')
35
img_loc = image['properties'].get('image_location')
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
45
+ if FLAGS.auth_strategy == 'deprecated':
46
+ properties['project_id'] = context.project_id
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