Skip to content

Commit de745ae

Browse files
committed
Fix regex_replace expression for Python 3.7
There was a behavioral change in Python 3.7 regarding empty matches. This adjusts the regex to no longer match an empty string. See python/cpython#76489
1 parent 2c408e8 commit de745ae

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎tasks/configure.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
file:
1919
path: "{{ item.path }}"
2020
state: absent
21-
when: (item.path | basename) not in (haproxy_frontends | json_query('[*].name') | map('regex_replace', '(.*)', '\\1.cfg') | list)
21+
when: (item.path | basename) not in (haproxy_frontends | json_query('[*].name') | map('regex_replace', '(.+)', '\\1.cfg') | list)
2222
with_items: "{{ directory_contents.files }}"
2323

2424
- name: 'Build up the frontends'
@@ -46,7 +46,7 @@
4646
file:
4747
path: "{{ item.path }}"
4848
state: absent
49-
when: (item.path | basename) not in (haproxy_backends | json_query('[*].name') | map('regex_replace', '(.*)', '\\1.cfg') | list)
49+
when: (item.path | basename) not in (haproxy_backends | json_query('[*].name') | map('regex_replace', '(.+)', '\\1.cfg') | list)
5050
with_items: "{{ directory_contents.files }}"
5151

5252
- name: 'Build up the backends'
@@ -74,7 +74,7 @@
7474
file:
7575
path: "{{ item.path }}"
7676
state: absent
77-
when: (item.path | basename) not in (haproxy_listen | json_query('[*].name') | map('regex_replace', '(.*)', '\\1.cfg') | list)
77+
when: (item.path | basename) not in (haproxy_listen | json_query('[*].name') | map('regex_replace', '(.+)', '\\1.cfg') | list)
7878
with_items: "{{ directory_contents.files }}"
7979

8080
- name: 'Build up the listen sections'
@@ -100,7 +100,7 @@
100100
file:
101101
path: "{{ item.path }}"
102102
state: absent
103-
when: (item.path | basename) not in (haproxy_userlists | json_query('[*].name') | map('regex_replace', '(.*)', '\\1.cfg') | list)
103+
when: (item.path | basename) not in (haproxy_userlists | json_query('[*].name') | map('regex_replace', '(.+)', '\\1.cfg') | list)
104104
with_items: "{{ directory_contents.files }}"
105105

106106
- name: 'Build up the userlist sections'
@@ -146,7 +146,7 @@
146146
file:
147147
path: "{{ item.path }}"
148148
state: absent
149-
when: (item.path | basename) not in (haproxy_peers | json_query('[*].name') | map('regex_replace', '(.*)', '\\1.cfg') | list)
149+
when: (item.path | basename) not in (haproxy_peers | json_query('[*].name') | map('regex_replace', '(.+)', '\\1.cfg') | list)
150150
with_items: "{{ directory_contents.files }}"
151151

152152
- name: 'Build up the peers'

0 commit comments

Comments
 (0)