Skip to content

Commit

Permalink
Add support for OS Parameters (#1191) (#1192)
Browse files Browse the repository at this point in the history
Signed-off-by: Shubham Ganar <shubhamsg123m@gmail.com>
(cherry picked from commit 5519019)

Co-authored-by: Shubham Ganar <67952129+shubhamsg199@users.noreply.github.com>
  • Loading branch information
Satellite-QE and shubhamsg199 authored Jun 26, 2024
1 parent 505b8c1 commit 48e8905
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions nailgun/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -5400,12 +5400,21 @@ def __init__(self, server_config=None, **kwargs):
default='MD5',
),
'title': entity_fields.StringField(),
'os_parameters_attributes': entity_fields.ListField(),
}
self._meta = {
'api_path': 'api/v2/operatingsystems',
}
super().__init__(server_config=server_config, **kwargs)

def read(self, entity=None, attrs=None, ignore=None, params=None):
"""Fetch as many attributes as possible for this entity."""
if attrs is None:
attrs = self.read_json()
if 'parameters' in attrs:
attrs['os_parameters_attributes'] = attrs.pop('parameters')
return super().read(entity, attrs, ignore, params)

def create_payload(self):
"""Wrap submitted data within an extra dict.
Expand Down

0 comments on commit 48e8905

Please sign in to comment.