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

What to do about Hash's? #557

Open
pgagne opened this issue Nov 5, 2018 · 2 comments
Open

What to do about Hash's? #557

pgagne opened this issue Nov 5, 2018 · 2 comments

Comments

@pgagne
Copy link
Contributor

pgagne commented Nov 5, 2018

I am adding support for VirtWhoConfig in #540 and #541 and am wondering what the best way to handle the foreman_virt_who_configure_config Hash that the Config API requires. Unfortunately there doesn't seem to be any public posting of the api docs, but if you have a satellite its at sat.example.com/apidoc/v2/configs/update.html

Right now in order to handle it I have to override create_payload, update_payload, and possible others.

I was wondering if there was a potential here to add something to nail gun that would better handle hashs (since a lot of other entities seem to use them). Dict seams to be the closest, but I was thinking we would want it to be something that would have other Fields as values and be able to handle those specially (ie create_missing, etc).

Do people see where I am going with this, I am working on an example and I will try to post it.

@pgagne
Copy link
Contributor Author

pgagne commented Nov 5, 2018

Adding @SatelliteQE/robottelo-automation in case I missed anyone in the assignees.

@pgagne pgagne changed the title What do do about Hash's? What to do about Hash's? Nov 5, 2018
@rplevka
Copy link
Member

rplevka commented Nov 8, 2018

@pgagne
I'd say we'd want to update the create_raw method to allow customization,
so instead of directly sending the result of create_payload() method,
we should be able to pass a custom payload.
In your case it would be something like

  "{{
    'foreman_virt_who_configure_config': {0}
  }}".format(create_payload())

as you need to nest the 'original' json payload as a value for virt_who_config key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants