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
Paul Graydon
slapos.core
Commits
cc202553
Commit
cc202553
authored
May 07, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not suppress exceptions in run_subcommand()
parent
a110d1f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
5 deletions
+29
-5
slapos/cli/entry.py
slapos/cli/entry.py
+29
-5
No files found.
slapos/cli/entry.py
View file @
cc202553
...
...
@@ -94,16 +94,40 @@ class SlapOSApp(cliff.app.App):
if
err
:
self
.
log
.
debug
(
'got an error: %s'
,
err
)
def
run
(
self
,
argv
):
# same as cliff.App.run except that it won't re-raise
# a logged exception
try
:
self
.
options
,
remainder
=
self
.
parser
.
parse_known_args
(
argv
)
self
.
configure_logging
()
self
.
interactive_mode
=
not
remainder
self
.
initialize_app
(
remainder
)
except
Exception
as
err
:
if
hasattr
(
self
,
'options'
):
debug
=
self
.
options
.
debug
else
:
debug
=
True
if
debug
:
LOG
.
exception
(
err
)
# XXX change from cliff behaviour: avoid
# displaying the exception twice
# raise
else
:
LOG
.
error
(
err
)
return
1
result
=
1
if
self
.
interactive_mode
:
result
=
self
.
interact
()
else
:
result
=
self
.
run_subcommand
(
remainder
)
return
result
def
main
(
argv
=
sys
.
argv
[
1
:]):
app
=
SlapOSApp
()
if
not
argv
:
argv
=
[
'-h'
]
try
:
return
app
.
run
(
argv
)
except
Exception
as
exc
:
# exception has already been printed to the console by the logger.
return
1
return
app
.
run
(
argv
)
if
__name__
==
'__main__'
:
...
...
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