Skip to content

Commit

Permalink
fix: improved regex for description
Browse files Browse the repository at this point in the history
  • Loading branch information
Przemyslaw Kalitowski committed Aug 6, 2024
1 parent e60d5f7 commit 7f732f6
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 12 deletions.
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 | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
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 | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
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 | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
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 | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
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 | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
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 | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
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 | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
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 | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
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 | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
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 | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
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 | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
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 | regex_replace('([\\\\\"$])', '\\\\\\1') }}"
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

0 comments on commit 7f732f6

Please sign in to comment.