mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
Merge pull request #21437 from rallytime/bp-21409
Backport #21409 to 2014.7
This commit is contained in:
commit
6ac6a53302
@ -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('')
|
||||
|
Loading…
Reference in New Issue
Block a user