Merge pull request #7304 from jimi-c/issue_7296_synchronize_relative_path
Make sure dwim'd relative path ends in a "/" if the original does
This commit is contained in:
commit
77a47dbb2d
1 changed files with 5 additions and 0 deletions
|
@ -32,7 +32,12 @@ class ActionModule(object):
|
|||
if 'vars' in self.inject:
|
||||
if '_original_file' in self.inject['vars']:
|
||||
# roles
|
||||
original_path = path
|
||||
path = utils.path_dwim_relative(self.inject['_original_file'], 'files', path, self.runner.basedir)
|
||||
if original_path and original_path[-1] == '/' and path[-1] != '/':
|
||||
# make sure the dwim'd path ends in a trailing "/"
|
||||
# if the original path did
|
||||
path += '/'
|
||||
elif 'inventory_dir' in self.inject['vars']:
|
||||
# non-roles
|
||||
abs_dir = os.path.abspath(self.inject['vars']['inventory_dir'])
|
||||
|
|
Loading…
Reference in a new issue