Continue II: Fix for PONSIM exit issue with execption
Change-Id: Ib0544a559f60b5b03c767926c9c7c69016faeb7c
diff --git a/ponsim/main.py b/ponsim/main.py
index 16ddfac..b6e305e 100755
--- a/ponsim/main.py
+++ b/ponsim/main.py
@@ -173,11 +173,14 @@
def shutdown_components(self):
"""Execute before the reactor is shut down"""
self.log.info('exiting-on-keyboard-interrupt')
- if self.io is not None:
- yield self.io.stop()
- self.teardown_networking_assets(self.args.name, self.args.onus)
- if self.grpc_server is not None:
- yield self.grpc_server.stop()
+ try:
+ if self.io is not None:
+ yield self.io.stop()
+ self.teardown_networking_assets(self.args.name, self.args.onus)
+ if self.grpc_server is not None:
+ yield self.grpc_server.stop()
+ except Exception, e:
+ self.log.exception('shutdown-failed', e=e)
def start_reactor(self):
from twisted.internet import reactor
diff --git a/ponsim/realio.py b/ponsim/realio.py
index 77fa770..4691d9c 100644
--- a/ponsim/realio.py
+++ b/ponsim/realio.py
@@ -51,7 +51,7 @@
yield self.frame_io.stop()
log.info('stopped')
except Exception, e:
- pass
+ log.exception('exception', e=e)
def register_ponsim(self, ponsim):
self.ponsim = ponsim