From f4a494e14dbb3e6c50c62ef06f24905574315b8d Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Mon, 10 Feb 2014 13:15:03 -0600 Subject: [PATCH] The name parameter for search_opts is a regex string, so make sure we include start and end of string characters --- cloud/rax | 4 ++-- cloud/rax_facts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cloud/rax b/cloud/rax index 46302bc851a..0c8e64a4b74 100644 --- a/cloud/rax +++ b/cloud/rax @@ -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 } diff --git a/cloud/rax_facts b/cloud/rax_facts index b4cb0c978ff..9c42bb30a82 100644 --- a/cloud/rax_facts +++ b/cloud/rax_facts @@ -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: