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

Exception raised when supplying invalid json format #255

Closed
daviddavis opened this issue May 24, 2021 · 4 comments · Fixed by #308
Closed

Exception raised when supplying invalid json format #255

daviddavis opened this issue May 24, 2021 · 4 comments · Fixed by #308
Labels
bug Something isn't working (template-set)
Milestone

Comments

@daviddavis
Copy link
Contributor

When modifying a repository version, you get an exception message if the json format isn't a list of hashes.

Steps to reproduce:

pulp file repository create --name test2
pulp file repository content modify --repository test2 --add-content '{"sha256": "abc123", "relative_path": "test"}'

Exception:

TypeError: find() argument after ** must be a mapping, not str
@mdellweg mdellweg added the bug Something isn't working (template-set) label May 25, 2021
@mdellweg
Copy link
Member

I am marking this a bug only, because the documentation of this parameter is already rather explicit, but stacktraces are not suitable for users.

To solve it, should we just verify it's a list, or should we add a complete schema validation framework?

@daviddavis
Copy link
Contributor Author

That's a good question and I don't have a strong preference.

@mdellweg
Copy link
Member

mdellweg commented Jun 9, 2021

We want to add some sort of validation in the cli at least.

@mdellweg
Copy link
Member

https://pypi.org/project/schema/
looks promising

mdellweg added a commit to mdellweg/pulp-cli that referenced this issue Jul 16, 2021
mdellweg added a commit to mdellweg/pulp-cli that referenced this issue Jul 16, 2021
@mdellweg mdellweg added this to the 0.11.0 milestone Jul 16, 2021
mdellweg added a commit to mdellweg/pulp-cli that referenced this issue Jul 16, 2021
mdellweg added a commit to mdellweg/pulp-cli that referenced this issue Jul 17, 2021
mdellweg added a commit that referenced this issue Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working (template-set)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants