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

Problem: Role fails when using special chars in atom_title and atom_description #106

Open
mamedin opened this issue Sep 22, 2021 · 2 comments
Assignees

Comments

@mamedin
Copy link
Contributor

mamedin commented Sep 22, 2021

For instance, when using:

atom_description: "Fonds d'archives de la Ville de XXXX"

Error when purging the database:

TASK [artefactual.atom : Purge database] *************************************************************************************************************************************************************************************************************************************************
Wednesday 22 September 2021  13:17:52 +0200 (0:00:00.043)       0:04:50.129 *** 
fatal: [XXXXX-nginx]: FAILED! => {"changed": true, "cmd": "php -d memory_limit=-1 symfony tools:purge --no-confirmation --email='[email protected]' --username='support' --password='YYYYYYY' --title='Archives de XXXXXXX' --description='Fonds d'archives de la Ville de XXXXXX' --url='http://127.0.0.1'", "delta": "0:00:00.001963", "end": "2021-09-22 11:17:53.171412", "msg": "non-zero return code", "rc": 2, "start": "2021-09-22 11:17:53.169449", "stderr": "/bin/sh: 1: Syntax error: Unterminated quoted string", "stderr_lines": ["/bin/sh: 1: Syntax error: Unterminated quoted string"], "stdout": "", "stdout_lines": []}
@mamedin
Copy link
Contributor Author

mamedin commented Sep 22, 2021

As first try I tested using the jinja2 escape or urlencode filters at:

https://github.com/artefactual-labs/ansible-atom/blob/master/tasks/flush.yml#L12

For instance:

shell: "php -d memory_limit=-1 symfony tools:purge --no-confirmation --email='{{ atom_user_email }}' --username='{{ atom_user_username }}' --password='{{ atom_user_password }}' --title='{{ atom_title | escape }}' --description='{{ atom_description | escape }}' --url='http://127.0.0.1'"

@mamedin mamedin self-assigned this Sep 22, 2021
@mamedin
Copy link
Contributor Author

mamedin commented Sep 22, 2021

It seems a better alternative, at least for the example in this issue:

shell: "php -d memory_limit=-1 symfony tools:purge --no-confirmation --email='{{ atom_user_email }}' --username='{{ atom_user_username }}' --password='{{ atom_user_password }}' --title=\"{{ atom_title }}\" --description=\"{{ atom_description }}\" --url='http://127.0.0.1'"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant