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
Klaus Wölfel
slapos.core
Commits
8b7f3b02
Commit
8b7f3b02
authored
Apr 03, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow no_bridge option to be put in slapos.cfg
parent
429e937a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
slapos/format.py
slapos/format.py
+17
-13
No files found.
slapos/format.py
View file @
8b7f3b02
...
...
@@ -1080,18 +1080,19 @@ class Config(object):
self
.
logger
.
addHandler
(
logging
.
StreamHandler
())
# Convert strings to booleans
root_needed
=
False
for
o
in
[
'alter_network'
,
'alter_user'
]:
if
getattr
(
self
,
o
).
lower
()
==
'true'
:
root_needed
=
True
setattr
(
self
,
o
,
True
)
elif
getattr
(
self
,
o
).
lower
()
==
'false'
:
setattr
(
self
,
o
,
False
)
else
:
message
=
'Option %r needs to be "True" or "False", wrong value: '
\
'%r'
%
(
o
,
getattr
(
self
,
o
))
self
.
logger
.
error
(
message
)
raise
UsageError
(
message
)
for
o
in
[
'alter_network'
,
'alter_user'
,
'no_bridge'
]:
attr
=
getattr
(
self
,
o
)
if
isinstance
(
attr
,
str
):
if
attr
.
lower
()
==
'true'
:
root_needed
=
True
setattr
(
self
,
o
,
True
)
elif
attr
.
lower
()
==
'false'
:
setattr
(
self
,
o
,
False
)
else
:
message
=
'Option %r needs to be "True" or "False", wrong value: '
\
'%r'
%
(
o
,
getattr
(
self
,
o
))
self
.
logger
.
error
(
message
)
raise
UsageError
(
message
)
if
not
self
.
dry_run
:
if
self
.
alter_user
:
...
...
@@ -1102,7 +1103,10 @@ class Config(object):
if
self
.
alter_network
:
self
.
checkRequiredBinary
([
'brctl'
])
if
self
.
dry_run
:
# Check if root is needed
if
(
self
.
alter_network
or
self
.
alter_user
)
and
not
self
.
dry_run
:
root_needed
=
True
else
:
root_needed
=
False
# check 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