Code review comment for lp:~jaypipes/glance/bug713154

Revision history for this message
Jay Pipes (jaypipes) wrote :

> Lamar and I came up with this diff to address the other outstanding problem:
>
> === modified file 'glance/store/location.py'
> --- glance/store/location.py 2011-07-13 20:15:46 +0000
> +++ glance/store/location.py 2011-07-25 19:23:09 +0000
> @@ -78,7 +78,8 @@
> pieces = urlparse.urlparse(uri)
> if pieces.scheme not in SCHEME_TO_STORE_MAP.keys():
> raise exception.UnknownScheme(pieces.scheme)
> - loc = Location(pieces.scheme, uri=uri)
> + store_name = SCHEME_TO_STORE_MAP[pieces.scheme]
> + loc = Location(store_name, uri=uri)
> return loc

Hmm, actually, the code in Location._get_store_location() should handle that. The root of the issue is the glance.store.get_backend_class() method. This is now called with the URI scheme or the store name, so a quick hack fixed that issue. This mess all gets cleaned up substantially in the refactor-stores branch, btw...

Pushed a fix and a test case testing variations of URLs in s3_store_host. Please re-verify. Thanks for your patience, Brian^2.

-jay

« Back to merge proposal