mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge branch 'major-relative-path-fix' into devel
This commit is contained in:
commit
657d562995
1 changed files with 8 additions and 1 deletions
|
@ -210,8 +210,15 @@ def main():
|
|||
module.exit_json(changed=True)
|
||||
changed = True
|
||||
curpath = ''
|
||||
for dirname in path.split('/'):
|
||||
# Split the path so we can apply filesystem attributes recursively
|
||||
# from the root (/) directory for absolute paths or the base path
|
||||
# of a relative path. We can then walk the appropriate directory
|
||||
# path to apply attributes.
|
||||
for dirname in path.strip('/').split('/'):
|
||||
curpath = '/'.join([curpath, dirname])
|
||||
# Remove leading slash if we're creating a relative path
|
||||
if not os.path.isabs(path):
|
||||
curpath = curpath.lstrip('/')
|
||||
if not os.path.exists(curpath):
|
||||
os.mkdir(curpath)
|
||||
tmp_file_args = file_args.copy()
|
||||
|
|
Loading…
Reference in a new issue