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
Ivan Tyagov
slapos.core
Commits
c931d60c
Commit
c931d60c
authored
Nov 14, 2018
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct default value in help for slapos node format
parent
175b5788
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
27 deletions
+13
-27
slapos/cli/format.py
slapos/cli/format.py
+6
-4
slapos/format.py
slapos/format.py
+7
-23
No files found.
slapos/cli/format.py
View file @
c931d60c
...
...
@@ -62,13 +62,15 @@ class FormatCommand(ConfigCommand):
ap
.
add_argument
(
'--alter_user'
,
choices
=
[
'True'
,
'False'
],
#default=FormatConfig.alter_user, #can't use default here because it would overwrite .cfg
help
=
'Shall slapformat alter user database'
' (default:
%(default)s)'
)
' (default:
{})'
.
format
(
FormatConfig
.
alter_user
)
)
ap
.
add_argument
(
'--alter_network'
,
choices
=
[
'True'
,
'False'
],
#default=FormatConfig.alter_network, #can't use default here because it would overwrite .cfg
help
=
'Shall slapformat alter network configuration'
' (default:
%(default)s)'
)
' (default:
{})'
.
format
(
FormatConfig
.
alter_network
)
)
ap
.
add_argument
(
'--now'
,
default
=
False
,
...
...
@@ -87,11 +89,11 @@ class FormatCommand(ConfigCommand):
return
ap
def
take_action
(
self
,
args
):
configp
=
self
.
fetch_config
(
args
)
configp
=
self
.
fetch_config
(
args
)
# read the options in .cfg
conf
=
FormatConfig
(
logger
=
self
.
app
.
log
)
conf
.
mergeConfig
(
args
,
configp
)
conf
.
mergeConfig
(
args
,
configp
)
# commandline options overwrite .cfg options
# Parse if we have to check if running from root
# XXX document this feature.
...
...
slapos/format.py
View file @
c931d60c
...
...
@@ -1485,19 +1485,19 @@ def do_format(conf):
class
FormatConfig
(
object
):
key_file
=
None
cert_file
=
None
alter_network
=
None
alter_user
=
None
create_tap
=
Non
e
create_tun
=
Non
e
alter_network
=
'True'
alter_user
=
'True'
create_tap
=
Tru
e
create_tun
=
Fals
e
computer_xml
=
None
computer_json
=
None
input_definition_file
=
None
log_file
=
None
output_definition_file
=
None
dry_run
=
None
software_user
=
None
tap_gateway_interface
=
None
use_unique_local_address_block
=
Non
e
software_user
=
'slapsoft'
tap_gateway_interface
=
''
use_unique_local_address_block
=
Fals
e
instance_storage_home
=
None
def
__init__
(
self
,
logger
):
...
...
@@ -1557,22 +1557,6 @@ class FormatConfig(object):
self
.
logger
.
warning
(
'no_bridge option is deprecated and should be '
'replaced by create_tap.'
)
# Set defaults lately
if
self
.
alter_network
is
None
:
self
.
alter_network
=
'True'
if
self
.
alter_user
is
None
:
self
.
alter_user
=
'True'
if
self
.
software_user
is
None
:
self
.
software_user
=
'slapsoft'
if
self
.
create_tap
is
None
:
self
.
create_tap
=
True
if
self
.
create_tun
is
None
:
self
.
create_tun
=
False
if
self
.
tap_gateway_interface
is
None
:
self
.
tap_gateway_interface
=
''
if
self
.
use_unique_local_address_block
is
None
:
self
.
use_unique_local_address_block
=
False
# Convert strings to booleans
for
option
in
[
'alter_network'
,
'alter_user'
,
'create_tap'
,
'create_tun'
,
'use_unique_local_address_block'
]:
attr
=
getattr
(
self
,
option
)
...
...
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