diff --git a/nailgun/entities.py b/nailgun/entities.py index a9518fde..85905892 100644 --- a/nailgun/entities.py +++ b/nailgun/entities.py @@ -2759,7 +2759,11 @@ def repository_sets_available_repositories(self, reposet_id): class PartitionTable( - Entity, EntityCreateMixin, EntityDeleteMixin, EntityReadMixin): + Entity, + EntityCreateMixin, + EntityDeleteMixin, + EntityReadMixin, + EntityUpdateMixin): """A representation of a Partition Table entity.""" def __init__(self, server_config=None, **kwargs): @@ -2774,6 +2778,17 @@ def __init__(self, server_config=None, **kwargs): self._meta = {'api_path': 'api/v2/ptables', 'server_modes': ('sat')} super(PartitionTable, self).__init__(server_config, **kwargs) + def update(self, fields=None): + """Fetch a complete set of attributes for this entity.""" + self.update_json(fields) + return self.read() + + def update_payload(self, fields=None): + """Wrap submitted data within an extra dict.""" + return { + u'ptable': super(PartitionTable, self).update_payload(fields) + } + class PuppetClass( Entity, EntityCreateMixin, EntityDeleteMixin, EntityReadMixin): diff --git a/tests/test_entities.py b/tests/test_entities.py index 967522b2..7160ebac 100644 --- a/tests/test_entities.py +++ b/tests/test_entities.py @@ -846,6 +846,7 @@ def test_generic(self): entities.HostGroup(self.cfg), entities.Location(self.cfg), entities.Organization(self.cfg), + entities.PartitionTable(self.cfg), entities.User(self.cfg), ) for entity in entities_: @@ -893,6 +894,7 @@ def test_generic(self): (entities.HostGroup, {'hostgroup': {}}), (entities.Location, {'location': {}}), (entities.Organization, {'organization': {}}), + (entities.PartitionTable, {'ptable': {}}), (entities.User, {'user': {}}), ] for klass, response in class_response: