aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Capitani <m.capitani@nextworks.it>2017-06-15 14:07:19 +0200
committerMarco Capitani <m.capitani@nextworks.it>2017-06-15 14:07:19 +0200
commitac824c787d5805b21616a1d433d4156baccf2a9c (patch)
treebcd59ad159a916e5546abd58df7894a151ce9ee1
parent84978da12c1d857aaa8e64129d634ebd5270f100 (diff)
downloadrumba-ac824c787d5805b21616a1d433d4156baccf2a9c.tar.gz
rumba-ac824c787d5805b21616a1d433d4156baccf2a9c.zip
jFed: added backoff; model: fix for rumba-access
+ added 2 seconds sleep after jfed cli returns to avoid calling not-yet-ready nodes. + moved ssh_info to tools/ folder i.e. where rumba-access assumes it is.
-rw-r--r--rumba/model.py2
-rw-r--r--rumba/testbeds/jfed.py14
2 files changed, 13 insertions, 3 deletions
diff --git a/rumba/model.py b/rumba/model.py
index 9818ac7..352c120 100644
--- a/rumba/model.py
+++ b/rumba/model.py
@@ -522,7 +522,7 @@ class Experiment:
break
def dump_ssh_info(self):
- f = open('ssh_info', 'w')
+ f = open('tools/ssh_info', 'w')
for node in self.nodes:
f.write("%s;%s;%s;%s;%s\n" % (node.name,
self.testbed.username,
diff --git a/rumba/testbeds/jfed.py b/rumba/testbeds/jfed.py
index 83fbce7..e158048 100644
--- a/rumba/testbeds/jfed.py
+++ b/rumba/testbeds/jfed.py
@@ -22,6 +22,8 @@ import subprocess
import getpass
import xml.dom.minidom as xml
import os.path
+
+import time
import wget
import tarfile
@@ -173,6 +175,9 @@ class Testbed(mod.Testbed):
dir_path = os.path.dirname(os.path.abspath(__file__))
# Complete details of the nodes after swapin
+ logger.info("Sleeping for two seconds to avoid contacting jfed nodes "
+ "too soon.")
+ time.sleep(2)
for xml_node in xml_nodes:
n_name = xml_node.getAttribute("client_id")
intfs = xml_node.getElementsByTagName("interface")
@@ -215,8 +220,13 @@ class Testbed(mod.Testbed):
if isinstance(ipcp, mod.ShimEthIPCP):
if self.if_id[ipcp] == i_name:
ipcp.ifname = ifname
- logger.debug("Node %s interface %s has name %s."
- % (node_n.name, mac, ifname))
+ if ifname is None:
+ logger.error("Could not determine name of node"
+ "%s interface %s"
+ % (node_n.name, mac))
+ else:
+ logger.debug("Node %s interface %s has name %s."
+ % (node_n.name, mac, ifname))
# comp_id = intf.getAttribute("component_id")
# comp_arr = comp_id.split(":")
# ipcp.ifname = comp_arr[-1]