Merge "Fix cleaning action plan resources on watcher"
This commit is contained in:
commit
27fd7b1b12
2
rally/plugins/openstack/cleanup/resources.py
Executable file → Normal file
2
rally/plugins/openstack/cleanup/resources.py
Executable file → Normal file
@ -911,7 +911,7 @@ class WatcherTemplate(WatcherMixin):
|
||||
class WatcherActionPlan(WatcherMixin):
|
||||
|
||||
def name(self):
|
||||
return self.raw_resource.uuid
|
||||
return base.NoName(self._resource)
|
||||
|
||||
|
||||
@base.resource("watcher", "audit", order=next(_watcher_order),
|
||||
|
3
tests/unit/plugins/openstack/cleanup/test_resources.py
Executable file → Normal file
3
tests/unit/plugins/openstack/cleanup/test_resources.py
Executable file → Normal file
@ -1049,8 +1049,7 @@ class WatcherActionPlanTestCase(test.TestCase):
|
||||
|
||||
def test_name(self):
|
||||
watcher = resources.WatcherActionPlan()
|
||||
watcher.raw_resource = mock.MagicMock(uuid="name")
|
||||
self.assertEqual("name", watcher.name())
|
||||
self.assertIsInstance(watcher.name(), resources.base.NoName)
|
||||
|
||||
@mock.patch("%s.WatcherActionPlan._manager" % BASE)
|
||||
def test_is_deleted(self, mock__manager):
|
||||
|
Loading…
Reference in New Issue
Block a user