Add checking audit state

This patch adds checking audit state when updating an existing audit
in accordance with audit state machine.

Closes-Bug: #1662406

Change-Id: I20610c83169b77f141974a5cebe33818a4bf0728
This commit is contained in:
Hidekazu Nakamura
2017-02-07 11:39:28 +09:00
parent 26c7726c00
commit 0d83354c57
3 changed files with 156 additions and 1 deletions

View File

@@ -73,6 +73,12 @@ def apply_jsonpatch(doc, patch):
return jsonpatch.apply_patch(doc, jsonpatch.JsonPatch(patch))
def get_patch_value(patch, key):
for p in patch:
if p['op'] == 'replace' and p['path'] == '/%s' % key:
return p['value']
def as_filters_dict(**filters):
filters_dict = {}
for filter_name, filter_value in filters.items():