1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix regex match, the printf match should work with 0 or more numeric padding characters, not 1 or more

This commit is contained in:
Matt Martz 2014-01-20 16:42:41 -06:00
parent c17d0e0357
commit 89fbc64b60

View file

@ -464,7 +464,7 @@ def cloudservers(module, state, name, flavor, image, meta, key_name, files,
else: else:
module.fail_json(msg=e.message) module.fail_json(msg=e.message)
pattern = re.sub(r'%\d+[sd]', r'(\d+)', name) pattern = re.sub(r'%\d*[sd]', r'(\d+)', name)
for server in cs.servers.list(): for server in cs.servers.list():
if server.metadata.get('group') == group: if server.metadata.get('group') == group:
servers.append(server) servers.append(server)
@ -525,7 +525,7 @@ def cloudservers(module, state, name, flavor, image, meta, key_name, files,
else: else:
module.fail_json(msg=e.message) module.fail_json(msg=e.message)
pattern = re.sub(r'%\d+[sd]', r'(\d+)', name) pattern = re.sub(r'%\d*[sd]', r'(\d+)', name)
for server in cs.servers.list(): for server in cs.servers.list():
if server.metadata.get('group') == group: if server.metadata.get('group') == group:
servers.append(server) servers.append(server)