Raise NotImplementedError instead of NotImplemented
NotImplementedError is the name of the exception (https://docs.python.org/2/library/exceptions.html). NotImplemented is the name of a constant (https://docs.python.org/2/library/constants.html). >>> raise NotImplemented() Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> raise NotImplemented() TypeError: 'NotImplementedType' object is not callable >>> raise NotImplementedError() Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> raise NotImplementedError() NotImplementedError This patch fix it. Change-Id: I939eaa4b4b7c574f7a6447725e3a6ad5b128f1b7 Closes-Bug: #1339855
This commit is contained in:
parent
0f651de035
commit
2a66246536
|
@ -154,7 +154,7 @@ class ResourceInfo(object):
|
|||
return False
|
||||
|
||||
def get_class(self):
|
||||
raise NotImplemented
|
||||
raise NotImplementedError
|
||||
|
||||
def get_class_to_instantiate(self):
|
||||
return self.get_class()
|
||||
|
|
|
@ -1193,7 +1193,7 @@ class ResourceTest(common.HeatTestCase):
|
|||
prop_diff = {'Foo': 'xyz'}
|
||||
self.m.StubOutWithMock(generic_rsrc.ResourceWithProps, 'handle_update')
|
||||
generic_rsrc.ResourceWithProps.handle_update(
|
||||
utmpl, tmpl_diff, prop_diff).AndRaise(NotImplemented)
|
||||
utmpl, tmpl_diff, prop_diff).AndRaise(NotImplementedError)
|
||||
self.m.ReplayAll()
|
||||
updater = scheduler.TaskRunner(res.update, utmpl)
|
||||
self.assertRaises(exception.ResourceFailure, updater)
|
||||
|
|
Loading…
Reference in New Issue