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,