Make SR-IOV numvfs setting nullable

Change-Id: I134d4002d6ce825c6986b930a515012bcdf4b551
Closes-bug: #1643600
This commit is contained in:
Fedor Zhadaev 2016-12-28 14:14:52 +04:00
parent ca498021fd
commit 66e85fec7f
4 changed files with 12 additions and 7 deletions

View File

@ -180,8 +180,9 @@ DEFAULT_RELEASE_NIC_ATTRIBUTES = {
'metadata': {'weight': 20, 'label': 'MTU'}
},
'sriov': {
'numvfs': {'min': 0, 'type': 'number', 'value': None,
'weight': 20, 'label': 'Virtual functions'},
'numvfs': {'min': 1, 'type': 'number', 'value': None,
'nullable': True, 'weight': 20,
'label': 'Custom Number of Virtual Functions'},
'enabled': {'type': 'checkbox', 'value': False,
'weight': 10, 'label': 'SR-IOV enabled'},
'physnet': {'type': 'text', 'value': '', 'weight': 30,

View File

@ -313,9 +313,10 @@ class TestHandlers(BaseIntegrationTest):
}]
},
'numvfs': {
'label': 'Number of Virtual Functions',
'label': 'Custom Number of Virtual Functions',
'weight': 20,
'type': 'number',
'nullable': True,
'min': 1,
'value': None,
'restrictions': [
@ -1256,9 +1257,10 @@ class TestNICAttributesHandlers(BaseIntegrationTest):
}]
},
'numvfs': {
'label': 'Number of Virtual Functions',
'label': 'Custom Number of Virtual Functions',
'weight': 20,
'type': 'number',
'nullable': True,
'min': 1,
'value': None,
'restrictions': [

View File

@ -2143,9 +2143,10 @@
restrictions:
- "settings:common.libvirt_type.value != 'kvm'": "Only KVM hypervisor works with SR-IOV"
numvfs:
label: "Number of Virtual Functions"
label: "Custom Number of Virtual Functions"
weight: 20
type: "number"
nullable: True
min: 1
value: null
restrictions:

View File

@ -97,8 +97,9 @@ DEFAULT_NIC_ATTRIBUTES = {
'metadata': {'weight': 20, 'label': 'MTU'}
},
'sriov': {
'numvfs': {'min': 0, 'type': 'number', 'value': None,
'weight': 20, 'label': 'Virtual functions'},
'numvfs': {'min': 1, 'type': 'number', 'nullable': True,
'value': None, 'weight': 20,
'label': 'Custom Number of Virtual Functions'},
'enabled': {'type': 'checkbox', 'value': False,
'weight': 10, 'label': 'SR-IOV enabled'},
'physnet': {'type': 'text', 'value': '', 'weight': 30,