Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distribution storage path no longer dependant on hostname and PRNG. #804

Merged
merged 1 commit into from Feb 11, 2016

Conversation

jeremycline
Copy link
Contributor

Use os.path.relpath instead of str.lstrip when determining the relative
path of a distribution file during content import.

The Python method str.lstrip takes a list of chars, but this is
treated as a set of characters to strip from the left side of the
string, not as a substring to remove[0]. This was problematic for many
reasons, but would (rather entertainingly) determine the relative path
for distribution files based on the hostname of the worker and the
psuedo-random number generator used by tempdir and uuid. We temporarily saved content
to '/var/cache/pulp/@///'.

[0] https://docs.python.org/2/library/stdtypes.html#str.lstrip

closes #1654

Use os.path.relpath instead of str.lstrip when determining the relative
path of a distribution file during content import.

The Python method `str.lstrip` takes a list of chars, but this is
treated as a set of characters to strip from the left side of the
string, *not* as a substring to remove[0]. This was problematic for many
reasons, but would (rather entertainingly) determine the relative path
for distribution files based on the hostname of the worker and the
psuedo-random number generator used by tempdir and uuid.
to '/var/cache/pulp/<worker>@<host>/<task-uuid>/<temp-dir>/'

[0] https://docs.python.org/2/library/stdtypes.html#str.lstrip

closes pulp#1654
@pcreech pcreech self-assigned this Feb 11, 2016
@pcreech pcreech added the LGTM label Feb 11, 2016
@pcreech pcreech assigned jeremycline and unassigned pcreech Feb 11, 2016
@jeremycline
Copy link
Contributor Author

ok test

jeremycline added a commit that referenced this pull request Feb 11, 2016
Distribution storage path no longer dependant on hostname and PRNG.
@jeremycline jeremycline merged commit 209a1b4 into pulp:master Feb 11, 2016
@jeremycline jeremycline deleted the relpath-instead-of-lstrip branch February 11, 2016 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants