diff --git a/nailgun/entities.py b/nailgun/entities.py index 80c14745..e78951d4 100644 --- a/nailgun/entities.py +++ b/nailgun/entities.py @@ -5628,12 +5628,24 @@ 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') + else: + ignore.add('os_parameters_attributes') + + return super().read(entity, attrs, ignore, params) + def create_payload(self): """Wrap submitted data within an extra dict.