From 13ba31231e38c45001a0b9b8a19964dd8249a647 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Thu, 19 Apr 2012 11:38:44 -0400 Subject: [PATCH] Fixup slurp module usage when not running as root, fix error handling path in slurp module. --- lib/ansible/runner.py | 2 +- library/slurp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/runner.py b/lib/ansible/runner.py index 0b6ede10044..323ebe71221 100755 --- a/lib/ansible/runner.py +++ b/lib/ansible/runner.py @@ -471,7 +471,7 @@ class Runner(object): if self.remote_user == 'root': metadata = '/etc/ansible/setup' else: - metadata = '~/.ansible/setup' + metadata = "/home/%s/.ansible/setup" % self.remote_user # install the template module slurp_module = self._transfer_module(conn, tmp, 'slurp') diff --git a/library/slurp b/library/slurp index 8b80e5da4b9..ab0c879db39 100755 --- a/library/slurp +++ b/library/slurp @@ -50,7 +50,7 @@ source = params['src'] if not os.path.exists(source): print json.dumps(dict( failed = 1, - msg = "file not found: %s" % metadata + msg = "file not found: %s" % source )) sys.exit(1)