commit 9df6ee216a30111e744d1a5bce2eea1238b7694f
Author: Martin Chlumsky <email address hidden>
Date: Mon Nov 4 11:54:58 2019 -0500
Fix empty match while setting supported_policy_files
When supported_policy_files gets set under python 3.7 [1], the regex '(.*)'
matches twice, once for the policy file name and once more for the empty string
that follows the policy file name. This is new behavior under python
3.7. [2]
This leads to the replacement string being written out twice resulting
in something like this: "nova_policy.yamlnova_".
This patch changes the regex to '(.+)' ensuring there is no match success
against the empty string.
Reviewed: https:/ /review. opendev. org/692989 /git.openstack. org/cgit/ openstack/ kolla-ansible/ commit/ ?id=9df6ee216a3 0111e744d1a5bce 2eea1238b7694f
Committed: https:/
Submitter: Zuul
Branch: stable/stein
commit 9df6ee216a30111 e744d1a5bce2eea 1238b7694f
Author: Martin Chlumsky <email address hidden>
Date: Mon Nov 4 11:54:58 2019 -0500
Fix empty match while setting supported_ policy_ files
When supported_ policy_ files gets set under python 3.7 [1], the regex '(.*)'
matches twice, once for the policy file name and once more for the empty string
that follows the policy file name. This is new behavior under python
3.7. [2]
This leads to the replacement string being written out twice resulting yamlnova_ ".
in something like this: "nova_policy.
This patch changes the regex to '(.+)' ensuring there is no match success
against the empty string.
[1]:
supported_ policy_ files: "{{ supported_ policy_ format_ list | map('regex_ replace' , '(.*)', '{{ project_name }}_\\1') | list }}"
- set_fact:
[2]: https:/ /docs.python. org/3/library/ re.html# re.sub
Change-Id: Ie5278832e29336 4c66d53ddb07dff 9c5409f0cc6 dc6dc2f690bf181 cb8354d150)
Closes-Bug: 1851249
(cherry picked from commit 9d0ccad15aa358c