Merge ~cjwatson/launchpad:artifactory-strip-trailing-backslashes into launchpad:master
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | 1201cff437cdf0447750a5f8f8c6d8db0ce98994 |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~cjwatson/launchpad:artifactory-strip-trailing-backslashes |
Merge into: | launchpad:master |
Diff against target: |
35 lines (+8/-5) 2 files modified
lib/lp/archivepublisher/artifactory.py (+7/-4) lib/lp/archivepublisher/tests/test_artifactory.py (+1/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jürgen Gmach | Approve | ||
Review via email: mp+434495@code.launchpad.net |
Commit message
Strip trailing backslashes from Artifactory property values
Description of the change
I've previously established empirically that backslashes must not be quoted when setting Artifactory properties (contrary to the public documentation), and the `encode_properties` function used internally when setting properties behaves as follows:
>>> from collections import OrderedDict
>>> from artifactory import encode_properties
>>> properties = OrderedDict(
>>> print(encode_
key1=
This encoding clearly leaves no way to separate the fields unambiguously, and the result is that ";key2=value" ends up being appended to the value of the "key1" property, which is no good.
Stripping trailing backslashes is a horrible workaround, but I don't see a way around it given how the Artifactory API works. I expect trailing backslashes in property values to be extremely rare in practice, and they'll only show up in informational properties auto-populated by Artifactory itself, not by anything functional.
I am curious - did you get in touch with Jfrog about the incorrect documentation/API?