Skip to content

Commit

Permalink
Add network_type and remote_execution_proxy fields to Subnet (#477)
Browse files Browse the repository at this point in the history
  • Loading branch information
abalakh authored and ldjebran committed Jan 5, 2018
1 parent fca9c25 commit 63fb869
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions nailgun/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
})
Expand Down Expand Up @@ -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):
Expand Down
4 changes: 3 additions & 1 deletion tests/test_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'}),
Expand Down

0 comments on commit 63fb869

Please sign in to comment.