Merge "Terminate macvtap agent when physical_interface_mapping config not present"
This commit is contained in:
commit
f8e942c5bd
@ -174,6 +174,11 @@ class MacvtapManager(amb.CommonAgentManagerBase):
|
||||
|
||||
|
||||
def parse_interface_mappings():
|
||||
if not cfg.CONF.macvtap.physical_interface_mappings:
|
||||
LOG.error(_LE("No physical_interface_mappings provided, but at least "
|
||||
"one mapping is required. Agent terminated!"))
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
interface_mappings = helpers.parse_mappings(
|
||||
cfg.CONF.macvtap.physical_interface_mappings)
|
||||
|
@ -189,6 +189,11 @@ class TestMacvtapMain(base.BaseTestCase):
|
||||
macvtap_neutron_agent.parse_interface_mappings()
|
||||
mock_exit.assert_called_with(1)
|
||||
|
||||
def test_parse_interface_mappings_no_mapping(self):
|
||||
with mock.patch.object(sys, 'exit') as mock_exit:
|
||||
macvtap_neutron_agent.parse_interface_mappings()
|
||||
mock_exit.assert_called_with(1)
|
||||
|
||||
def test_validate_firewall_driver_noop_long(self):
|
||||
cfg.CONF.set_override('firewall_driver',
|
||||
'neutron.agent.firewall.NoopFirewallDriver',
|
||||
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
upgrade:
|
||||
- After upgrade, a macvtap agent without
|
||||
physical_interface_mappings configured can not
|
||||
be started. Specify a valid mapping to be able
|
||||
to start and use the macvtap agent.
|
Loading…
Reference in New Issue
Block a user