diff -Nru simplestreams-0.1.0~bzr341/debian/changelog simplestreams-0.1.0~bzr341/debian/changelog --- simplestreams-0.1.0~bzr341/debian/changelog 2015-09-25 12:43:52.000000000 -0300 +++ simplestreams-0.1.0~bzr341/debian/changelog 2015-09-29 18:37:11.000000000 -0300 @@ -1,3 +1,10 @@ +simplestreams (0.1.0~bzr341-0ubuntu2.4) trusty; urgency=medium + + * d/p/lp1346935-fix-bucket-creation-on-rgw.patch: Fix bucket creation when + ceph-radosgw is used to provide a Swift API (LP: #1346935). + + -- Felipe Reyes Tue, 29 Sep 2015 18:36:56 -0300 + simplestreams (0.1.0~bzr341-0ubuntu2.3) trusty-security; urgency=high * export checksummer in simplestreams.util (LP: #1499749) diff -Nru simplestreams-0.1.0~bzr341/debian/patches/lp1346935-fix-bucket-creation-on-rgw.patch simplestreams-0.1.0~bzr341/debian/patches/lp1346935-fix-bucket-creation-on-rgw.patch --- simplestreams-0.1.0~bzr341/debian/patches/lp1346935-fix-bucket-creation-on-rgw.patch 1969-12-31 21:00:00.000000000 -0300 +++ simplestreams-0.1.0~bzr341/debian/patches/lp1346935-fix-bucket-creation-on-rgw.patch 2015-09-29 18:36:35.000000000 -0300 @@ -0,0 +1,67 @@ +Author: Scott Moser +Description: do not strip versions from end of endpoint urls, except for glance +Origin: upstream, r362, r364, r365 +Bug: https://bugs.launchpad.net/ubuntu/vivid/+source/simplestreams/+bug/1346935 + +--- a/simplestreams/openstack.py ++++ b/simplestreams/openstack.py +@@ -17,7 +17,6 @@ + + from keystoneclient.v2_0 import client as ksclient + import os +-import re + + OS_ENV_VARS = ( + 'OS_AUTH_TOKEN', 'OS_AUTH_URL', 'OS_CACERT', 'OS_IMAGE_API_VERSION', +@@ -119,17 +118,4 @@ + endpoint_kwargs['filter_value'] = kwargs.get('region_name') + + endpoint = client.service_catalog.url_for(**endpoint_kwargs) +- return _strip_version(endpoint) +- +- +-def _strip_version(endpoint): +- """Strip a version from the last component of an endpoint if present""" +- +- # Get rid of trailing '/' if present +- if endpoint.endswith('/'): +- endpoint = endpoint[:-1] +- url_bits = endpoint.split('/') +- # regex to match 'v1' or 'v2.0' etc +- if re.match(r'v\d+\.?\d*', url_bits[-1]): +- endpoint = '/'.join(url_bits[:-1]) + return endpoint +--- a/simplestreams/mirrors/glance.py ++++ b/simplestreams/mirrors/glance.py +@@ -26,9 +26,13 @@ + import errno + import glanceclient + import os ++import re + + + def get_glanceclient(version='1', **kwargs): ++ # newer versions of the glanceclient will do this 'strip_version' for ++ # us, but older versions do not. ++ kwargs['endpoint'] = _strip_version(kwargs['endpoint']) + pt = ('endpoint', 'token', 'insecure', 'cacert') + kskw = {k: kwargs.get(k) for k in pt if k in kwargs} + return glanceclient.Client(version, **kskw) +@@ -294,4 +298,17 @@ + + return (os.path.getsize(path), md5) + ++ ++def _strip_version(endpoint): ++ """Strip a version from the last component of an endpoint if present""" ++ ++ # Get rid of trailing '/' if present ++ if endpoint.endswith('/'): ++ endpoint = endpoint[:-1] ++ url_bits = endpoint.split('/') ++ # regex to match 'v1' or 'v2.0' etc ++ if re.match(r'v\d+\.?\d*', url_bits[-1]): ++ endpoint = '/'.join(url_bits[:-1]) ++ return endpoint ++ + # vi: ts=4 expandtab syntax=python diff -Nru simplestreams-0.1.0~bzr341/debian/patches/series simplestreams-0.1.0~bzr341/debian/patches/series --- simplestreams-0.1.0~bzr341/debian/patches/series 2015-09-25 12:43:43.000000000 -0300 +++ simplestreams-0.1.0~bzr341/debian/patches/series 2015-09-29 18:36:35.000000000 -0300 @@ -3,3 +3,4 @@ lp1487004-use-checksumming-reader.patch lp1487004-sru-safetynet.patch lp1499749-export-checksummer-in-util.patch +lp1346935-fix-bucket-creation-on-rgw.patch