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
Gabriel Monnerat
slapos.core
Commits
7009dddc
Commit
7009dddc
authored
May 10, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix log behavior for 'node format'; also support --log_file for all slapos commands
parent
cc202553
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
9 deletions
+4
-9
slapos/cli/entry.py
slapos/cli/entry.py
+3
-3
slapos/cli/format.py
slapos/cli/format.py
+1
-6
No files found.
slapos/cli/entry.py
View file @
7009dddc
...
...
@@ -66,12 +66,12 @@ class SlapOSApp(cliff.app.App):
kw
[
'argparse_kwargs'
][
'conflict_handler'
]
=
'resolve'
parser
=
super
(
SlapOSApp
,
self
).
build_option_parser
(
*
args
,
**
kw
)
# add
an alias for --log-file
# add
two aliases for --log-file (for compatibility with old commands)
parser
.
add_argument
(
'--log-file'
,
'--logfile'
,
'--log-file'
,
'--logfile'
,
'--log_file'
,
action
=
'store'
,
default
=
None
,
help
=
'Specify a file to log output.
Disabled
by default.'
,
help
=
'Specify a file to log output.
Only console
by default.'
,
)
# always show tracebacks on errors
...
...
slapos/cli/format.py
View file @
7009dddc
...
...
@@ -6,8 +6,6 @@ import sys
from
slapos.cli.config
import
ConfigCommand
from
slapos.format
import
do_format
,
FormatConfig
,
tracing_monkeypatch
,
UsageError
# XXX TODO: handle log_file (old) vs log-file (new)
class
FormatCommand
(
ConfigCommand
):
"""
...
...
@@ -27,9 +25,6 @@ class FormatCommand(ConfigCommand):
help
=
"Path to a JSON version of the computer's XML (for development only)."
,
default
=
None
)
ap
.
add_argument
(
'-l'
,
'--log_file'
,
help
=
"The path to the log file used by the script."
)
ap
.
add_argument
(
'-i'
,
'--input_definition_file'
,
help
=
"Path to file to read definition of computer instead of "
"declaration. Using definition file allows to disable "
...
...
@@ -67,7 +62,7 @@ class FormatCommand(ConfigCommand):
conf
.
mergeConfig
(
args
,
configp
)
if
not
arg
s
.
log_file
and
conf
.
log_file
:
if
not
self
.
app
.
option
s
.
log_file
and
conf
.
log_file
:
# no log file is provided by argparser,
# we set up the one from config
file_handler
=
logging
.
FileHandler
(
conf
.
log_file
)
...
...
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