From 8b7282cbdad00b0901e60172b9ab9e08869c942c Mon Sep 17 00:00:00 2001 From: Karanbir Singh Date: Aug 29 2014 16:03:13 +0000 Subject: move patch to right place --- diff --git a/SOURCES/cloud-init-centos-cloudstack-urlhandling.patch b/SOURCES/cloud-init-centos-cloudstack-urlhandling.patch index c63d84b..364f59e 100644 --- a/SOURCES/cloud-init-centos-cloudstack-urlhandling.patch +++ b/SOURCES/cloud-init-centos-cloudstack-urlhandling.patch @@ -4,7 +4,6 @@ diff -uNr cloud-init-0.7.5__orig/cloudinit/url_helper.py cloud-init-0.7.5/cloudi @@ -237,6 +237,14 @@ return UrlResponse(r) except exceptions.RequestException as e: - if (isinstance(e, (exceptions.HTTPError)) + # CloudStack workaround to handle trailing slash (#7544) + if e.response.status_code == 404: + if url.endswith("/"): @@ -13,6 +12,7 @@ diff -uNr cloud-init-0.7.5__orig/cloudinit/url_helper.py cloud-init-0.7.5/cloudi + else: + url = url + "/" + req_args["url"] = url + if (isinstance(e, (exceptions.HTTPError)) and hasattr(e, 'response') # This appeared in v 0.10.8 and hasattr(e.response, 'status_code')): excps.append(UrlError(e, code=e.response.status_code,