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

[JUJU-1124] Avoid sending path across the wire for local resource file name #678

Merged
merged 2 commits into from
Jun 9, 2022

Conversation

cderici
Copy link
Contributor

@cderici cderici commented May 19, 2022

Description

For a bundle with local file resource that looks like the following:

applications:
  file-resource-charm:
    charm: ./file-resource-charm
    num_units: 1
    resources:
      file-res: ./file-resource-charm/test.file

pylibjuju incorrectly sends the whole ./file-resource-charm/test.file for the Path field of CharmResource (that indicates where the resource will be stored on the unit), which results in an error like:

juju.errors.JujuError: bad resource info for "file-res": bad metadata: filename cannot contain "/" (got "./file-resource-charm/test.file").

This change corrects it by sending only the file name which is what the CharmResource needs

Fixes #669

QA Steps

tox -e integration -- tests/integration/test_model.py::test_deploy_bundle_local_resource_relative_path

Notes & Discussion

Copy link
Contributor

@juanmanuel-tirado juanmanuel-tirado left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG2M

Good catch!

@juanmanuel-tirado
Copy link
Contributor

!!build!!

2 similar comments
@cderici
Copy link
Contributor Author

cderici commented May 20, 2022

!!build!!

@cderici
Copy link
Contributor Author

cderici commented May 23, 2022

!!build!!

@cderici
Copy link
Contributor Author

cderici commented May 25, 2022

/build

2 similar comments
@cderici
Copy link
Contributor Author

cderici commented May 27, 2022

/build

@cderici
Copy link
Contributor Author

cderici commented May 31, 2022

/build

@jujubot jujubot merged commit 8a789ee into juju:master Jun 9, 2022
@cderici cderici deleted the bundle-local-resource-with-path branch August 9, 2022 21:53
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.

Libjuju failure with bundles with resources containing filenames with the path
3 participants