Skip to content
This repository has been archived by the owner on Sep 16, 2020. It is now read-only.

Commit

Permalink
Merge fb1772b into b87d8ea
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanCoding committed Mar 12, 2020
2 parents b87d8ea + fb1772b commit 524e6f9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
6 changes: 6 additions & 0 deletions docs/source/HISTORY.rst
@@ -1,6 +1,12 @@
Release History
===============

3.3.9 (2020-03-12)
------------------

- Improve error handling for template specification in workflow schema command.
- Pin the click library to avoid changing look and feel of output.

3.3.8 (2020-01-14)
------------------

Expand Down
10 changes: 10 additions & 0 deletions docs/source/cli_ref/usage/WORKFLOWS.rst
Expand Up @@ -127,6 +127,16 @@ network with a tower-cli command after the constituent resources like
the job templates and projects were created by preceding tower-cli
commands.

Workflows Inside Workflows
~~~~~~~~~~~~~~~~~~~~~~~~~~

It is possible to have a workflow embedded inside of the schema of another
workflow. To do this, use the key "workflow".

.. code:: yaml
- workflow: Another workflow
Differences with Machine Formatted Schemas
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
11 changes: 7 additions & 4 deletions tower_cli/resources/workflow.py
Expand Up @@ -45,16 +45,19 @@ def __init__(self, data, wfjt, include_id=False):
else:
node_attrs[fd] = data[fd]
node_attrs['workflow_job_template'] = wfjt
ujt_ambiguity_msg = (
'You should provide exactly one of the attributes'
' job_template, project, workflow, inventory_source, or unified_job_template.'
)
for ujt_name in ujt_attrs:
if ujt_name not in node_attrs:
continue
if 'unified_job_template' not in node_attrs:
node_attrs['unified_job_template'] = node_attrs.pop(ujt_name)
else:
raise BadRequest(
'You should not provide more than one of the attributes'
' job_template, project and inventory_source.'
)
raise BadRequest(ujt_ambiguity_msg)
if 'unified_job_template' not in node_attrs:
raise BadRequest(ujt_ambiguity_msg)
self.unified_job_template = node_attrs.get('unified_job_template', None)
self.node_attrs = node_attrs
for rel in ['success_nodes', 'failure_nodes', 'always_nodes']:
Expand Down

0 comments on commit 524e6f9

Please sign in to comment.