Compatible with old scope format
Scope format changed from old to new after bp cdm-scoping.
old format:
- availability_zones:
- name: nova
- host_aggregates:
- id: 1
- name: agg
- exclude:
- compute_nodes:
- name: w012
new format:
- compute:
- availability_zones:
- name: nova
- host_aggregates:
- id: 1
- name: agg
- exclude:
- compute_nodes:
- name: w012
Change-Id: I2b5cd4d1cee19f5588e4d2185eb074343fff1187
Closed-Bug: #1882049
This commit is contained in:
@@ -138,6 +138,9 @@ class AuditTemplatePostType(wtypes.Base):
|
||||
raise exception.InvalidGoal(goal=audit_template.goal)
|
||||
|
||||
if audit_template.scope:
|
||||
keys = [list(s)[0] for s in audit_template.scope]
|
||||
if keys[0] not in ('compute', 'storage'):
|
||||
audit_template.scope = [dict(compute=audit_template.scope)]
|
||||
common_utils.Draft4Validator(
|
||||
AuditTemplatePostType._build_schema()
|
||||
).validate(audit_template.scope)
|
||||
|
||||
Reference in New Issue
Block a user