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

Explicit copy/move example or expressive failure reports #101

Open
zink-chimaera opened this issue Oct 25, 2021 · 2 comments
Open

Explicit copy/move example or expressive failure reports #101

zink-chimaera opened this issue Oct 25, 2021 · 2 comments

Comments

@zink-chimaera
Copy link

I'm struggling with the copy/move example. Could you make it more precise.

The artifacts.info is described as art.artifacts.info("<ARTIFACT_PATH_IN_ARTIFACTORY>"),
which works when using:

art.artifacts.info(f"{repository_name}/{user_name}/{package_name}/{version}")

However, the copy/move operation is also described with <CURRENT_ARTIFACT_PATH_IN_ARTIFACTORY> and <NEW_ARTIFACT_PATH_IN_ARTIFACTORY> but does not work when using it via:

art.artifacts.move(
    "{repository_name_1}/{user_name}/{package_name}/{version}",
    "{repository_name_2}/{user_name}/{package_name}/{version}",
    dryrun=True
)

Describe the solution you'd like
A few things:

  • An explicit example and/or
  • interface adaption to match both cases
@anancarv
Copy link
Owner

Hi @zink-chimaera , can you please share the error message raised when you perform the move ?

@zink-chimaera
Copy link
Author

zink-chimaera commented Oct 26, 2021

It is an 400 Client Error: Bad Request for url: https://localhost/artifactory/api/move/chimaera-ci/chimaera/zlib/1.2.11?to=/chimaera-testing/chimaera/zlib/1.2.11&dry=1

The full stack:

Traceback (most recent call last):
  File "/home/zink/Code/artifactory-connect/main.py", line 16, in <module>
    arti = art.artifacts.move(
  File "/home/zink/Code/artifactory-connect/venv/lib/python3.9/site-packages/pyartifactory/objects.py", line 963, in move
    self._post(f"api/move/{artifact_current_path}?to={artifact_new_path}&dry={dry}")
  File "/home/zink/Code/artifactory-connect/venv/lib/python3.9/site-packages/pyartifactory/artifactory_object.py", line 38, in _post
    return self._generic_http_method_request("post", route, **kwargs)
  File "/home/zink/Code/artifactory-connect/venv/lib/python3.9/site-packages/pyartifactory/artifactory_object.py", line 75, in _generic_http_method_request
    response.raise_for_status()
  File "/home/zink/Code/artifactory-connect/venv/lib/python3.9/site-packages/requests/models.py", line 953, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://localhost/artifactory/api/move/chimaera-ci/chimaera/zlib/1.2.11?to=/chimaera-testing/chimaera/zlib/1.2.11&dry=1

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

No branches or pull requests

2 participants