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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
slapos.core
Commits
ec31220e
Commit
ec31220e
authored
Oct 02, 2013
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CLI: fix root check for slapgrid and format.
parent
9766a78a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
slapos/cli/format.py
slapos/cli/format.py
+2
-2
slapos/cli/slapgrid.py
slapos/cli/slapgrid.py
+2
-2
No files found.
slapos/cli/format.py
View file @
ec31220e
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
import
logging
import
logging
import
sys
import
sys
from
slapos.cli.command
import
must_be_root
from
slapos.cli.command
import
check_root_user
from
slapos.cli.config
import
ConfigCommand
from
slapos.cli.config
import
ConfigCommand
from
slapos.format
import
do_format
,
FormatConfig
,
tracing_monkeypatch
,
UsageError
from
slapos.format
import
do_format
,
FormatConfig
,
tracing_monkeypatch
,
UsageError
from
slapos.util
import
string_to_boolean
from
slapos.util
import
string_to_boolean
...
@@ -69,7 +69,7 @@ class FormatCommand(ConfigCommand):
...
@@ -69,7 +69,7 @@ class FormatCommand(ConfigCommand):
# Parse if we have to check if running from root
# Parse if we have to check if running from root
# XXX document this feature.
# XXX document this feature.
if
string_to_boolean
(
getattr
(
conf
,
'root_check'
,
'True'
).
lower
()):
if
string_to_boolean
(
getattr
(
conf
,
'root_check'
,
'True'
).
lower
()):
must_be_root
(
lambda
:
None
)
check_root_user
(
self
)
if
not
self
.
app
.
options
.
log_file
and
conf
.
log_file
:
if
not
self
.
app
.
options
.
log_file
and
conf
.
log_file
:
# no log file is provided by argparser,
# no log file is provided by argparser,
...
...
slapos/cli/slapgrid.py
View file @
ec31220e
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
from
slapos.cli.command
import
must_be_root
from
slapos.cli.command
import
check_root_user
from
slapos.cli.config
import
ConfigCommand
from
slapos.cli.config
import
ConfigCommand
from
slapos.grid.utils
import
setRunning
,
setFinished
from
slapos.grid.utils
import
setRunning
,
setFinished
...
@@ -70,7 +70,7 @@ class SlapgridCommand(ConfigCommand):
...
@@ -70,7 +70,7 @@ class SlapgridCommand(ConfigCommand):
# Parse if we have to check if running from root
# Parse if we have to check if running from root
# XXX document this feature.
# XXX document this feature.
if
string_to_boolean
(
options
.
get
(
'root_check'
,
'True'
).
lower
()):
if
string_to_boolean
(
options
.
get
(
'root_check'
,
'True'
).
lower
()):
must_be_root
(
lambda
:
None
)
check_root_user
(
self
)
check_missing_parameters
(
options
)
check_missing_parameters
(
options
)
check_missing_files
(
options
)
check_missing_files
(
options
)
...
...
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