diff options
author | Marco Capitani <[email protected]> | 2017-09-18 11:43:06 +0200 |
---|---|---|
committer | Marco Capitani <[email protected]> | 2017-09-18 11:43:06 +0200 |
commit | 055453d46e760ae27a8f0d108c191b3b0d1c88a2 (patch) | |
tree | 7dc3919833060545b79163b06e148e9f110857d4 | |
parent | 2f160576cf94a5aaadf87c84d5e4153549acffaa (diff) | |
download | rumba-055453d46e760ae27a8f0d108c191b3b0d1c88a2.tar.gz rumba-055453d46e760ae27a8f0d108c191b3b0d1c88a2.zip |
IRATI: fix for variable installpath
-rw-r--r-- | rumba/prototypes/irati.py | 27 | ||||
-rw-r--r-- | rumba/prototypes/irati_templates.py | 4 |
2 files changed, 18 insertions, 13 deletions
diff --git a/rumba/prototypes/irati.py b/rumba/prototypes/irati.py index 48b013a..eebabc1 100644 --- a/rumba/prototypes/irati.py +++ b/rumba/prototypes/irati.py @@ -52,8 +52,14 @@ class Experiment(mod.Experiment): def fake_sudo(s): return s - def __init__(self, testbed, nodes=None): + def __init__(self, testbed, nodes=None, installpath=None, varpath=None): mod.Experiment.__init__(self, testbed, nodes) + if installpath is None: + installpath = '/usr' + if varpath is None: + varpath = '' + irati_templates.env_dict['installpath'] = installpath + irati_templates.env_dict['varpath'] = varpath self.manager = False self.conf_files = None self.shim2vlan = {} @@ -76,22 +82,19 @@ class Experiment(mod.Experiment): def install(self): """Installs IRATI on the nodes.""" cmds = [self.sudo("apt-get update"), - "export https_proxy=\"https://proxy.atlantis.ugent.be:8080\"; " - + self.sudo("apt-get install g++ gcc " - "protobuf-compiler libprotobuf-dev git --yes " - "pkg-config ethtool socat " - "libnl-3-dev libnl-genl-3-dev"), + self.sudo("apt-get install g++ gcc " + "protobuf-compiler libprotobuf-dev git --yes " + "pkg-config " + "libnl-3-dev libnl-genl-3-dev"), self.sudo("rm -rf ~/irati"), - "cd ~; " - "export https_proxy=\"https://proxy.atlantis.ugent.be:8080\"; " - + "git clone https://github.com/IRATI/stack irati", + "cd ~; git clone https://github.com/IRATI/stack irati", "cd ~/irati && git checkout arcfire", "cd ~/irati && " + self.sudo("./install-from-scratch")] for node in self.nodes: ssh.execute_proxy_commands(self.testbed, node.ssh_config, - cmds, time_out=None) + cmds, time_out=None) def bootstrap_network(self): """Creates the network by enrolling and configuring the nodes""" @@ -255,7 +258,7 @@ class Experiment(mod.Experiment): if self.manager: # Add MAD/Manager configuration - irati_templates.ipcmconf_base["addons"] = { + irati_templates.get_ipcmconf_base()["addons"] = { "mad": { "managerAppName": "", "NMSDIFs": [{"DIF": "%s" % mgmt_dif_name}], @@ -270,7 +273,7 @@ class Experiment(mod.Experiment): for node in self.nodes: # type: mod.Node node2id_map[node.name] = node_number node_number += 1 - ipcmconfs[node.name] = copy.deepcopy(irati_templates.ipcmconf_base) + ipcmconfs[node.name] = copy.deepcopy(irati_templates.get_ipcmconf_base()) if self.manager: ipcmconfs[node.name]["addons"]["mad"]["managerAppName"] \ = "%s.mad-1--" % (node.name,) diff --git a/rumba/prototypes/irati_templates.py b/rumba/prototypes/irati_templates.py index 0b2b40d..c94de92 100644 --- a/rumba/prototypes/irati_templates.py +++ b/rumba/prototypes/irati_templates.py @@ -26,8 +26,10 @@ # Environment setup for VMs. Standard linux approach env_dict = {'installpath': '/usr', 'varpath': ''} + # Template for a IPCM configuration file -ipcmconf_base = { +def get_ipcmconf_base(): + return { "configFileVersion": "1.4.1", "localConfiguration": { "installationPath": "%(installpath)s/bin" % env_dict, |