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

Missing escaping special characters in description. #882

Closed
przemkalit opened this issue Jul 26, 2024 · 1 comment
Closed

Missing escaping special characters in description. #882

przemkalit opened this issue Jul 26, 2024 · 1 comment
Labels
bug Something isn't working filetree/filetree_create

Comments

@przemkalit
Copy link
Contributor

przemkalit commented Jul 26, 2024

Summary

Recently, I tried to restore job templates in our environment, but an error is showing up due to some special characters in the description.

I've managed to fix it manually in the files in two ways:

original yaml fragment:

...
    description: "XXX report \\10.10.10.128\something$\whatever\yyy\zzz"
...

The first solution:

...
    description: "XXX report \\10.10.10.128\\something\\$\\whatever\\yyy\\zzz"
...

The second solution:

...
    description: 'XXX report \\10.10.10.128\something$\whatever\yyy\zzz'
...

But maybe you would have better solution for this.

Issue Type

  • Bug Report

Ansible, Collection, Controller details

Devel affected.

OS / ENVIRONMENT

N/A

Desired Behavior

Export objects with proper escaped special characters

Actual Behavior

I've ran an import script and include_vars module failed with this error:

"We were unable to read either as JSON nor YAML, these are the errors we got from each:
JSON: Expecting value: line 1 column 1 (char 0)
Syntax Error while loading YAML.
 found unknown escape character
The error appears to be in '/repo_dir/controller_objects/control_vars/controller_job_templates/job_scheduled.yaml':
 line 4, column 70, but maybe elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
 name: \"job_scheduled\"
 description: \"XXX \\\\10.10.10.128\\something$\\whatever\\yyy\\zzz\"\n          
}

STEPS TO REPRODUCE

  1. Create job template with description: XXX report \\10.10.10.128\something$\whatever\yyy\zzz.
  2. Export Job templates with filetree_create.
  3. Try to Include_vars with exported files.

Edit: double quotes present in description can break things as well.

@przemkalit przemkalit added bug Something isn't working new New issue, this should be removed once reviewed labels Jul 26, 2024
@djdanielsson djdanielsson added filetree/filetree_create and removed new New issue, this should be removed once reviewed labels Aug 6, 2024
@przemkalit
Copy link
Contributor Author

przemkalit commented Aug 21, 2024

Bug related to the include_vars module, I am closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working filetree/filetree_create
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants