diff options
author | Marco Capitani <m.capitani@nextworks.it> | 2017-04-13 09:45:51 +0200 |
---|---|---|
committer | Marco Capitani <m.capitani@nextworks.it> | 2017-04-13 10:03:59 +0200 |
commit | a08e4f5ff3809eec923dbe9441bf433cef8b6dd4 (patch) | |
tree | d8bf869c5f11a696dc5fefd8b4aa448d36d3f46d /tools | |
parent | 498867d685f54b3e64ba4538c8d06e49d464f855 (diff) | |
download | rumba-a08e4f5ff3809eec923dbe9441bf433cef8b6dd4.tar.gz rumba-a08e4f5ff3809eec923dbe9441bf433cef8b6dd4.zip |
Tester finishing touches: code cleanup and used choices.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/democonf2rumba.py | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/tools/democonf2rumba.py b/tools/democonf2rumba.py index 549c540..383268c 100755 --- a/tools/democonf2rumba.py +++ b/tools/democonf2rumba.py @@ -127,6 +127,20 @@ def make_experiment(filename, experiment_class, experiment_kwargs, return experiment_class(**experiment_kwargs).run() +def setup_testbed_common_args(t_p): + + t_p.add_argument('-E', '--exp_name', metavar='EXP_NAME', type=str, + required=True, + help='Experiment name') + t_p.add_argument('-U', '--username', metavar='USERNAME', type=str, + required=True, + help='Testbed user name') + t_p.add_argument('-P', '--proj_name', metavar='PROJECT_NAME', type=str, + help='Project name') + t_p.add_argument('-W', '--password', metavar='PASSWORD', type=str, + help='Testbed password') + + if __name__ == '__main__': description = "Demonstrator config file to rumba script converter" epilog = "2017 Marco Capitani <m.capitani@nextworks.it>" @@ -134,10 +148,10 @@ if __name__ == '__main__': parser = argparse.ArgumentParser(description=description, epilog=epilog) - prototype = parser.add_mutually_exclusive_group(required=True) - prototype.add_argument('--irati', action='store_true', default=False) - prototype.add_argument('--ouroboros', action='store_true', default=False) - prototype.add_argument('--rlite', action='store_true', default=False) + parser.add_argument('-P', '--prototype', type=str, required=True, + choices=['irati', 'ouroboros', 'rlite'], + help='The kind of prototype plugin to use to run' + ' the experiment.') parser.add_argument('--config', metavar='CONFIG', type=str, required=True, @@ -149,19 +163,6 @@ if __name__ == '__main__': qemu_p = subparsers.add_parser('qemu', help='Use qemu testbed') fake_p = subparsers.add_parser('fake', help='Use fake testbed') - def setup_testbed_common_args(t_p): - - t_p.add_argument('-E', '--exp_name', metavar='EXP_NAME', type=str, - required=True, - help='Experiment name') - t_p.add_argument('-U', '--username', metavar='USERNAME', type=str, - required=True, - help='Testbed user name') - t_p.add_argument('-P', '--proj_name', metavar='PROJECT_NAME', type=str, - help='Project name') - t_p.add_argument('-W', '--password', metavar='PASSWORD', type=str, - help='Testbed password') - for t in [emulab_p, jfed_p, qemu_p, fake_p]: setup_testbed_common_args(t) |