1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

Add Fixed Network Address operations. Add Modify dhcp range for stopped networks.

This commit is contained in:
catborise 2019-01-22 16:53:10 +03:00
parent b812a05cdc
commit bd63e3e4e6
3 changed files with 85 additions and 16 deletions

View file

@ -176,13 +176,14 @@ class wvmNetwork(wvmConnect):
def network(doc):
result = []
for net in doc.xpath('/network/ip/dhcp/host'):
host = net.xpath('@ip')[0]
ip = net.xpath('@ip')[0]
mac = net.xpath('@mac')[0]
result.append({'host': host, 'mac': mac})
name = net.xpath('@name')[0]
result.append({'ip': ip, 'mac': mac, 'name': name})
return result
return util.get_xml_path(self._XMLDesc(0), func=network)
def modify_fixed_address(self, name, address, mac):
util.validate_macaddr(mac)
new_xml = '<host mac="{}" name="{}" ip="{}"/>'.format(mac, name, IP(address))