def _custom(self, custom):
"""
Create commented files to let the admin know where it's safe
to make custom changes. Mirror the default tree. Never overwrite.
"""
path_dir = os.path.dirname(custom)
if not os.path.isdir(path_dir):
_create_dirs(path_dir, self.pillar_dir)
if not self.dryrun:
if not os.path.isfile(custom):
log.info("Writing {}".format(custom))
with open(custom, "w") as yml:
custom_split = custom.split("stack")
custom_for = "{}{}{}".format(
custom_split[0],
"stack/default",
custom_split[1])
yml.write("# {}\n".format(custom))
yml.write("# Overwrites configuration in {}\n".format(custom_for))
_examples(custom, yml)
评论列表
文章目录