Commit bd3c7c3e by Matt Martz

The name parameter for search_opts is a regex string, so make sure we include…

The name parameter for search_opts is a regex string, so make sure we include start and end of string characters
parent 1609dfbc
......@@ -576,7 +576,7 @@ def cloudservers(module, state, name, flavor, image, meta, key_name, files,
names = [name] * count
else:
search_opts = {
'name': name,
'name': '^%s$' % name,
'image': image,
'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' % arg)
search_opts = {
'name': name,
'name': '^%s$' % name,
'image': image,
'flavor': flavor
}
......
......@@ -112,7 +112,7 @@ def rax_facts(module, address, name, server_id):
search_opts = {}
if name:
search_opts = dict(name=name)
search_opts = dict(name='^%s$' % name)
try:
servers = cs.servers.list(search_opts=search_opts)
except Exception, e:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment