Capability discovery endpoint detection is hardcoded
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-swiftclient |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
We have a Ceph-based setup and Horizon can't retrieve the list of objects from RadosGW even though we have Swift API enabled: it tries to fetch the data from https://<ip>:<port>/info and was receiving XML with what seemed like S3 API output.
After some time digging I've finally found out that the root cause lies within python-swiftclient.
We have a setup that supports both S3 and Swift APIs. Swift's endpoint in Keystone is created as
follows:
https://<ip>:<port>
whereas traditionally it is set up like
https://<ip>:<port>/v1
swiftclient's get_capabilities() method assumes that Swift's endpoint is located directly at "/", so it goes to "/info", which is incorrect.
Buggy line: https:/
Hello, url).scheme url).netloc
Rewriting the aforementioned part of swiftclient into
#scheme = urlparse(
#netloc = urlparse(
#url = scheme + '://' + netloc + '/info'
parts = url.split("/")
parts[-1] = "info"
url = "/".join(parts)
and it works like a charm now.