Merge branch 'survey_logic' of github.com:sean-m-sullivan/awx into survey_logic

This commit is contained in:
sean-m-sullivan
2021-01-18 12:46:53 -06:00
5 changed files with 9 additions and 37 deletions

View File

@@ -94,10 +94,12 @@ options:
- Setting that variable will prompt the user for job type on the
workflow launch.
type: bool
survey:
survey_spec:
description:
- The definition of the survey associated to the workflow.
type: dict
aliases:
- survey
labels:
description:
- The labels applied to this job template
@@ -149,7 +151,7 @@ import json
def update_survey(module, last_request):
spec_endpoint = last_request.get('related', {}).get('survey_spec')
module.post_endpoint(spec_endpoint, **{'data': module.params.get('survey')})
module.post_endpoint(spec_endpoint, **{'data': module.params.get('survey_spec')})
module.exit_json(**module.json_output)
@@ -161,7 +163,7 @@ def main():
description=dict(),
extra_vars=dict(type='dict'),
organization=dict(),
survey=dict(type='dict'), # special handling
survey_spec=dict(type='dict', aliases=['survey']),
survey_enabled=dict(type='bool'),
allow_simultaneous=dict(type='bool'),
ask_variables_on_launch=dict(type='bool'),
@@ -266,7 +268,7 @@ def main():
# association_fields['labels'].append(label_id)
on_change = None
new_spec = module.params.get('survey')
new_spec = module.params.get('survey_spec')
if new_spec:
existing_spec = None
if existing_item: