Skip to content

Commit

Permalink
Remove KA related entities
Browse files Browse the repository at this point in the history
Katello-agent was deprecated and removed from 6.15 including related
API endpoints. This PR removes those supported in nailgun.
  • Loading branch information
vsedmik committed Oct 4, 2023
1 parent 9a59aa5 commit 26361ae
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 48 deletions.
44 changes: 0 additions & 44 deletions nailgun/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -4378,44 +4378,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):
"""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 @@ -4612,14 +4574,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 @@ -4642,7 +4600,6 @@ def path(self, which=None):
'disassociate',
'enc',
'errata',
'errata/apply',
'errata/applicability',
'facts',
'packages',
Expand All @@ -4659,7 +4616,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 @@ -2122,9 +2120,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

0 comments on commit 26361ae

Please sign in to comment.