mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge pull request #9947 from sbdelisle/develop
I realized that the coercion to oct string I did was incorrect.
This commit is contained in:
commit
3d94b7ea88
@ -2795,12 +2795,20 @@ def makedirs_perms(name,
|
||||
raise
|
||||
if tail == os.curdir: # xxx/newdir/. exists if xxx/newdir exists
|
||||
return
|
||||
|
||||
if type(mode) == int:
|
||||
mode = oct(mode)
|
||||
elif type(mode) == str:
|
||||
mode = oct(int(mode, 8))
|
||||
else:
|
||||
mode = None
|
||||
|
||||
os.mkdir(name)
|
||||
check_perms(name,
|
||||
None,
|
||||
user,
|
||||
group,
|
||||
oct(int(str(mode), 8)) if mode else None)
|
||||
mode)
|
||||
|
||||
|
||||
def get_devmm(name):
|
||||
|
@ -1703,6 +1703,13 @@ def recurse(name,
|
||||
)
|
||||
return ret
|
||||
|
||||
if type(dir_mode) == int:
|
||||
dir_mode = oct(dir_mode)
|
||||
elif type(dir_mode) == str:
|
||||
dir_mode = oct(int(dir_mode, 8))
|
||||
else:
|
||||
dir_mode = None
|
||||
|
||||
# Verify the target directory
|
||||
if not os.path.isdir(name):
|
||||
if os.path.exists(name):
|
||||
@ -1711,7 +1718,7 @@ def recurse(name,
|
||||
ret, 'The path {0} exists and is not a directory'.format(name))
|
||||
if not __opts__['test']:
|
||||
__salt__['file.makedirs_perms'](
|
||||
name, user, group, oct(int(str(dir_mode), 8)) if dir_mode else None)
|
||||
name, user, group, dir_mode)
|
||||
|
||||
def add_comment(path, comment):
|
||||
comments = ret['comment'].setdefault(path, [])
|
||||
|
Loading…
Reference in New Issue
Block a user