]> review.fuel-infra Code Review - openstack-build/heat-build.git/commit
cleanup watchrule delete logic/tests
authorSteven Hardy <shardy@redhat.com>
Thu, 4 Jul 2013 09:26:31 +0000 (10:26 +0100)
committerSteven Hardy <shardy@redhat.com>
Thu, 4 Jul 2013 15:30:30 +0000 (16:30 +0100)
commit52dc30305521321333fc9f07206fdf84eb94cefd
tree1699305e08bf3700893482b287e85b1c6d2ccd4c
parentcfb4a605fefd1407a7ee66a80b70fe09bb21818c
cleanup watchrule delete logic/tests

Rework watchrule delete interface so we delete by ID, rather than
by name (where we only delete the first rule in the event of multiple
watcherule rows with the same name, which is allowed although not likely
in normal heat operation - it can cause weird behavior in the tests)

Encapsulating the delete in a WatchRule.destroy() is cleaner and more
consistent with the rest of the codebase, and reworking the tests to
ensure proper cleanup reduces the chances of odd errors and cascading
failures between tests on failure.

fixes bug #1197718

Change-Id: I94e9eb610519bb7321a2be7718312fd50f308a8b
heat/db/api.py
heat/db/sqlalchemy/api.py
heat/engine/resources/cloud_watch.py
heat/engine/watchrule.py
heat/tests/test_engine_service.py
heat/tests/test_watch.py
heat/tests/utils.py