add start and end time for continuous audit

Add new start_time and end_time fields in the audit table

Partially Implements: blueprint add-start-end-time-for-continuous-audit

Change-Id: I6bb838d777b2c7aa799a70485980e5dc87838456
This commit is contained in:
licanwei
2018-03-27 02:23:56 -07:00
committed by Alexander Chadin
parent f41adc7e8b
commit c2550e534e
12 changed files with 185 additions and 8 deletions

View File

@@ -101,6 +101,18 @@ def get_patch_value(patch, key):
return p['value']
def set_patch_value(patch, key, value):
for p in patch:
if p['op'] == 'replace' and p['path'] == '/%s' % key:
p['value'] = value
def get_patch_key(patch, key):
for p in patch:
if p['op'] == 'replace' and key in p.keys():
return p[key][1:]
def check_audit_state_transition(patch, initial):
is_transition_valid = True
state_value = get_patch_value(patch, "state")