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
18
Merge Requests
18
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
15c41f9d
Commit
15c41f9d
authored
Aug 12, 2014
by
Lutra Conseil
Committed by
Rafael Monnerat
Nov 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos: Make data-log accessible for instances users.
parent
4e3305d0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
slapos/collect/__init__.py
slapos/collect/__init__.py
+1
-1
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+11
-1
slapos/tests/slapgrid.py
slapos/tests/slapgrid.py
+3
-0
No files found.
slapos/collect/__init__.py
View file @
15c41f9d
...
@@ -79,7 +79,7 @@ def do_collect(conf):
...
@@ -79,7 +79,7 @@ def do_collect(conf):
raise
raise
log_directory
=
"%s/var/data-log"
%
conf
.
get
(
"slapos"
,
"instance_root"
)
log_directory
=
"%s/var/data-log"
%
conf
.
get
(
"slapos"
,
"instance_root"
)
mkdir_p
(
log_directory
)
mkdir_p
(
log_directory
,
0o755
)
database
=
Database
(
log_directory
)
database
=
Database
(
log_directory
)
computer
=
Computer
(
ComputerSnapshot
())
computer
=
Computer
(
ComputerSnapshot
())
...
...
slapos/grid/slapgrid.py
View file @
15c41f9d
...
@@ -37,6 +37,7 @@ import subprocess
...
@@ -37,6 +37,7 @@ import subprocess
import
sys
import
sys
import
tempfile
import
tempfile
import
time
import
time
import
stat
import
traceback
import
traceback
import
warnings
import
warnings
import
logging
import
logging
...
@@ -352,8 +353,17 @@ class Slapgrid(object):
...
@@ -352,8 +353,17 @@ class Slapgrid(object):
raise
OSError
(
'%s does not exist.'
%
self
.
instance_root
)
raise
OSError
(
'%s does not exist.'
%
self
.
instance_root
)
# Creates everything needed
# Creates everything needed
# Create directory accessible for the instances.
var_directory
=
os
.
path
.
join
(
self
.
instance_root
,
'var'
)
if
not
os
.
path
.
isdir
(
var_directory
):
os
.
mkdir
(
var_directory
)
os
.
chmod
(
var_directory
,
stat
.
S_IRWXU
|
stat
.
S_IROTH
|
stat
.
S_IXOTH
|
\
stat
.
S_IRGRP
|
stat
.
S_IXGRP
)
mkdir_p
(
os
.
path
.
join
(
self
.
instance_root
,
'var'
),
0o755
)
# Creates instance_root structure
# Creates instance_root structure
createPrivateDirectory
(
os
.
path
.
join
(
self
.
instance_root
,
'var'
))
createPrivateDirectory
(
os
.
path
.
join
(
self
.
instance_root
,
'var'
,
'log'
))
createPrivateDirectory
(
os
.
path
.
join
(
self
.
instance_root
,
'var'
,
'log'
))
createPrivateDirectory
(
os
.
path
.
join
(
self
.
instance_root
,
'var'
,
'run'
))
createPrivateDirectory
(
os
.
path
.
join
(
self
.
instance_root
,
'var'
,
'run'
))
...
...
slapos/tests/slapgrid.py
View file @
15c41f9d
...
@@ -34,6 +34,7 @@ import shutil
...
@@ -34,6 +34,7 @@ import shutil
import
signal
import
signal
import
socket
import
socket
import
sys
import
sys
import
stat
import
tempfile
import
tempfile
import
textwrap
import
textwrap
import
time
import
time
...
@@ -535,6 +536,8 @@ class TestSlapgridCPWithMaster(MasterMixin, unittest.TestCase):
...
@@ -535,6 +536,8 @@ class TestSlapgridCPWithMaster(MasterMixin, unittest.TestCase):
self
.
assertEqual
(
self
.
grid
.
processComputerPartitionList
(),
slapgrid
.
SLAPGRID_SUCCESS
)
self
.
assertEqual
(
self
.
grid
.
processComputerPartitionList
(),
slapgrid
.
SLAPGRID_SUCCESS
)
self
.
assertItemsEqual
(
os
.
listdir
(
self
.
instance_root
),
[
'etc'
,
'var'
])
self
.
assertItemsEqual
(
os
.
listdir
(
self
.
instance_root
),
[
'etc'
,
'var'
])
self
.
assertItemsEqual
(
os
.
listdir
(
self
.
software_root
),
[])
self
.
assertItemsEqual
(
os
.
listdir
(
self
.
software_root
),
[])
st
=
os
.
stat
(
os
.
path
.
join
(
self
.
instance_root
,
'var'
))
self
.
assertEquals
(
stat
.
S_IMODE
(
st
.
st_mode
),
0o755
)
def
test_one_partition
(
self
):
def
test_one_partition
(
self
):
computer
=
ComputerForTest
(
self
.
software_root
,
self
.
instance_root
)
computer
=
ComputerForTest
(
self
.
software_root
,
self
.
instance_root
)
...
...
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