From 63fb869b8217736d1126443541b399cfcf974846 Mon Sep 17 00:00:00 2001 From: Andrii Balakhtar Date: Fri, 5 Jan 2018 11:28:46 +0200 Subject: [PATCH] Add `network_type` and `remote_execution_proxy` fields to Subnet (#477) --- nailgun/entities.py | 7 +++++++ tests/test_entities.py | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/nailgun/entities.py b/nailgun/entities.py index b3bd17db..5fe3582e 100644 --- a/nailgun/entities.py +++ b/nailgun/entities.py @@ -5996,7 +5996,13 @@ def __init__(self, server_config=None, **kwargs): default=u'DHCP', ), 'location': entity_fields.OneToManyField(Location), + 'network_type': entity_fields.StringField( + choices=('IPv4', 'IPv6'), + default='IPv4', + ), 'organization': entity_fields.OneToManyField(Organization), + 'remote_execution_proxy': + entity_fields.OneToManyField(SmartProxy), 'subnet_parameters_attributes': entity_fields.ListField(), 'tftp': entity_fields.OneToOneField(SmartProxy), }) @@ -6028,6 +6034,7 @@ def read(self, entity=None, attrs=None, ignore=None, params=None): else: ignore.add('subnet_parameters_attributes') ignore.add('discovery') + ignore.add('remote_execution_proxy') return super(Subnet, self).read(entity, attrs, ignore, params) def update_payload(self, fields=None): diff --git a/tests/test_entities.py b/tests/test_entities.py index 7c9431a8..298f4ff0 100644 --- a/tests/test_entities.py +++ b/tests/test_entities.py @@ -1163,7 +1163,9 @@ def test_ignore_arg_v1(self): (entities.SmartClassParameters, {'hidden_value'}), (entities.SmartVariable, {'hidden_value'}), (entities.Subnet, { - 'discovery', 'subnet_parameters_attributes'}), + 'discovery', + 'remote_execution_proxy', + 'subnet_parameters_attributes'}), (entities.Subscription, {'organization'}), (entities.Repository, {'organization'}), (entities.User, {'password'}),