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

Add string-or-file option. #400

Merged
merged 1 commit into from
Oct 19, 2021
Merged

Add string-or-file option. #400

merged 1 commit into from
Oct 19, 2021

Conversation

ggainey
Copy link
Contributor

@ggainey ggainey commented Oct 15, 2021

json_option is now built on top of this.

closes #220.

Copy link
Member

@mdellweg mdellweg left a comment

Choose a reason for hiding this comment

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

I like this very much!
Idea for the future: Do we need an almighty callback class, that can naturally chain multiple transformers, validators and presenters together?

tests/scripts/pulp_file/mock.crt Show resolved Hide resolved
json_option is now built on top of this.

closes pulp#220.
@ggainey
Copy link
Contributor Author

ggainey commented Oct 17, 2021

I like this very much! Idea for the future: Do we need an almighty callback class, that can naturally chain multiple transformers, validators and presenters together?

I have a vague image in my head of something like that, but nothing concrete enough to act on. As an example, I'm working on pulp_rpm things that would benefit from, say, a schema-check for json or xml. I'm def a big fan of keeping validation as close to the user as possible - anything we catch before a rest-call gets made is faster and puts less weight on the pulp instance. Def something to think about in our (copious) spare time :)

try:
with click.open_file(json_file, "rb") as fp:
json_string = fp.read()
with click.open_file(the_file, "r") as fp:
Copy link
Member

Choose a reason for hiding this comment

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

Ha, I guess that makes thinking about bytes obsolete. Let's trust our tests, that we cover all use cases here.

@ggainey ggainey merged commit a4ebe76 into pulp:main Oct 19, 2021
@mdellweg mdellweg added this to the 0.13.0 milestone Oct 19, 2021
@ggainey ggainey deleted the string_or_file branch June 18, 2024 12:58
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.

As a user I can specify a file path for cert options such as --ca-cert for pulp rpm remote create
2 participants