Audit API supports new force option

Depends-on:Ia08694d2fb76907ea14e64116af2e722fe930063

Change-Id: Ib2d221ea9c994dea396c54cc8d2d32237025a1d4
Implements: blueprint add-force-field-to-audit
This commit is contained in:
licanwei
2019-05-09 14:48:25 +08:00
parent 3b9364d4c7
commit 2afd0dfcf5
7 changed files with 67 additions and 3 deletions

View File

@@ -121,7 +121,10 @@ class AuditHandler(BaseAuditHandler):
def pre_execute(self, audit, request_context):
LOG.debug("Trigger audit %s", audit.uuid)
self.check_ongoing_action_plans(request_context)
# If audit.force is true, audit will be executed
# despite of ongoing actionplan
if not audit.force:
self.check_ongoing_action_plans(request_context)
# Write hostname that will execute this audit.
audit.hostname = CONF.host
# change state of the audit to ONGOING