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

host: add support for reading provisioning templates #910

Merged

Conversation

pnovotny
Copy link
Contributor

@pnovotny pnovotny commented Apr 4, 2023

Description of changes

Added new method nailgun.entities.Host::list_provisioning_templates
which returns all provisioning templates assigned to a host.

Upstream API documentation, plugin, or feature links

Local documentation via Satellite apidoc:

https://satellite.example.com/apidoc/v2/hosts/templates.en.html

Functional demonstration

Provide an execution of the modified code, with ipython code blocks or screen shots.
You can exercise the code as raw API calls or using any other method.

Your contribution should include updates to the unit tests, covering the modified portions or adding new coverage.

Example:

In [1]: from nailgun.entities import Host
In [2]: host = Host(host='sat.instance.addr.com', id='snap_uuid').read()
In [3]: print([template['name'] for template in host.list_provisioning_templates()])
Out [3]: ['Kickstart default finish', 'Linux host_init_config default', ...]
Additional Information

N/A

Added new method `nailgun.entities.Host::list_provisioning_templates`
which returns all provisioning templates assigned to a host.
@pnovotny pnovotny self-assigned this Apr 4, 2023
@codecov-commenter
Copy link

Codecov Report

Patch coverage: 23.07% and project coverage change: -0.28 ⚠️

Comparison is base (905eb11) 93.35% compared to head (6363e91) 93.07%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #910      +/-   ##
==========================================
- Coverage   93.35%   93.07%   -0.28%     
==========================================
  Files           6        6              
  Lines        2933     2945      +12     
==========================================
+ Hits         2738     2741       +3     
- Misses        195      204       +9     
Impacted Files Coverage Δ
nailgun/entities.py 92.32% <23.07%> (-0.36%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pnovotny pnovotny added CherryPick PR needs CherryPick to previous branches 6.13.z labels Apr 4, 2023
@pnovotny pnovotny marked this pull request as ready for review April 5, 2023 15:58
@pnovotny pnovotny requested review from lhellebr, pondrejk and a team April 6, 2023 13:49
Copy link
Contributor

@sambible sambible left a comment

Choose a reason for hiding this comment

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

ack pending PRT run on main PR

@pondrejk pondrejk merged commit 84c8c95 into SatelliteQE:master Apr 13, 2023
@pnovotny pnovotny deleted the host-list-provisioning-templates branch April 13, 2023 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.13.z CherryPick PR needs CherryPick to previous branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants