Escape EMR template fields to avoid invalid XML responses (#1467)
I had an EMR step that contained a `&` and this caused the ListStep call to fail. I've added the `| escape` filter to handle it in this case and a few other cases that look like they could suffer the same fate.
This commit is contained in:
parent
508b392697
commit
1b20f21a75
2 changed files with 14 additions and 14 deletions
|
|
@ -462,10 +462,10 @@ DESCRIBE_JOB_FLOWS_TEMPLATE = """<DescribeJobFlowsResponse xmlns="http://elastic
|
|||
<ScriptBootstrapAction>
|
||||
<Args>
|
||||
{% for arg in bootstrap_action.args %}
|
||||
<member>{{ arg }}</member>
|
||||
<member>{{ arg | escape }}</member>
|
||||
{% endfor %}
|
||||
</Args>
|
||||
<Path>{{ bootstrap_action.script_path }}</Path>
|
||||
<Path>{{ bootstrap_action.script_path | escape }}</Path>
|
||||
</ScriptBootstrapAction>
|
||||
</BootstrapActionConfig>
|
||||
</member>
|
||||
|
|
@ -568,12 +568,12 @@ DESCRIBE_JOB_FLOWS_TEMPLATE = """<DescribeJobFlowsResponse xmlns="http://elastic
|
|||
<MainClass>{{ step.main_class }}</MainClass>
|
||||
<Args>
|
||||
{% for arg in step.args %}
|
||||
<member>{{ arg }}</member>
|
||||
<member>{{ arg | escape }}</member>
|
||||
{% endfor %}
|
||||
</Args>
|
||||
<Properties/>
|
||||
</HadoopJarStep>
|
||||
<Name>{{ step.name }}</Name>
|
||||
<Name>{{ step.name | escape }}</Name>
|
||||
</StepConfig>
|
||||
</member>
|
||||
{% endfor %}
|
||||
|
|
@ -596,7 +596,7 @@ DESCRIBE_STEP_TEMPLATE = """<DescribeStepResponse xmlns="http://elasticmapreduce
|
|||
<Config>
|
||||
<Args>
|
||||
{% for arg in step.args %}
|
||||
<member>{{ arg }}</member>
|
||||
<member>{{ arg | escape }}</member>
|
||||
{% endfor %}
|
||||
</Args>
|
||||
<Jar>{{ step.jar }}</Jar>
|
||||
|
|
@ -605,13 +605,13 @@ DESCRIBE_STEP_TEMPLATE = """<DescribeStepResponse xmlns="http://elasticmapreduce
|
|||
{% for key, val in step.properties.items() %}
|
||||
<member>
|
||||
<key>{{ key }}</key>
|
||||
<value>{{ val }}</value>
|
||||
<value>{{ val | escape }}</value>
|
||||
</member>
|
||||
{% endfor %}
|
||||
</Properties>
|
||||
</Config>
|
||||
<Id>{{ step.id }}</Id>
|
||||
<Name>{{ step.name }}</Name>
|
||||
<Name>{{ step.name | escape }}</Name>
|
||||
<Status>
|
||||
<!-- does not exist for botocore 1.4.28
|
||||
<FailureDetails>
|
||||
|
|
@ -646,7 +646,7 @@ LIST_BOOTSTRAP_ACTIONS_TEMPLATE = """<ListBootstrapActionsResponse xmlns="http:/
|
|||
<member>
|
||||
<Args>
|
||||
{% for arg in bootstrap_action.args %}
|
||||
<member>{{ arg }}</member>
|
||||
<member>{{ arg | escape }}</member>
|
||||
{% endfor %}
|
||||
</Args>
|
||||
<Name>{{ bootstrap_action.name }}</Name>
|
||||
|
|
@ -760,22 +760,22 @@ LIST_STEPS_TEMPLATE = """<ListStepsResponse xmlns="http://elasticmapreduce.amazo
|
|||
<Config>
|
||||
<Args>
|
||||
{% for arg in step.args %}
|
||||
<member>{{ arg }}</member>
|
||||
<member>{{ arg | escape }}</member>
|
||||
{% endfor %}
|
||||
</Args>
|
||||
<Jar>{{ step.jar }}</Jar>
|
||||
<Jar>{{ step.jar | escape }}</Jar>
|
||||
<MainClass/>
|
||||
<Properties>
|
||||
{% for key, val in step.properties.items() %}
|
||||
<member>
|
||||
<key>{{ key }}</key>
|
||||
<value>{{ val }}</value>
|
||||
<value>{{ val | escape }}</value>
|
||||
</member>
|
||||
{% endfor %}
|
||||
</Properties>
|
||||
</Config>
|
||||
<Id>{{ step.id }}</Id>
|
||||
<Name>{{ step.name }}</Name>
|
||||
<Name>{{ step.name | escape }}</Name>
|
||||
<Status>
|
||||
<!-- does not exist for botocore 1.4.28
|
||||
<FailureDetails>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue