From bd3c7c3efae3638975d93343cb8b6649e79993b1 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 --- library/cloud/rax | 4 ++-- library/cloud/rax_facts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library/cloud/rax b/library/cloud/rax index 46302bc851a..0c8e64a4b74 100644 --- a/library/cloud/rax +++ b/library/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/library/cloud/rax_facts b/library/cloud/rax_facts index b4cb0c978ff..9c42bb30a82 100644 --- a/library/cloud/rax_facts +++ b/library/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: