From e6ea486a9c82e2b083fbd181e31e45e0a5c43e42 Mon Sep 17 00:00:00 2001 From: Gandharva Date: Thu, 5 Feb 2015 11:15:19 +0530 Subject: [PATCH] ovs_neutron_agent should exit gracefully MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In this patch set if any error occurs during agent initialization phase, then it terminates ovs neutron agent gracefully. Closes-Bug: #1351135 Co-Authored-By: Aman Kumar Co-Authored-By: Neethi Shasidhar Change-Id: I14d091c73c8f8f4dfe70e7f9a7f7683b5fb0fd7f --- neutron/plugins/openvswitch/agent/ovs_neutron_agent.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py b/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py index 89955c8b9..e811de8b9 100644 --- a/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py +++ b/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py @@ -1586,7 +1586,11 @@ def main(): # commands target xen dom0 rather than domU. cfg.CONF.set_default('ip_lib_force_root', True) - agent = OVSNeutronAgent(**agent_config) + try: + agent = OVSNeutronAgent(**agent_config) + except RuntimeError as e: + LOG.error(_LE("%s Agent terminated!"), e) + sys.exit(1) signal.signal(signal.SIGTERM, agent._handle_sigterm) # Start everything. -- 2.45.2