From: Gandharva Date: Thu, 5 Feb 2015 05:45:19 +0000 (+0530) Subject: ovs_neutron_agent should exit gracefully X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=e6ea486a9c82e2b083fbd181e31e45e0a5c43e42;p=openstack-build%2Fneutron-build.git ovs_neutron_agent should exit gracefully 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 --- 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.