aboutsummaryrefslogtreecommitdiff
path: root/rumba/prototypes/rlite.py
diff options
context:
space:
mode:
authorVincenzo Maffione <v.maffione@gmail.com>2017-04-13 23:05:56 +0200
committerVincenzo Maffione <v.maffione@gmail.com>2017-04-13 23:05:56 +0200
commitc807556fcd39085c66136a8a628c60ea67f5d852 (patch)
tree9ac5aa4af603fcda4afd94baa34e96168e4737e0 /rumba/prototypes/rlite.py
parent3ad4844b0c289dbf08c7ee5287d6fe42effc8e91 (diff)
downloadrumba-c807556fcd39085c66136a8a628c60ea67f5d852.tar.gz
rumba-c807556fcd39085c66136a8a628c60ea67f5d852.zip
prototype: rlite: add execute_commands() method to reuse code
Diffstat (limited to 'rumba/prototypes/rlite.py')
-rw-r--r--rumba/prototypes/rlite.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/rumba/prototypes/rlite.py b/rumba/prototypes/rlite.py
index e1e3729..25ae943 100644
--- a/rumba/prototypes/rlite.py
+++ b/rumba/prototypes/rlite.py
@@ -1,7 +1,7 @@
#
# Commands to setup and instruct rlite
#
-# Vincenzo Maffione <v.maffione@nextworks.it>
+# Author: Vincenzo Maffione <v.maffione@nextworks.it>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -22,11 +22,16 @@ import rumba.ssh_support as ssh
import rumba.model as mod
import time
-# An experiment over the RLITE implementation
+# An experiment over the rlite implementation
class Experiment(mod.Experiment):
+
def __init__(self, testbed, nodes=None):
mod.Experiment.__init__(self, testbed, nodes)
+ def execute_commands(self, node, cmds):
+ ssh.execute_commands(self.testbed, node.ssh_config,
+ cmds, time_out=None)
+
def init(self):
cmds = []
@@ -50,8 +55,7 @@ class Experiment(mod.Experiment):
cmds.append("rlite-uipcps -v DBG -k 0 &> uipcp.log &")
for node in self.nodes:
- ssh.execute_commands(self.testbed, node.ssh_config,
- cmds, time_out=None)
+ self.execute_commands(node, cmds)
def create_ipcps(self):
for node in self.nodes:
@@ -79,8 +83,7 @@ class Experiment(mod.Experiment):
cmds.append("rlite-ctl ipcp-config %s netdev %s" \
% (ipcp.name, ipcp.ifname))
- ssh.execute_commands(self.testbed, node.ssh_config, cmds,
- time_out = None)
+ self.execute_commands(node, cmds)
def register_ipcps(self):
for node in self.nodes:
@@ -91,8 +94,7 @@ class Experiment(mod.Experiment):
cmds.append("rlite-ctl ipcp-register %s %s" \
% (ipcp.name, lower.name))
- ssh.execute_commands(self.testbed, node.ssh_config, cmds,
- time_out = None)
+ self.execute_commands(node, cmds)
def run_prototype(self):
print("rlite: setting up")