From f5f9fba3d6b657fd5daa31e4981c055a05c596e8 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Tue, 11 Apr 2017 19:12:53 +0200 Subject: ssh_support: Pass SSHConfig instead of only hostname Only the hostname was passed to the ssh_support component. This passes an object that can also hold the port number. It can be extended to take other things as well, such as a proxy. --- rumba/model.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'rumba/model.py') diff --git a/rumba/model.py b/rumba/model.py index faf353c..5ec36cc 100644 --- a/rumba/model.py +++ b/rumba/model.py @@ -125,6 +125,13 @@ class NormalDIF(DIF): s += "\n Component %s has policy %s" % (comp, pol) return s +# SSH Configuration +# +class SSHConfig: + def __init__(self, hostname, port=22): + self.hostname = hostname + self.port = port + # A node in the experiment # # @difs: DIFs the node will have an IPCP in @@ -150,7 +157,7 @@ class Node: if bindings is None: bindings = dict() self.bindings = bindings - self.full_name = name + self.ssh_config = SSHConfig(name) self.ipcps = [] self._validate() @@ -313,10 +320,10 @@ class Experiment: @staticmethod def from_config_file(testbed, filename='demo.conf'): """ - :type testbed: Testbed + :type testbed: Testbed :rtype: Experiment :param testbed: the testbed for the experiment - :param filename: name of the .conf file + :param filename: name of the .conf file :return: an Experiment object """ @@ -624,4 +631,3 @@ class Experiment: finally: # No matter what happens, undo the testbed (testbed-specific) self.testbed.swap_out(self) - -- cgit v1.2.3