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
9cf9b7b2
Commit
9cf9b7b2
authored
11 years ago
by
Bob Lantz
Browse files
Options
Downloads
Patches
Plain Diff
Clean things up slightly.
parent
1fda4865
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
mininet/clean.py
+11
-9
11 additions, 9 deletions
mininet/clean.py
with
11 additions
and
9 deletions
mininet/clean.py
+
11
−
9
View file @
9cf9b7b2
...
...
@@ -47,24 +47,26 @@ def cleanup():
cleanUpScreens
()
info
(
"
*** Removing excess kernel datapaths
\n
"
)
dps
=
sh
(
"
ps ax | egrep -o
'
dp[0-9]+
'
| sed
'
s/dp/nl:/
'"
).
split
(
'
\n
'
)
dps
=
sh
(
"
ps ax | egrep -o
'
dp[0-9]+
'
| sed
'
s/dp/nl:/
'"
).
split
lines
(
)
for
dp
in
dps
:
if
dp
!=
''
:
if
dp
:
sh
(
'
dpctl deldp
'
+
dp
)
info
(
"
*** Removing OVS datapaths
"
)
dps
=
sh
(
"
ovs-vsctl --timeout=1 list-br
"
).
split
(
'
\n
'
)
sh
(
"
ovs-vsctl
"
+
"
--
"
.
join
(
"
--if-exists del-br
"
+
dp
for
dp
in
dps
if
dp
)
)
dps
=
sh
(
"
ovs-vsctl --timeout=1 list-br
"
).
strip
().
splitlines
()
if
dps
:
sh
(
"
ovs-vsctl
"
+
"
--
"
.
join
(
"
--if-exists del-br
"
+
dp
for
dp
in
dps
if
dp
)
)
# And in case the above didn't work...
dps
=
sh
(
"
ovs-vsctl --timeout=1 list-br
"
).
s
plit
(
'
\n
'
)
dps
=
sh
(
"
ovs-vsctl --timeout=1 list-br
"
).
s
trip
().
splitlines
(
)
for
dp
in
dps
:
if
dp
:
sh
(
'
ovs-vsctl del-br
'
+
dp
)
sh
(
'
ovs-vsctl del-br
'
+
dp
)
info
(
"
*** Removing all links of the pattern foo-ethX
\n
"
)
links
=
sh
(
r
"
ip link show | egrep -o
'
([-_.[:alnum:]]+-eth[[:digit:]]+)
'"
).
split
(
'
\n
'
)
links
=
sh
(
"
ip link show |
"
"
egrep -o
'
([-_.[:alnum:]]+-eth[[:digit:]]+)
'"
).
splitlines
()
for
link
in
links
:
if
link
!=
''
:
if
link
:
sh
(
"
ip link del
"
+
link
)
info
(
"
*** Cleanup complete.
\n
"
)
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