From e994715099b16ce442346921691bd0559ae707d5 Mon Sep 17 00:00:00 2001 From: Satellite QE <115476073+Satellite-QE@users.noreply.github.com> Date: Wed, 26 Jun 2024 02:56:01 -0400 Subject: [PATCH] Add support for OS Parameters (#1191) (#1193) Signed-off-by: Shubham Ganar (cherry picked from commit 5519019bc96b113e8287f0fc949fff0090c95e31) Co-authored-by: Shubham Ganar <67952129+shubhamsg199@users.noreply.github.com> --- nailgun/entities.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nailgun/entities.py b/nailgun/entities.py index 2115ff7d..1d35e55b 100644 --- a/nailgun/entities.py +++ b/nailgun/entities.py @@ -5547,12 +5547,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.