Created
March 23, 2016 00:52
-
-
Save rmyers/280bd6ce4c234cebdc23 to your computer and use it in GitHub Desktop.
Fix for catching exceptions in fake taskmanager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import eventlet | |
from trove.taskmanager import api | |
from trove.taskmanager.manager import Manager | |
+from trove.openstack.common import log as logging | |
+ | |
+LOG = logging.getLogger(__name__) | |
class FakeApi(api.API): | |
@@ -35,7 +38,10 @@ class FakeApi(api.API): | |
manager, method = self.get_tm_method(msg['name']) | |
def func(): | |
- method(manager, context, *msg['args'], **msg['kwargs']) | |
+ try: | |
+ method(manager, context, *msg['args'], **msg['kwargs']) | |
+ except: | |
+ LOG.exception("Error running %s", method) | |
eventlet.spawn_after(0.1, func) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment