From a81c3078bed719adcca9a1a9ed8bbdba003af057 Mon Sep 17 00:00:00 2001 From: Sandy Walsh Date: Wed, 1 Jun 2011 17:49:49 -0700 Subject: [PATCH] tests all passing again --- nova/scheduler/api.py | 5 +---- nova/tests/test_scheduler.py | 8 +------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/nova/scheduler/api.py b/nova/scheduler/api.py index 0f423655..432f22b9 100644 --- a/nova/scheduler/api.py +++ b/nova/scheduler/api.py @@ -148,10 +148,7 @@ def call_zone_method(context, method_name, errors_to_ignore=None, except Exception as e: if type(e) in errors_to_ignore: return None - # TODO (dabo) - want to be able to re-raise here. - # Returning a string now; raising was causing issues. - # raise e - return "ERROR", "%s" % e + raise e res = pool.spawn(_error_trap, *args, **kwargs) results.append((zone, res)) diff --git a/nova/tests/test_scheduler.py b/nova/tests/test_scheduler.py index 54b3f80f..5d8f34ef 100644 --- a/nova/tests/test_scheduler.py +++ b/nova/tests/test_scheduler.py @@ -1109,10 +1109,4 @@ class CallZoneMethodTest(test.TestCase): def test_call_zone_method_generates_exception(self): context = {} method = 'raises_exception' - results = api.call_zone_method(context, method) - - # FIXME(sirp): for now the _error_trap code is catching errors and - # converting them to a ("ERROR", "string") tuples. The code (and this - # test) should eventually handle real exceptions. - expected = [(1, ('ERROR', 'testing'))] - self.assertEqual(expected, results) + self.assertRaises(Exception, api.call_zone_method, context, method)