Merge "ovs: bubble up failures into main thread in native ofctl mode" into stable/newton

This commit is contained in:
Jenkins 2017-06-02 20:28:01 +00:00 committed by Gerrit Code Review
commit 1a5b86675d
1 changed files with 4 additions and 2 deletions

View File

@ -17,6 +17,7 @@
import functools
from oslo_log import log as logging
from oslo_utils import excutils
import ryu.app.ofctl.api # noqa
from ryu.base import app_manager
from ryu.lib import hub
@ -41,7 +42,8 @@ def agent_main_wrapper(bridge_classes):
try:
ovs_agent.main(bridge_classes)
except Exception:
LOG.exception(_LE("Agent main thread died of an exception"))
with excutils.save_and_reraise_exception():
LOG.exception(_LE("Agent main thread died of an exception"))
finally:
# The following call terminates Ryu's AppManager.run_apps(),
# which is needed for clean shutdown of an agent process.
@ -71,4 +73,4 @@ class OVSNeutronAgentRyuApp(app_manager.RyuApp):
'br_phys': _make_br_cls(br_phys.OVSPhysicalBridge),
'br_tun': _make_br_cls(br_tun.OVSTunnelBridge),
}
return hub.spawn(agent_main_wrapper, bridge_classes)
return hub.spawn(agent_main_wrapper, bridge_classes, raise_error=True)