Check if dir_mode is passed before trying to change the mode

Thanks again to @Mistobaan for walking me through this fix. Fixes #1631
This commit is contained in:
Seth House 2012-07-15 14:53:10 -07:00
parent 9b9c8dbe51
commit 58d36b186d

View File

@ -1384,7 +1384,9 @@ def recurse(name,
if os.path.isdir(fn_) and include_empty:
#create empty dir
os.mkdir(dest)
__salt__['file.set_mode'](dest, dir_mode)
if dir_mode:
__salt__['file.set_mode'](dest, dir_mode)
else:
# The destination file is not present, make it
# FIXME: no metadata (ownership, permissions) available