Merge "Fix cleaning action plan resources on watcher"

This commit is contained in:
Jenkins 2017-08-18 03:29:42 +00:00 committed by Gerrit Code Review
commit 27fd7b1b12
2 changed files with 2 additions and 3 deletions

2
rally/plugins/openstack/cleanup/resources.py Executable file → Normal file
View 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
View 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):