Add dir_mode for file.managed

Refs #7860
This commit is contained in:
Mike Place 2013-11-06 21:13:06 -07:00
parent 0d0454a904
commit 302a763ef9
2 changed files with 6 additions and 3 deletions

View File

@ -2115,7 +2115,8 @@ def manage_file(name,
backup, backup,
template=None, template=None,
show_diff=True, show_diff=True,
contents=None): contents=None,
dir_mode=None):
''' '''
Checks the destination against what was retrieved with get_managed and Checks the destination against what was retrieved with get_managed and
makes the appropriate modifications (if necessary). makes the appropriate modifications (if necessary).
@ -2262,7 +2263,7 @@ def manage_file(name,
if not os.path.isdir(os.path.dirname(name)): if not os.path.isdir(os.path.dirname(name)):
if makedirs: if makedirs:
makedirs(name, user=user, group=group, mode=mode) makedirs(name, user=user, group=group, mode=dir_mode or mode)
else: else:
__clean_tmp(sfn) __clean_tmp(sfn)
return _error(ret, 'Parent directory not present') return _error(ret, 'Parent directory not present')

View File

@ -933,6 +933,7 @@ def managed(name,
mode=None, mode=None,
template=None, template=None,
makedirs=False, makedirs=False,
dir_mode=None,
context=None, context=None,
replace=True, replace=True,
defaults=None, defaults=None,
@ -1163,7 +1164,8 @@ def managed(name,
backup, backup,
template, template,
show_diff, show_diff,
contents) contents,
dir_mode)
def directory(name, def directory(name,