Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hp4-src
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
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
David Hancock
hp4-src
Commits
65347e74
Commit
65347e74
authored
6 years ago
by
David Hancock
Browse files
Options
Downloads
Patches
Plain Diff
Add capability: run mn script at startup
parent
631f2741
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mininet/topo.py
+16
-0
16 additions, 0 deletions
mininet/topo.py
with
16 additions
and
0 deletions
mininet/topo.py
+
16
−
0
View file @
65347e74
...
...
@@ -29,6 +29,7 @@ import subprocess
import
random
import
code
# code.interact(local=dict(globals(), **locals()))
_THIS_DIR
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
_THRIFT_BASE_PORT
=
22222
...
...
@@ -219,6 +220,21 @@ def main():
if
args
.
pre
:
print
(
"
script:
"
+
args
.
pre
)
with
open
(
args
.
pre
,
"
r
"
)
as
f
:
for
cmd
in
f
:
print
cmd
try
:
n
=
net
.
get
(
cmd
.
split
()[
0
])
tokens
=
cmd
.
split
()[
1
:]
newcmd
=
[]
for
token
in
tokens
:
if
token
in
net
.
keys
():
newcmd
.
append
(
net
.
get
(
token
).
intf
().
ip
)
else
:
newcmd
.
append
(
token
)
print
n
.
cmd
(
'
'
.
join
(
newcmd
))
except
Exception
as
e
:
print
e
print
"
Ready !
"
...
...
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