Commit f9f07cb1 authored by Franco Fichtner's avatar Franco Fichtner

templates: remove files in the way of directories

Way better fix for the squid file transition.  Does not require
a manual restart anymore.

(cherry picked from commit 101fc844)
parent 4cdceb01
......@@ -190,8 +190,11 @@ class Template(object):
for fpart in filename.strip().split('/')[:-1]:
fparts.append(fpart)
if len(fpart) > 1:
if not os.path.exists('/'.join(fparts)):
os.mkdir('/'.join(fparts))
tmppart = '/'.join(fparts);
if os.path.isfile(tmppart):
os.remove(tmppart)
if not os.path.exists(tmppart):
os.mkdir(tmppart)
def _generate(self, module_name, create_directory=True):
""" generate configuration files for one section using bound config and template data
......
rc.conf.d:/etc/rc.conf.d/squid
rc.conf.d:/etc/rc.conf.d/squid/squid
squid.conf:/usr/local/etc/squid/squid.conf
newsyslog.conf:/etc/newsyslog.conf.d/squid
externalACLs.conf:/usr/local/etc/squid/externalACLs.conf
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment