Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
17
Merge Requests
17
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
3d830d1c
Commit
3d830d1c
authored
Jan 28, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapformat creates partition_pki if needed
parent
7f58ed1d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
slapos/format.py
slapos/format.py
+5
-0
slapos/util.py
slapos/util.py
+19
-0
No files found.
slapos/format.py
View file @
3d830d1c
...
@@ -43,6 +43,8 @@ import subprocess
...
@@ -43,6 +43,8 @@ import subprocess
import
sys
import
sys
import
time
import
time
from
slapos.util
import
mkdir_p
class
OS
(
object
):
class
OS
(
object
):
_os
=
os
_os
=
os
...
@@ -1014,6 +1016,9 @@ def run(config):
...
@@ -1014,6 +1016,9 @@ def run(config):
computer
.
construct
(
alter_user
=
config
.
alter_user
,
computer
.
construct
(
alter_user
=
config
.
alter_user
,
alter_network
=
config
.
alter_network
,
create_tap
=
config
.
create_tap
)
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
# Dumping and sending to the erp5 the current configuration
if
not
config
.
dry_run
:
if
not
config
.
dry_run
:
computer
.
dump
(
config
.
computer_xml
)
computer
.
dump
(
config
.
computer_xml
)
...
...
slapos/util.py
0 → 100644
View file @
3d830d1c
# -*- 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment