summaryrefslogtreecommitdiffhomepage
path: root/bin
diff options
context:
space:
mode:
authorOHMURA Kei <ohmura.kei@lab.ntt.co.jp>2013-03-22 14:29:35 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2013-03-24 14:33:45 -0700
commit734133612b810b9376ff8eb5ba135a21f55d8c9e (patch)
tree960e342a9ac17468495e7be064ce54c607f58544 /bin
parent322e0cfc9ed1e9e84a89d0ffe2ea1c7d876923b0 (diff)
ryu-manager: use try-finally statement
This fixes a problem that app_mgr.close() is not called when KeyboardInterrupt exception occurs. Signed-off-by: OHMURA Kei <ohmura.kei@lab.ntt.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ryu-manager6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/ryu-manager b/bin/ryu-manager
index 2924bd49..d9cc8059 100755
--- a/bin/ryu-manager
+++ b/bin/ryu-manager
@@ -77,8 +77,10 @@ def main():
thr = gevent.spawn_later(0, webapp)
services.append(thr)
- gevent.joinall(services)
- app_mgr.close()
+ try:
+ gevent.joinall(services)
+ finally:
+ app_mgr.close()
if __name__ == "__main__":