fix bug processing survey spec

This commit is contained in:
AlanCoding
2020-03-23 16:52:33 -04:00
parent 5e595caf5e
commit 795c989a49
3 changed files with 59 additions and 11 deletions

View File

@@ -215,13 +215,15 @@ def main():
new_fields['extra_vars'] = json.dumps(new_fields['extra_vars'])
on_change = None
existing_spec = None
if existing_item:
existing_spec = module.get_endpoint('spec_endpoint')
new_spec = module.params.get('survey')
if new_spec and (new_spec != existing_spec):
module.json_output['changed'] = True
on_change = update_survey
if new_spec:
existing_spec = None
if existing_item:
spec_endpoint = existing_item.get('related', {}).get('survey_spec')
existing_spec = module.get_endpoint(spec_endpoint)
if new_spec != existing_spec:
module.json_output['changed'] = True
on_change = update_survey
if state == 'absent':
# If the state was absent we can let the module delete it if needed, the module will handle exiting from this

View File

@@ -165,6 +165,15 @@ EXAMPLES = '''
organization: Default # organization of workflow job template
extra_data:
foo_key: bar_value
- name: Create parent node for prior node
tower_workflow_job_template_node:
identifier: my-root-node
workflow: example-workflow
unified_job_template: jt-for-node-use
organization: Default
success_nodes:
- my-first-node
'''
from ..module_utils.tower_api import TowerModule