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
876e66e5
Commit
876e66e5
authored
10 years ago
by
Rich Lane
Browse files
Options
Downloads
Patches
Plain Diff
net: allow batch shutdown of multiple types of switches
Each switch class will be called to shutdown its own instances.
parent
93cd5583
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mininet/net.py
+3
-4
3 additions, 4 deletions
mininet/net.py
mininet/node.py
+2
-3
2 additions, 3 deletions
mininet/node.py
with
5 additions
and
7 deletions
mininet/net.py
+
3
−
4
View file @
876e66e5
...
@@ -91,7 +91,7 @@
...
@@ -91,7 +91,7 @@
import
select
import
select
import
signal
import
signal
from
time
import
sleep
from
time
import
sleep
from
itertools
import
chain
from
itertools
import
chain
,
groupby
from
mininet.cli
import
CLI
from
mininet.cli
import
CLI
from
mininet.log
import
info
,
error
,
debug
,
output
from
mininet.log
import
info
,
error
,
debug
,
output
...
@@ -408,10 +408,9 @@ def stop( self ):
...
@@ -408,10 +408,9 @@ def stop( self ):
info
(
'
*** Stopping %i terms
\n
'
%
len
(
self
.
terms
)
)
info
(
'
*** Stopping %i terms
\n
'
%
len
(
self
.
terms
)
)
self
.
stopXterms
()
self
.
stopXterms
()
info
(
'
*** Stopping %i switches
\n
'
%
len
(
self
.
switches
)
)
info
(
'
*** Stopping %i switches
\n
'
%
len
(
self
.
switches
)
)
if
self
.
switches
:
for
swclass
,
switches
in
groupby
(
sorted
(
self
.
switches
,
key
=
type
),
type
):
swclass
=
type
(
self
.
switches
[
0
]
)
if
hasattr
(
swclass
,
'
batchShutdown
'
):
if
hasattr
(
swclass
,
'
batchShutdown
'
):
swclass
.
batchShutdown
(
self
.
switches
)
swclass
.
batchShutdown
(
switches
)
for
switch
in
self
.
switches
:
for
switch
in
self
.
switches
:
info
(
switch
.
name
+
'
'
)
info
(
switch
.
name
+
'
'
)
switch
.
stop
()
switch
.
stop
()
...
...
This diff is collapsed.
Click to expand it.
mininet/node.py
+
2
−
3
View file @
876e66e5
...
@@ -993,7 +993,7 @@ def batchShutdown( cls, switches ):
...
@@ -993,7 +993,7 @@ def batchShutdown( cls, switches ):
"
Call ovs-vsctl del-br on all OVSSwitches in a list
"
"
Call ovs-vsctl del-br on all OVSSwitches in a list
"
quietRun
(
'
ovs-vsctl
'
+
quietRun
(
'
ovs-vsctl
'
+
'
--
'
.
join
(
'
--if-exists del-br %s
'
%
s
'
--
'
.
join
(
'
--if-exists del-br %s
'
%
s
for
s
in
switches
if
type
(
s
)
==
cls
)
)
for
s
in
switches
)
)
def
dpctl
(
self
,
*
args
):
def
dpctl
(
self
,
*
args
):
"
Run ovs-ofctl command
"
"
Run ovs-ofctl command
"
...
@@ -1110,8 +1110,7 @@ def setup( cls ):
...
@@ -1110,8 +1110,7 @@ def setup( cls ):
def
batchShutdown
(
cls
,
switches
):
def
batchShutdown
(
cls
,
switches
):
"
Kill each IVS switch, to be waited on later in stop()
"
"
Kill each IVS switch, to be waited on later in stop()
"
for
switch
in
switches
:
for
switch
in
switches
:
if
type
(
switch
)
==
cls
:
switch
.
cmd
(
'
kill %ivs
'
)
switch
.
cmd
(
'
kill %ivs
'
)
def
start
(
self
,
controllers
):
def
start
(
self
,
controllers
):
"
Start up a new IVS switch
"
"
Start up a new IVS switch
"
...
...
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