Skip to content

Commit 47e8189

Browse files
ManageNotificationsCoverage
1 parent abf8d86 commit 47e8189

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

nailgun/entities.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4735,6 +4735,24 @@ def bulk_destroy(self, synchronous=True, timeout=None, **kwargs):
47354735
response = client.put(self.path('bulk/destroy'), **kwargs)
47364736
return _handle_response(response, self._server_config, synchronous, timeout)
47374737

4738+
def bulk_manage_notifications(self, synchronous=True, timeout=None, **kwargs):
4739+
"""Enable or disable email notifications for the specified set of hosts.
4740+
4741+
:param synchronous: What should happen if the server returns an HTTP
4742+
202 (accepted) status code? Wait for the task to complete if
4743+
``True``. Immediately return the server's response otherwise.
4744+
:param timeout: Maximum number of seconds to wait until timing out.
4745+
Defaults to ``nailgun.entity_mixins.TASK_TIMEOUT``.
4746+
:param kwargs: Arguments to pass to requests.
4747+
:returns: The server's response, with all content decoded.
4748+
:raises: ``requests.exceptions.HTTPError`` If the server responds with
4749+
an HTTP 4XX or 5XX message.
4750+
"""
4751+
kwargs = kwargs.copy() # shadow the passed-in kwargs
4752+
kwargs.update(self._server_config.get_client_kwargs())
4753+
response = client.put(self.path('bulk/manage_notifications'), **kwargs)
4754+
return _handle_response(response, self._server_config, synchronous, timeout)
4755+
47384756
def packages(self, synchronous=True, timeout=None, **kwargs):
47394757
"""List packages installed on the host.
47404758
@@ -5094,6 +5112,7 @@ def path(self, which=None):
50945112
'bulk/available_incremental_updates',
50955113
'bulk/applicable_errata',
50965114
'bulk/installable_errata',
5115+
'bulk/manage_notifications',
50975116
'bulk/traces',
50985117
'bulk/resolve_traces',
50995118
'bulk/destroy',

tests/test_entities.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,6 +2153,7 @@ def setUpClass(cls):
21532153
(entities.Host(**generic).traces, 'get'),
21542154
(entities.Host(**generic).resolve_traces, 'put'),
21552155
(entities.Host(**generic).bulk_destroy, 'put'),
2156+
(entities.Host(**generic).bulk_manage_notifications, 'put'),
21562157
(entities.Host(**generic).bulk_traces, 'post'),
21572158
(entities.Host(**generic).bulk_resolve_traces, 'put'),
21582159
(entities.Host(**generic).bulk_applicable_errata, 'post'),

0 commit comments

Comments
 (0)