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:
Teresa Ho 2018-09-20 10:01:52 -04:00
parent 68855d9ef6
commit 71a1d09c88
1 changed files with 5 additions and 7 deletions

View 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']
del 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)