From 83dec85cd9ec8217aaaa9764266cdf584d064cdc Mon Sep 17 00:00:00 2001 From: Avinash Prasad Date: Thu, 16 May 2013 07:50:03 -0700 Subject: Fix EC2 RegisterImage ImageLocation starts with / * Allows image location that begins with '/' during EC2 image register * Adds relevant unit test Fixes LP bug #1074908 Change-Id: I488b126c2079de4370823b347e80c7ec1ecc2c9f --- nova/image/s3.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'nova/image') diff --git a/nova/image/s3.py b/nova/image/s3.py index f08cbcdcb..8fa7fc4ad 100644 --- a/nova/image/s3.py +++ b/nova/image/s3.py @@ -283,10 +283,9 @@ class S3ImageService(object): def _s3_create(self, context, metadata): """Gets a manifest from s3 and makes an image.""" - image_path = tempfile.mkdtemp(dir=CONF.image_decryption_dir) - image_location = metadata['properties']['image_location'] + image_location = metadata['properties']['image_location'].lstrip('/') bucket_name = image_location.split('/')[0] manifest_path = image_location[len(bucket_name) + 1:] bucket = self._conn(context).get_bucket(bucket_name) -- cgit