Add force field to Audit

Partially Implements: blueprint add-force-field-to-audit

Change-Id: Ia08694d2fb76907ea14e64116af2e722fe930063
This commit is contained in:
licanwei
2019-05-05 16:24:24 +08:00
parent 1e6ce53273
commit 62d181d925
6 changed files with 40 additions and 3 deletions

View File

@@ -104,6 +104,8 @@ class AuditPostType(wtypes.Base):
end_time = wtypes.wsattr(datetime.datetime, mandatory=False)
force = wtypes.wsattr(bool, mandatory=False)
def as_audit(self, context):
audit_type_values = [val.value for val in objects.audit.AuditType]
if self.audit_type not in audit_type_values:
@@ -359,6 +361,10 @@ class Audit(base.APIBase):
end_time = wtypes.wsattr(datetime.datetime, mandatory=False)
"""The end time that stopping continuous audit"""
force = wsme.wsattr(bool, mandatory=False, default=False)
"""Allow Action Plan of this Audit be executed in parallel
with other Action Plan"""
def __init__(self, **kwargs):
self.fields = []
fields = list(objects.Audit.fields)