From 48e89050daaf0f68bebcee72bb33ccd846b2e51f Mon Sep 17 00:00:00 2001 From: Satellite QE <115476073+Satellite-QE@users.noreply.github.com> Date: Wed, 26 Jun 2024 02:56:08 -0400 Subject: [PATCH] Add support for OS Parameters (#1191) (#1192) 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 529ceffd..c3cb26f7 100644 --- a/nailgun/entities.py +++ b/nailgun/entities.py @@ -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.