From 445e48b9919f7854617d98b91798e3f454a2372c Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Fri, 20 Apr 2012 07:57:39 -0400 Subject: [PATCH] Call os.path.expanduser in modules so things work as expected even when using ./hacking/test-module script --- library/copy | 4 ++-- library/file | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/library/copy b/library/copy index fecfeeafac..ef6c30a6b6 100755 --- a/library/copy +++ b/library/copy @@ -40,8 +40,8 @@ for x in items: (k, v) = x.split("=") params[k] = v -src = params['src'] -dest = params['dest'] +src = os.path.expanduser(params['src']) +dest = os.path.expanduser(params['dest']) # raise an error if there is no src file diff --git a/library/file b/library/file index 742a7d7b22..2922c3d080 100755 --- a/library/file +++ b/library/file @@ -88,8 +88,8 @@ for x in items: params[k] = v state = params.get('state','file') -path = params.get('path', params.get('dest', params.get('name', None))) -src = params.get('src', None) +path = os.path.expanduser(params.get('path', params.get('dest', params.get('name', None)))) +src = os.path.expanduser(params.get('src', None)) dest = params.get('dest', None) mode = params.get('mode', None) owner = params.get('owner', None)