mirror of
https://github.com/retspen/webvirtcloud
synced 2024-11-01 03:54:15 +00:00
Fix network change operation: add interface type network config
This commit is contained in:
parent
1f005e90e1
commit
5c3a9e2a81
1 changed files with 15 additions and 0 deletions
|
@ -986,6 +986,21 @@ class wvmInstance(wvmConnect):
|
|||
source.set('bridge', bridge_name)
|
||||
source = interface.find('filterref')
|
||||
|
||||
if net_filter:
|
||||
if source is not None: source.set('filter', net_filter)
|
||||
else:
|
||||
element = ElementTree.Element("filterref")
|
||||
element.attrib['filter'] = net_filter
|
||||
interface.append(element)
|
||||
else:
|
||||
if source is not None: interface.remove(source)
|
||||
elif interface.get('type') == 'network':
|
||||
source = interface.find('mac')
|
||||
source.set('address', net_mac)
|
||||
source = interface.find('source')
|
||||
source.set('network', net_source)
|
||||
source = interface.find('filterref')
|
||||
|
||||
if net_filter:
|
||||
if source is not None: source.set('filter', net_filter)
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue