Move interface-network removal to restAPI
Previously, the deletion of the interface-network records were done in the GUI. A list of interface-networks to be removed are passed to the restAPI for the deletion. Closes-Bug: 1793349 Change-Id: I8d5a9b27255b8260d09e3e2e379a7e385e626c1c Signed-off-by: Teresa Ho <teresa.ho@windriver.com>
This commit is contained in:
parent
68855d9ef6
commit
71a1d09c88
10
starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/interfaces/forms.py
Executable file → Normal file
10
starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/interfaces/forms.py
Executable file → Normal file
@ -869,18 +869,16 @@ class UpdateInterface(AddInterface):
|
||||
data['networks_to_add'] = unicode(",".join(data['networks_to_add']))
|
||||
else:
|
||||
del data['networks_to_add']
|
||||
interface_networks_to_remove = data['interface_networks_to_remove']
|
||||
if data['interface_networks_to_remove']:
|
||||
data['interface_networks_to_remove'] = unicode(
|
||||
",".join(data['interface_networks_to_remove']))
|
||||
else:
|
||||
del data['interface_networks_to_remove']
|
||||
|
||||
interface = sysinv.host_interface_update(request,
|
||||
interface_id,
|
||||
**data)
|
||||
|
||||
# Remove old networks from the interface
|
||||
if interface_networks_to_remove:
|
||||
for n in interface_networks_to_remove:
|
||||
sysinv.interface_network_remove(self.request, n)
|
||||
|
||||
msg = _('Interface "%s" was'
|
||||
' successfully updated.') % data['ifname']
|
||||
LOG.debug(msg)
|
||||
|
Loading…
Reference in New Issue
Block a user