Skip to content

Commit

Permalink
Add possibility to query deb packages for host (#1233) (#1238)
Browse files Browse the repository at this point in the history
(cherry picked from commit 5dee74c)

Co-authored-by: dosas <dosas@users.noreply.github.com>
  • Loading branch information
Satellite-QE and dosas authored Oct 25, 2024
1 parent b6cf21f commit e92b622
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions nailgun/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -4578,6 +4578,24 @@ def packages(self, synchronous=True, timeout=None, **kwargs):
response = client.get(self.path('packages'), **kwargs)
return _handle_response(response, self._server_config, synchronous, timeout)

def debs(self, synchronous=True, timeout=None, **kwargs):
"""List debian packages installed on the host.
: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.get(self.path('debs'), **kwargs)
return _handle_response(response, self._server_config, synchronous, timeout)

def module_streams(self, synchronous=True, timeout=None, **kwargs):
"""List module_streams available for the host.
Expand Down Expand Up @@ -4840,6 +4858,7 @@ def path(self, which=None):
'errata/applicability',
'facts',
'packages',
'debs',
'play_roles',
'power',
'puppetclass_ids',
Expand Down

0 comments on commit e92b622

Please sign in to comment.