Allow CLI to pass goal and strategy names
This patch set removes additional type verification for goal and strategy entities to let CLI pass goal and strategy names straight to API. Depends-On: I89a9c7661616f49639151869055d8f5ebe723d5f Change-Id: I323a66dd5bdef6f33d5fd5c60c99e1b4dcd7a7e0 Closes-Bug: #1794233
This commit is contained in:
parent
825e5cb081
commit
db7a5e4bc9
|
@ -200,19 +200,10 @@ class CreateAudit(command.ShowOne):
|
|||
if k in field_list and v is not None)
|
||||
fields = common_utils.args_array_to_dict(fields, 'parameters')
|
||||
|
||||
if fields.get('goal'):
|
||||
if not uuidutils.is_uuid_like(fields['goal']):
|
||||
fields['goal'] = client.goal.get(fields['goal']).uuid
|
||||
|
||||
if fields.get('audit_template_uuid'):
|
||||
if not uuidutils.is_uuid_like(fields['audit_template_uuid']):
|
||||
fields['audit_template_uuid'] = client.audit_template.get(
|
||||
fields['audit_template_uuid']).uuid
|
||||
# optional
|
||||
if fields.get('strategy'):
|
||||
if not uuidutils.is_uuid_like(fields['strategy']):
|
||||
fields['strategy'] = client.strategy.get(
|
||||
fields['strategy']).uuid
|
||||
|
||||
audit = client.audit.create(**fields)
|
||||
if audit.strategy_name is None:
|
||||
|
|
Loading…
Reference in New Issue