aboutsummaryrefslogtreecommitdiff
path: root/rumba/prototypes/rlite.py
diff options
context:
space:
mode:
authorVincenzo Maffione <v.maffione@gmail.com>2017-06-15 14:56:49 +0200
committerVincenzo Maffione <v.maffione@gmail.com>2017-06-15 15:00:52 +0200
commit020a36055abb64f611d2a06c006304e663b2661c (patch)
tree3a970e9f8f38fe991227c35b267983ef8c472bcb /rumba/prototypes/rlite.py
parent651f22533b498bc7c91078820dd2155e351d523e (diff)
downloadrumba-020a36055abb64f611d2a06c006304e663b2661c.tar.gz
rumba-020a36055abb64f611d2a06c006304e663b2661c.zip
prototypes: rlite: use isinstance() rather than type()
This is convenient for compatibility between Python 2 and 3.
Diffstat (limited to 'rumba/prototypes/rlite.py')
-rw-r--r--rumba/prototypes/rlite.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/rumba/prototypes/rlite.py b/rumba/prototypes/rlite.py
index cc38255..abab080 100644
--- a/rumba/prototypes/rlite.py
+++ b/rumba/prototypes/rlite.py
@@ -70,11 +70,11 @@ class Experiment(mod.Experiment):
for ipcp in node.ipcps:
# Generate the command to create the IPCP
- if type(ipcp.dif) is mod.NormalDIF:
+ if isinstance(ipcp.dif, mod.NormalDIF):
ipcp_type = 'normal'
- elif type(ipcp.dif) is mod.ShimEthDIF:
+ elif isinstance(ipcp.dif, mod.ShimEthDIF):
ipcp_type = 'shim-eth'
- elif type(ipcp.dif) is mod.ShimUDPDIF:
+ elif isinstance(ipcp.dif, mod.ShimUDPDIF):
ipcp_type = 'shim-udp4'
else:
logger.warning(
@@ -87,7 +87,7 @@ class Experiment(mod.Experiment):
# Generate the command to configure the interface
# name for the shim-eth
- if type(ipcp.dif) is mod.ShimEthDIF:
+ if isinstance(ipcp.dif, mod.ShimEthDIF):
cmds.append("rlite-ctl ipcp-config %s netdev %s"
% (ipcp.name, ipcp.ifname))