Commit 5163ee5b authored by Cédric de Saint Martin's avatar Cédric de Saint Martin

Merge remote-tracking branch 'origin/certificate_repository_path'

parents 9c0d587c 3d830d1c
......@@ -59,6 +59,8 @@ def prettify_xml(xml):
return lxml.etree.tostring(root, pretty_print=True)
from slapos.util import mkdir_p
class OS(object):
"""Wrap parts of the 'os' module to provide logging of performed actions."""
......@@ -1096,6 +1098,9 @@ def run(config):
alter_network=config.alter_network,
create_tap=config.create_tap)
if getattr(config, 'certificate_repository_path'):
mkdir_p(config.certificate_repository_path, mode=0o700)
# Dumping and sending to the erp5 the current configuration
if not config.dry_run:
computer.dump(path_to_xml=config.computer_xml,
......
# -*- coding: utf-8 -*-
import os, errno
def mkdir_p(path, mode=0o777):
"""\
Creates a directory and its parents, if needed.
NB: If the directory already exists, it does not change its permission.
"""
try:
os.makedirs(path, mode)
except OSError as exc:
if exc.errno == errno.EEXIST and os.path.isdir(path):
pass
else:
raise
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