Fix bug in address check format string
This commit is contained in:
parent
e623909a43
commit
1787a970ab
|
@ -598,10 +598,10 @@ def vm_networks_add(config, vm, network, macaddr, model, sriov, sriov_mode, rest
|
||||||
if sriov_mode == 'hostdev':
|
if sriov_mode == 'hostdev':
|
||||||
if interface.attrib.get('type') == 'hostdev':
|
if interface.attrib.get('type') == 'hostdev':
|
||||||
interface_address = 'domain="{pci_domain}" bus="{pci_bus}" slot="{pci_slot}" function="{pci_function}"'.format(
|
interface_address = 'domain="{pci_domain}" bus="{pci_bus}" slot="{pci_slot}" function="{pci_function}"'.format(
|
||||||
interface.source.address.attrib.get('domain'),
|
pci_domain=interface.source.address.attrib.get('domain'),
|
||||||
interface.source.address.attrib.get('bus'),
|
pci_bus=interface.source.address.attrib.get('bus'),
|
||||||
interface.source.address.attrib.get('slot'),
|
pci_slot=interface.source.address.attrib.get('slot'),
|
||||||
interface.source.address.attrib.get('function')
|
pci_function=interface.source.address.attrib.get('function')
|
||||||
)
|
)
|
||||||
if interface_address == bus_address:
|
if interface_address == bus_address:
|
||||||
return False, 'Network "{}" is already configured for VM "{}".'.format(network, vm)
|
return False, 'Network "{}" is already configured for VM "{}".'.format(network, vm)
|
||||||
|
|
Loading…
Reference in New Issue