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

add MAC address inputs for instance create methods

This commit is contained in:
catborise 2021-12-03 16:41:50 +03:00
parent 61d822efaa
commit c354393685
3 changed files with 46 additions and 14 deletions

View file

@ -338,10 +338,12 @@ class wvmCreate(wvmConnect):
xml += """<target dev='vd%s' bus='%s'/>""" % (vd_disk_letters.pop(0), "virtio")
xml += """</disk>"""
for net in networks.split(","):
if mac:
macs = mac.split(',')
for idx, net in enumerate(networks.split(",")):
xml += """<interface type='network'>"""
if mac:
xml += f"""<mac address='{mac}'/>"""
xml += f"""<mac address='{macs[idx]}'/>"""
xml += f"""<source network='{net}'/>"""
if nwfilter:
xml += f"""<filterref filter='{nwfilter}'/>"""