Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
7932260e
Commit
7932260e
authored
Nov 05, 2020
by
Antoine Kaufmann
Browse files
experiments: enforce unique names for simulators
parent
7d088ead
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
experiments/modes/experiments.py
experiments/modes/experiments.py
+9
-0
No files found.
experiments/modes/experiments.py
View file @
7932260e
...
@@ -18,12 +18,21 @@ class Experiment(object):
...
@@ -18,12 +18,21 @@ class Experiment(object):
self
.
networks
=
[]
self
.
networks
=
[]
def
add_host
(
self
,
sim
):
def
add_host
(
self
,
sim
):
for
h
in
self
.
hosts
:
if
h
.
name
==
sim
.
name
:
raise
Exception
(
'Duplicate host name'
)
self
.
hosts
.
append
(
sim
)
self
.
hosts
.
append
(
sim
)
def
add_nic
(
self
,
sim
):
def
add_nic
(
self
,
sim
):
for
n
in
self
.
nics
:
if
n
.
name
==
sim
.
name
:
raise
Exception
(
'Duplicate nic name'
)
self
.
nics
.
append
(
sim
)
self
.
nics
.
append
(
sim
)
def
add_network
(
self
,
sim
):
def
add_network
(
self
,
sim
):
for
n
in
self
.
networks
:
if
n
.
name
==
sim
.
name
:
raise
Exception
(
'Duplicate net name'
)
self
.
networks
.
append
(
sim
)
self
.
networks
.
append
(
sim
)
async
def
prepare
(
self
,
env
,
verbose
=
False
):
async
def
prepare
(
self
,
env
,
verbose
=
False
):
...
...
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