From b79960e13b13f6c31440db0792285f76bb4a065d Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Tue, 29 Jan 2013 10:31:33 +0100 Subject: [PATCH 1/4] If failed lookups are fatal, re-raise the exception Fixes #1938. --- lib/ansible/utils/template.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/utils/template.py b/lib/ansible/utils/template.py index b947dc18945..e5db9e53dda 100644 --- a/lib/ansible/utils/template.py +++ b/lib/ansible/utils/template.py @@ -170,6 +170,8 @@ def _varFind(basedir, text, vars, lookup_fatal, depth=0): except errors.AnsibleError: if not lookup_fatal: replacement = None + else: + raise else: replacement = None return {'replacement': replacement, 'start': start, 'end': end} From 65d0eb9621e50497c6c48320c268d52a24667e3c Mon Sep 17 00:00:00 2001 From: diefans Date: Tue, 29 Jan 2013 13:53:36 +0100 Subject: [PATCH 2/4] proper bin path now called --- library/supervisorctl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/supervisorctl b/library/supervisorctl index 0882a3a3dde..9e188cd454c 100644 --- a/library/supervisorctl +++ b/library/supervisorctl @@ -58,7 +58,7 @@ def main(): SUPERVISORCTL = module.get_bin_path('supervisorctl', True) - rc, out, err = module.run_command('%s status' % supervisorctl) + rc, out, err = module.run_command('%s status' % SUPERVISORCTL) present = name in out if state == 'present': @@ -73,7 +73,7 @@ def main(): module.exit_json(changed=False, name=name, state=state) - rc, out, err = module.run_command('%s status %s' % (supervisorctl, name)) + rc, out, err = module.run_command('%s status %s' % (SUPERVISORCTL, name)) running = 'RUNNING' in out if running and state == 'started': From 0243b7be7c50ee606d8df220435b2453c390f971 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Tue, 29 Jan 2013 18:57:02 +0100 Subject: [PATCH 3/4] Fix get_url to work on Python 2.4 --- library/get_url | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/library/get_url b/library/get_url index 2db31c6d7c8..a28656291ef 100644 --- a/library/get_url +++ b/library/get_url @@ -101,11 +101,13 @@ def url_do_get(module, url, dest): info = dict(url=url, dest=dest) r = None parsed = urlparse.urlparse(url) - if '@' in parsed.netloc: - credentials = parsed.netloc.split('@')[0] + if '@' in parsed[1]: + credentials, netloc = parsed[1].split('@', 1) if ':' in credentials: - username, password = credentials.split(':') - netloc = parsed.netloc.split('@')[1] + username, password = credentials.split(':', 1) + else: + username = credentials + password = '' parsed = list(parsed) parsed[1] = netloc From 168fcb0a4af766692b198ba29f9f54648563d25c Mon Sep 17 00:00:00 2001 From: Tim Gerla Date: Wed, 30 Jan 2013 11:01:25 -0800 Subject: [PATCH 4/4] Only inventory "running" EC2 instances. "stopped" is also a valid state and these should not be inventoried. --- plugins/inventory/ec2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/inventory/ec2.py b/plugins/inventory/ec2.py index 7ac3aa96191..fcad5703ee4 100755 --- a/plugins/inventory/ec2.py +++ b/plugins/inventory/ec2.py @@ -274,7 +274,7 @@ class Ec2Inventory(object): addressable ''' # Only want running instances - if instance.state == 'terminated': + if instance.state != 'running': return # Select the best destination address