On 07/22/2016 09:01 PM, Andrew Kofink wrote:
Hi Team (especially Martin and Tomas),

I've been banging my head on the table for a few days now, so I thought
I would just ask:

I want to resolve a content view by its name; currently,
content_views#index has no required parameters, so no automatic options
are generated. I would like to add the option to search for the content
view by organization_id, and I also want hammer to add the options for
resolving that organization_id from the organization_name and
organization_label. Lastly, and probably most important, I want this to
happen any time the option --content-view-id is added to a command.

This works downstream because organization_id is a required parameter on
content_views#index, but upstream is currently broken due to a change in
the API that removes that requirement. Any thoughts?

Hi Andrew,
I don't think there's a simple way to achieve this across the whole hammer. You can either create a module with such behaviour and include it into each command that uses content views (annoying I know) or create a custom option builder for katello commands (descendant of [1]). It will probably require some tuning of the resolver too, but should give you what you want in the end.

T.

[1] https://github.com/theforeman/hammer-cli-foreman/blob/master/lib/hammer_cli_foreman/option_builders.rb#L103


Regards,

Andrew Kofink

​akofink on IRC​
Software Engineering Intern
Red Hat Satellite 6
[email protected] <mailto:[email protected]>

--
You received this message because you are subscribed to the Google
Groups "foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to