Merge pull request #21437 from rallytime/bp-21409

Backport #21409 to 2014.7
This commit is contained in:
Thomas S Hatch 2015-03-09 14:21:48 -06:00
commit 6ac6a53302

View File

@ -10,6 +10,7 @@ import os
import re
import sys
import stat
import errno
import socket
import logging
@ -161,8 +162,11 @@ def verify_files(files, user):
for fn_ in files:
dirname = os.path.dirname(fn_)
try:
if not os.path.isdir(dirname):
try:
os.makedirs(dirname)
except OSError as err:
if err.errno != errno.EEXIST:
raise
if not os.path.isfile(fn_):
with salt.utils.fopen(fn_, 'w+') as fp_:
fp_.write('')