Add auto_trigger support to watcher

This patch set adds support of auto-triggering of action plans.

Change-Id: I36b7dff8eab5f6ebb18f6f4e752cf4b263456293
Partially-Implements: blueprint automatic-triggering-audit
This commit is contained in:
Alexander Chadin
2016-11-28 17:00:44 +03:00
parent c5ff387ae9
commit d0bca1f2ab
13 changed files with 123 additions and 17 deletions

View File

@@ -330,21 +330,21 @@ class TestSyncer(base.DbTestCase):
self.ctx, id=1, uuid=utils.generate_uuid(),
audit_type=objects.audit.AuditType.ONESHOT.value,
state=objects.audit.State.PENDING,
goal_id=goal1.id, strategy_id=strategy1.id)
goal_id=goal1.id, strategy_id=strategy1.id, auto_trigger=False)
# Should be modified by the sync() because its associated goal
# has been modified (compared to the defined fake goals)
audit2 = objects.Audit(
self.ctx, id=2, uuid=utils.generate_uuid(),
audit_type=objects.audit.AuditType.ONESHOT.value,
state=objects.audit.State.PENDING,
goal_id=goal2.id, strategy_id=strategy2.id)
goal_id=goal2.id, strategy_id=strategy2.id, auto_trigger=False)
# Should be modified by the sync() because its associated strategy
# has been modified (compared to the defined fake strategies)
audit3 = objects.Audit(
self.ctx, id=3, uuid=utils.generate_uuid(),
audit_type=objects.audit.AuditType.ONESHOT.value,
state=objects.audit.State.PENDING,
goal_id=goal1.id, strategy_id=strategy3.id)
goal_id=goal1.id, strategy_id=strategy3.id, auto_trigger=False)
# Modified because of both because its associated goal and associated
# strategy should be modified (compared to the defined fake
# goals/strategies)
@@ -352,7 +352,7 @@ class TestSyncer(base.DbTestCase):
self.ctx, id=4, uuid=utils.generate_uuid(),
audit_type=objects.audit.AuditType.ONESHOT.value,
state=objects.audit.State.PENDING,
goal_id=goal2.id, strategy_id=strategy4.id)
goal_id=goal2.id, strategy_id=strategy4.id, auto_trigger=False)
audit1.create()
audit2.create()
@@ -560,13 +560,13 @@ class TestSyncer(base.DbTestCase):
self.ctx, id=1, uuid=utils.generate_uuid(),
audit_type=objects.audit.AuditType.ONESHOT.value,
state=objects.audit.State.PENDING,
goal_id=goal1.id, strategy_id=strategy1.id)
goal_id=goal1.id, strategy_id=strategy1.id, auto_trigger=False)
# Stale after syncing because the goal has been soft deleted
audit2 = objects.Audit(
self.ctx, id=2, uuid=utils.generate_uuid(),
audit_type=objects.audit.AuditType.ONESHOT.value,
state=objects.audit.State.PENDING,
goal_id=goal2.id, strategy_id=strategy2.id)
goal_id=goal2.id, strategy_id=strategy2.id, auto_trigger=False)
audit1.create()
audit2.create()