Revert #1818 but avoid double-dwim, fixing relative fileglob

This commit is contained in:
Daniel Hokka Zakrisson 2013-01-09 14:52:52 +01:00
parent 891b1e371a
commit 7782923ea2
2 changed files with 4 additions and 5 deletions

View file

@ -56,9 +56,9 @@ class ActionModule(object):
if not found:
results=dict(failed=True, msg="could not find src in first_available_file list")
return ReturnData(conn=conn, result=results)
source = utils.template(self.runner.basedir, source, inject)
source = utils.path_dwim(self.runner.basedir, source)
else:
source = utils.template(self.runner.basedir, source, inject)
source = utils.path_dwim(self.runner.basedir, source)
local_md5 = utils.md5(source)
if local_md5 is None:

View file

@ -170,7 +170,6 @@ def prepare_writeable_dir(tree):
def path_dwim(basedir, given):
'''
make relative paths work like folks expect.
if a relative path is provided, convert it to an absolute path.
'''
if given.startswith("/"):
@ -178,7 +177,7 @@ def path_dwim(basedir, given):
elif given.startswith("~/"):
return os.path.expanduser(given)
else:
return os.path.abspath(os.path.join(basedir, given))
return os.path.join(basedir, given)
def json_loads(data):
''' parse a JSON string and return a data structure '''