aboutsummaryrefslogtreecommitdiff
path: root/rumba/prototypes/ouroboros.py
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2017-06-15 15:18:07 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2017-06-15 15:18:07 +0200
commite6574371755b029aaa35c20ea5a0214f75a8a258 (patch)
treec3b1b30b92bd2cb78f70868ce9bef7f7632d0169 /rumba/prototypes/ouroboros.py
parent020a36055abb64f611d2a06c006304e663b2661c (diff)
downloadrumba-e6574371755b029aaa35c20ea5a0214f75a8a258.tar.gz
rumba-e6574371755b029aaa35c20ea5a0214f75a8a258.zip
prototypes: ouroboros: use isinstance() rather than type()
This is convenient for compatibility between Python 2 and 3.
Diffstat (limited to 'rumba/prototypes/ouroboros.py')
-rw-r--r--rumba/prototypes/ouroboros.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/rumba/prototypes/ouroboros.py b/rumba/prototypes/ouroboros.py
index 9ac1425..4ad41c6 100644
--- a/rumba/prototypes/ouroboros.py
+++ b/rumba/prototypes/ouroboros.py
@@ -63,13 +63,13 @@ class Experiment(mod.Experiment):
else:
cmd = "irm i c n " + ipcp.name
- if type(ipcp.dif) is mod.ShimEthDIF:
+ if isinstance(ipcp.dif, mod.ShimEthDIF):
# NOTE: Here to test with fake testbed
if ipcp.ifname is None:
ipcp.ifname = "eth0"
cmd += " type shim-eth-llc if_name " + ipcp.ifname
cmd += " dif " + ipcp.dif.name
- elif type(ipcp.dif) is mod.NormalDIF:
+ elif isinstance(ipcp.dif, mod.NormalDIF):
cmd += " type normal"
if ipcp.dif_bootstrapper:
cmd += " dif " + ipcp.dif.name
@@ -83,7 +83,7 @@ class Experiment(mod.Experiment):
for dif_b in node.dif_registrations[ipcp.dif]:
cmd2 += " dif " + dif_b.name
cmds2.append(cmd2)
- elif type(ipcp.dif) is mod.ShimUDPDIF:
+ elif isinstance(ipcp.dif, mod.ShimUDPDIF):
# FIXME: Will fail, since we don't keep IPs yet
cmd += " type shim-udp"
cmd += " dif " + ipcp.dif.name