Merge "Neutron DHCP implementation to raise exception if no ports have VIF"
This commit is contained in:
commit
4674aef9e4
@ -145,10 +145,10 @@ class NeutronDHCPApi(base.BaseDHCP):
|
||||
"""
|
||||
vifs = network.get_node_vif_ids(task)
|
||||
if not vifs:
|
||||
LOG.warning(_LW("No VIFs found for node %(node)s when attempting "
|
||||
"to update DHCP BOOT options."),
|
||||
{'node': task.node.uuid})
|
||||
return
|
||||
raise exception.FailedToUpdateDHCPOptOnPort(
|
||||
_("No VIFs found for node %(node)s when attempting "
|
||||
"to update DHCP BOOT options.") %
|
||||
{'node': task.node.uuid})
|
||||
|
||||
failures = []
|
||||
for port_id, port_vif in vifs.items():
|
||||
|
@ -180,7 +180,8 @@ class TestNeutron(base.TestCase):
|
||||
with task_manager.acquire(self.context,
|
||||
self.node.uuid) as task:
|
||||
api = dhcp_factory.DHCPFactory()
|
||||
api.update_dhcp(task, self.node)
|
||||
self.assertRaises(exception.FailedToUpdateDHCPOptOnPort,
|
||||
api.update_dhcp, task, self.node)
|
||||
self.assertFalse(mock_updo.called)
|
||||
|
||||
@mock.patch('ironic.dhcp.neutron.NeutronDHCPApi.update_port_dhcp_opts')
|
||||
|
Loading…
x
Reference in New Issue
Block a user