Configure pci-sriov interface without data network

In existing implementation, it is mandatory to select data network
while creating and updating pci-sriov interface class. In this
patchset the limitation has been removed to make it as similar as CLI.

Test Plan:
PASS: creation of iface of class pci-sriov without datanetwork
PASS: updation of iface of class pci-sriov without datanetwork
PASS: updation of iface of class pci-sriov with datanetwork

Story: 2010706
Task: 48256

Change-Id: I2965a3d06e55825cb4efd51f4de01732b2bf2d45
Signed-off-by: Abhishek jaiswal <abhishek.jaiswal@windriver.com>
This commit is contained in:
Abhishek jaiswal 2023-06-20 16:49:46 +05:30 committed by Abhishek Jaiswal
parent 462aea585d
commit e9842cc174
1 changed files with 3 additions and 3 deletions

View File

@ -537,14 +537,14 @@ class AddInterface(forms.SelfHandlingForm):
else: else:
datanetworks = [] datanetworks = []
# datanetwork selection is required for 'data', 'pci-passthrough' # datanetwork selection is required for 'data' and 'pci-passthrough'
# and 'pci-sriov'. It is NOT required for any other interface class # It is NOT required for any other interface class
if not datanetworks: if not datanetworks:
# Note that 1 of 3 different controls may be used to select # Note that 1 of 3 different controls may be used to select
# data network, make sure to set the error on the appropriate # data network, make sure to set the error on the appropriate
# control # control
if ifclass in ['data', 'pci-passthrough', 'pci-sriov']: if ifclass in ['data', 'pci-passthrough']:
raise forms.ValidationError(_( raise forms.ValidationError(_(
"You must specify a Data Network")) "You must specify a Data Network"))