Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mininet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Olaf Bergmann
mininet
Commits
bda2317d
Commit
bda2317d
authored
11 years ago
by
Brian O'Connor
Browse files
Options
Downloads
Patches
Plain Diff
Catching exceptions thrown in mn
parent
d5f57784
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/mn
+19
-2
19 additions, 2 deletions
bin/mn
with
19 additions
and
2 deletions
bin/mn
+
19
−
2
View file @
bda2317d
...
...
@@ -22,7 +22,7 @@ if 'PYTHONPATH' in os.environ:
from
mininet.clean
import
cleanup
from
mininet.cli
import
CLI
from
mininet.log
import
lg
,
LEVELS
,
info
from
mininet.log
import
lg
,
LEVELS
,
info
,
debug
,
error
from
mininet.net
import
Mininet
,
MininetWithControlNet
,
VERSION
from
mininet.node
import
(
Host
,
CPULimitedHost
,
Controller
,
OVSController
,
NOX
,
RemoteController
,
UserSwitch
,
OVSKernelSwitch
,
...
...
@@ -278,4 +278,21 @@ class MininetRunner( object ):
if
__name__
==
"
__main__
"
:
MininetRunner
()
try
:
MininetRunner
()
except
KeyboardInterrupt
:
info
(
"
Keyboard Interrupt. Shutting down and cleaning up...
"
)
cleanup
()
except
Exception
:
#Print exception
type_
,
val_
,
trace_
=
sys
.
exc_info
()
errorMsg
=
(
"
-
"
*
80
+
"
\n
"
+
"
Caught exception. Cleaning up...
\n\n
"
+
"
%s: %s
\n
"
%
(
type_
.
__name__
,
val_
)
+
"
-
"
*
80
+
"
\n
"
)
error
(
errorMsg
)
# Print stack trace to debug log
import
traceback
stackTrace
=
traceback
.
format_exc
()
debug
(
stackTrace
+
"
\n
"
)
cleanup
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment