mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 10:51:24 -07:00
Fix file and copy modules on py3 and enable tests. (#17239)
- Fix octal formatting of file mode in module response on py3. - Convert file path to unicode in copy action. - Enable file and copy module tests for py3 now that they pass.
This commit is contained in:
parent
44d979c8f5
commit
178292d2cd
3 changed files with 2 additions and 4 deletions
|
@ -1197,7 +1197,7 @@ class AnsibleModule(object):
|
|||
kwargs['owner'] = user
|
||||
kwargs['group'] = group
|
||||
st = os.lstat(path)
|
||||
kwargs['mode'] = oct(stat.S_IMODE(st[stat.ST_MODE]))
|
||||
kwargs['mode'] = '0%03o' % stat.S_IMODE(st[stat.ST_MODE])
|
||||
# secontext not yet supported
|
||||
if os.path.islink(path):
|
||||
kwargs['state'] = 'link'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue