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

Remove katello-agent related entities #1012

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions nailgun/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -4421,44 +4421,6 @@ def errata_applicability(self, synchronous=True, timeout=None, **kwargs):
response = client.put(self.path('errata/applicability'), **kwargs)
return _handle_response(response, self._server_config, synchronous, timeout)

def errata_apply(self, synchronous=True, timeout=None, **kwargs):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we remove errata_applicability method too as it is also removed right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Negative. Errata applicability recalculation functionality remains present.

[GET /api/hosts/:host_id/errata]    List errata available for the content host
[GET /api/hosts/:host_id/errata/:id]    Retrieve a single errata for a host
[PUT /api/hosts/:host_id/errata/applicability]    Force regenerate applicability.

"""Schedule errata for installation.

:param synchronous: What should happen if the server returns an HTTP
202 (accepted) status code? Wait for the task to complete if
``True``. Immediately return the server's response otherwise.
:param timeout: Maximum number of seconds to wait until timing out.
Defaults to ``nailgun.entity_mixins.TASK_TIMEOUT``.
:param kwargs: Arguments to pass to requests.
:returns: The server's response, with all content decoded.
:raises: ``requests.exceptions.HTTPError`` If the server responds with
an HTTP 4XX or 5XX message.

"""
kwargs = kwargs.copy() # shadow the passed-in kwargs
kwargs.update(self._server_config.get_client_kwargs())
response = client.put(self.path('errata/apply'), **kwargs)
return _handle_response(response, self._server_config, synchronous, timeout)

def install_content(self, synchronous=True, timeout=None, **kwargs):
"""Install content on one or more hosts.

:param synchronous: What should happen if the server returns an HTTP
202 (accepted) status code? Wait for the task to complete if
``True``. Immediately return the server's response otherwise.
:param timeout: Maximum number of seconds to wait until timing out.
Defaults to ``nailgun.entity_mixins.TASK_TIMEOUT``.
:param kwargs: Arguments to pass to requests.
:returns: The server's response, with all content decoded.
:raises: ``requests.exceptions.HTTPError`` If the server responds with
an HTTP 4XX or 5XX message.

"""
kwargs = kwargs.copy() # shadow the passed-in kwargs
kwargs.update(self._server_config.get_client_kwargs())
response = client.put(self.path('bulk/install_content'), **kwargs)
return _handle_response(response, self._server_config, synchronous, timeout)

def bulk_add_subscriptions(self, synchronous=True, timeout=None, **kwargs):
"""Add subscriptions to one or more hosts.

Expand Down Expand Up @@ -4655,14 +4617,10 @@ def path(self, which=None):

The format of the returned path depends on the value of ``which``:

bulk/install_content
/api/hosts/:host_id/bulk/install_content
errata
/api/hosts/:host_id/errata
power
/api/hosts/:host_id/power
errata/apply
/api/hosts/:host_id/errata/apply
puppetclass_ids
/api/hosts/:host_id/puppetclass_ids
smart_class_parameters
Expand All @@ -4685,7 +4643,6 @@ def path(self, which=None):
'disassociate',
'enc',
'errata',
'errata/apply',
'errata/applicability',
'facts',
'packages',
Expand All @@ -4702,7 +4659,6 @@ def path(self, which=None):
):
return f'{super().path(which="self")}/{which}'
elif which in (
'bulk/install_content',
'bulk/add_subscriptions',
'bulk/remove_subscriptions',
'bulk/available_incremental_updates',
Expand Down
4 changes: 0 additions & 4 deletions tests/test_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ def test_id_and_which(self):
(entities.Environment, 'smart_class_parameters'),
(entities.Host, 'enc'),
(entities.Host, 'errata'),
(entities.Host, 'errata/apply'),
(entities.Host, 'errata/applicability'),
(entities.Host, 'module_streams'),
(entities.Host, 'packages'),
Expand Down Expand Up @@ -380,7 +379,6 @@ def test_noid_and_which(self):
(entities.ForemanTask, 'bulk_search'),
(entities.ForemanTask, 'summary'),
(entities.RHCloud, 'enable_connector'),
(entities.Host, 'bulk/install_content'),
(entities.Template, 'imports'),
(entities.Template, 'exports'),
):
Expand Down Expand Up @@ -2129,9 +2127,7 @@ def setUpClass(cls):
(entities.Host(**generic).assign_ansible_roles, 'post'),
(entities.Host(**generic).enc, 'get'),
(entities.Host(**generic).errata, 'get'),
(entities.Host(**generic).errata_apply, 'put'),
(entities.Host(**generic).get_facts, 'get'),
(entities.Host(**generic).install_content, 'put'),
(entities.Host(**generic).list_ansible_roles, 'get'),
(entities.Host(**generic).list_scparams, 'get'),
(entities.Host(**generic).module_streams, 'get'),
Expand Down
Loading