Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing escape special characters #883

Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
minor_changes:
- filetree_create export object description while escaping characters like `$`,`/`` and `"`
2 changes: 1 addition & 1 deletion roles/filetree_create/templates/current_applications.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
controller_applications:
{% endif %}
- name: "{{ current_applications_asset_value.name }}"
description: "{{ current_applications_asset_value.description }}"
description: "{{ current_applications_asset_value.description | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
organization: "{{ current_applications_asset_value.summary_fields.organization.name | default(organization if organization != 'ORGANIZATIONLESS' else 'ToDo: The application \'' + current_applications_asset_value.name + '\' must have an organization') }}"
authorization_grant_type: "{{ current_applications_asset_value.authorization_grant_type }}"
redirect_uris: "{{ current_applications_asset_value.redirect_uris }}"
Expand Down
2 changes: 1 addition & 1 deletion roles/filetree_create/templates/current_credentials.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
controller_credentials:
{% endif %}
- name: "{{ current_credentials_asset_value.name }}"
description: "{{ current_credentials_asset_value.description }}"
description: "{{ current_credentials_asset_value.description | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
credential_type: "{{ current_credentials_asset_value.summary_fields.credential_type.name }}"
{% if current_credentials_asset_value.organization is defined and current_credentials_asset_value.organization is not none %}
organization: "{{ current_credentials_asset_value.summary_fields.organization.name }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ controller_execution_environments:
{% for ee in current_execution_environments_asset_value %}
{% if organization_filter is not defined or (ee.summary_fields.organization is defined and ee.summary_fields.organization.name is match(organization_filter)) %}
- name: "{{ ee.name }}"
description: "{{ ee.description }}"
description: "{{ ee.description | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
{% if ee.summary_fields.organization.name is defined %}
organization: "{{ ee.summary_fields.organization.name }}"
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion roles/filetree_create/templates/current_groups.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ controller_groups:
{% endif %}
{% for group in current_groups_asset_value %}
- name: "{{ group.name }}"
description: "{{ group.description }}"
description: "{{ group.description | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
inventory: "{{ group.summary_fields.inventory.name }}"
{% if group.variables and group.variables != '---' and group.variables != '' %}
variables:
Expand Down
2 changes: 1 addition & 1 deletion roles/filetree_create/templates/current_hosts.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ controller_hosts:
{% endif %}
{% for host in current_hosts_asset_value if not host.has_inventory_sources %}
- name: "{{ host.name }}"
description: "{{ host.description }}"
description: "{{ host.description | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
inventory: "{{ host.summary_fields.inventory.name | default('ToDo: The host \'' + host.name + '\' must have an associated inventory') }}"
{% if host.variables and host.variables != '---' and host.variables != '' %}
variables:
Expand Down
2 changes: 1 addition & 1 deletion roles/filetree_create/templates/current_inventories.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
controller_inventories:
{% endif %}
- name: "{{ current_inventories_asset_value.name }}"
description: "{{ current_inventories_asset_value.description }}"
description: "{{ current_inventories_asset_value.description | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
organization: "{{ inventory_organization }}"
{% if current_inventories_asset_value.host_filter is defined %}
host_filter: "{{ current_inventories_asset_value.host_filter }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ controller_inventory_sources:
{% endif %}
{% for inventory_source in current_inventory_sources_asset_value %}
- name: "{{ inventory_source.name }}"
description: "{{ inventory_source.description }}"
description: "{{ inventory_source.description | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
{% if inventory_source.summary_fields.organization is defined %}
organization: "{{ inventory_source.summary_fields.organization.name }}"
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion roles/filetree_create/templates/current_job_templates.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
controller_templates:
{% endif %}
- name: "{{ current_job_templates_asset_value.name }}"
description: "{{ current_job_templates_asset_value.description }}"
description: "{{ current_job_templates_asset_value.description | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
organization: "{{ current_job_templates_asset_value.summary_fields.organization.name | default(organization if organization != 'ORGANIZATIONLESS' else 'ToDo: The job template \'' + current_job_templates_asset_value.name + '\' must belong to an organization') }}"
project: "{{ current_job_templates_asset_value.summary_fields.project.name | default('ToDo: The job template \'' + current_job_templates_asset_value.name + '\' must have a project assigned') }}"
{% if current_job_templates_asset_value.inventory %}
Expand Down
2 changes: 1 addition & 1 deletion roles/filetree_create/templates/current_projects.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
controller_projects:
{% endif %}
- name: "{{ current_projects_asset_value.name }}"
description: "{{ current_projects_asset_value.description }}"
description: "{{ current_projects_asset_value.description | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
organization: "{{ current_projects_asset_value.summary_fields.organization.name | default(organization if organization != 'ORGANIZATIONLESS' else 'ToDo: The project \'' + current_projects_asset_value.name + '\' must have an organization') }}"
{% if current_projects_asset_value.scm_type %}
scm_type: "{{ current_projects_asset_value.scm_type }}"
Expand Down
2 changes: 1 addition & 1 deletion roles/filetree_create/templates/current_schedules.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ controller_schedules:
{% endif %}
- name: "{{ current_schedules_asset_value.name }}"
{% if current_schedules_asset_value.description is defined %}
description: "{{ current_schedules_asset_value.description }}"
description: "{{ current_schedules_asset_value.description | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
{% endif %}
enabled: {{ current_schedules_asset_value.enabled }}
unified_job_template: "{{ current_schedules_asset_value.summary_fields.unified_job_template.name }}"
Expand Down
2 changes: 1 addition & 1 deletion roles/filetree_create/templates/current_teams.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
controller_teams:
{% endif %}
- name: "{{ current_teams_asset_value.name }}"
description: "{{ current_teams_asset_value.description }}"
description: "{{ current_teams_asset_value.description | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
organization: "{{ current_teams_asset_value.summary_fields.organization.name }}"
{% if last_team | default(true) | bool %}
...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
controller_workflows:
{% endif %}
- name: "{{ current_workflow_job_templates_asset_value.name }}"
description: "{{ current_workflow_job_templates_asset_value.description }}"
description: "{{ current_workflow_job_templates_asset_value.description | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
organization: "{{ current_workflow_job_templates_asset_value.summary_fields.organization.name | default(organization if organization != 'ORGANIZATIONLESS' else 'ToDo: The WF \'' + current_workflow_job_templates_asset_value.name + '\' must belong to an organization') }}"
state: "present"
simplified_workflow_nodes:
Expand Down
Loading