diff options
author | Marco Capitani <m.capitani@nextworks.it> | 2017-04-28 12:04:44 +0200 |
---|---|---|
committer | Marco Capitani <m.capitani@nextworks.it> | 2017-04-28 12:13:31 +0200 |
commit | da965f80da37c2b775e1e62e469589a3be05da30 (patch) | |
tree | 0fcf67801b9417b572c18a5892b76ad4fef50926 | |
parent | 200e920ec04164ed3d96f034082efd9464287f7a (diff) | |
download | rumba-da965f80da37c2b775e1e62e469589a3be05da30.tar.gz rumba-da965f80da37c2b775e1e62e469589a3be05da30.zip |
ssh_support: added proxy_command to copy path to testbed
other:
fix to democonf2rumba jfed arguments
-rw-r--r-- | rumba/ssh_support.py | 8 | ||||
-rwxr-xr-x | tools/democonf2rumba.py | 17 |
2 files changed, 20 insertions, 5 deletions
diff --git a/rumba/ssh_support.py b/rumba/ssh_support.py index 26d64fb..cb36910 100644 --- a/rumba/ssh_support.py +++ b/rumba/ssh_support.py @@ -160,6 +160,11 @@ def copy_paths_to_testbed(testbed, ssh_config, paths, destination): """ ssh_client = get_ssh_client() + if ssh_config.proxycommand is not None: + proxy = paramiko.ProxyCommand(ssh_config.proxycommand) + else: + proxy = None + if destination is not '' and not destination.endswith('/'): destination = destination + '/' @@ -167,7 +172,8 @@ def copy_paths_to_testbed(testbed, ssh_config, paths, destination): ssh_client.connect(ssh_config.hostname, ssh_config.port, testbed.username, testbed.password, - look_for_keys=True) + look_for_keys=True, + sock=proxy) sftp_client = ssh_client.open_sftp() diff --git a/tools/democonf2rumba.py b/tools/democonf2rumba.py index a73d6b7..9c6d64f 100755 --- a/tools/democonf2rumba.py +++ b/tools/democonf2rumba.py @@ -24,6 +24,8 @@ def make_experiment(filename, experiment_class, experiment_kwargs, difs = {} print('Reading file %s.' % (filename,)) + print('+++++++++++++++++++') + print() with open(filename, 'r') as conf: @@ -120,6 +122,12 @@ def make_experiment(filename, experiment_class, experiment_kwargs, parsed_nodes.append(mod.Node(name, difs, dif_registrations)) log.set_logging_level(verbosity) + print() + print('++++++++++++++++++++') + print('Calling constructor of testbed %s with args %s.' + % (testbed_class, testbed_kwargs)) + print('++++++++++++++++++++') + print() testbed = testbed_class(**testbed_kwargs) @@ -130,6 +138,7 @@ def make_experiment(filename, experiment_class, experiment_kwargs, try: exp.swap_in() exp.bootstrap_prototype() + input("Press ENTER to quit") finally: exp.swap_out() @@ -200,14 +209,14 @@ if __name__ == '__main__': jfed_p.add_argument('-C', '--cert_file', metavar='CERT', type=str, required=True, help='Certificate file') - jfed_p.add_argument('-J', '--jar', metavar='JAR', type=str, - required=True, - help='Jfed jar') - jfed_p.add_argument('-H', '--exp_hours', metavar='HOURS', type=int, + jfed_p.add_argument('-H', '--exp_hours', metavar='HOURS', type=str, default=2, help='Experiment hours') jfed_p.add_argument('-A', '--authority', metavar='AUTH', type=str, default="wall2.ilabt.iminds.be", help='Authority') + jfed_p.add_argument('-I', '--image', metavar='IMAGE', type=str, + default=None, + help='Image to be used') args = parser.parse_args() |