mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #5941 from sivel/rax-name-search-opts
rax module: Use regex start and end of string with name base filters
This commit is contained in:
commit
1277b45b3c
2 changed files with 3 additions and 3 deletions
|
@ -576,7 +576,7 @@ def cloudservers(module, state, name, flavor, image, meta, key_name, files,
|
||||||
names = [name] * count
|
names = [name] * count
|
||||||
else:
|
else:
|
||||||
search_opts = {
|
search_opts = {
|
||||||
'name': name,
|
'name': '^%s$' % name,
|
||||||
'image': image,
|
'image': image,
|
||||||
'flavor': flavor
|
'flavor': flavor
|
||||||
}
|
}
|
||||||
|
@ -612,7 +612,7 @@ def cloudservers(module, state, name, flavor, image, meta, key_name, files,
|
||||||
module.fail_json(msg='%s is required for the "rax" '
|
module.fail_json(msg='%s is required for the "rax" '
|
||||||
'module' % arg)
|
'module' % arg)
|
||||||
search_opts = {
|
search_opts = {
|
||||||
'name': name,
|
'name': '^%s$' % name,
|
||||||
'image': image,
|
'image': image,
|
||||||
'flavor': flavor
|
'flavor': flavor
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,7 @@ def rax_facts(module, address, name, server_id):
|
||||||
|
|
||||||
search_opts = {}
|
search_opts = {}
|
||||||
if name:
|
if name:
|
||||||
search_opts = dict(name=name)
|
search_opts = dict(name='^%s$' % name)
|
||||||
try:
|
try:
|
||||||
servers = cs.servers.list(search_opts=search_opts)
|
servers = cs.servers.list(search_opts=search_opts)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
|
Loading…
Reference in a new issue