aboutsummaryrefslogtreecommitdiff
path: root/tools/democonf2rumba.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/democonf2rumba.py')
-rwxr-xr-xtools/democonf2rumba.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/democonf2rumba.py b/tools/democonf2rumba.py
index 9d909c7..a73d6b7 100755
--- a/tools/democonf2rumba.py
+++ b/tools/democonf2rumba.py
@@ -4,10 +4,11 @@ import argparse
import re
import rumba.model as mod
+import rumba.log as log
def make_experiment(filename, experiment_class, experiment_kwargs,
- testbed_class, testbed_kwargs):
+ testbed_class, testbed_kwargs, verbosity):
"""
:type filename str
:param filename: path to the .conf file
@@ -118,6 +119,8 @@ def make_experiment(filename, experiment_class, experiment_kwargs,
.items()}
parsed_nodes.append(mod.Node(name, difs, dif_registrations))
+ log.set_logging_level(verbosity)
+
testbed = testbed_class(**testbed_kwargs)
experiment_kwargs['testbed'] = testbed
@@ -161,6 +164,12 @@ if __name__ == '__main__':
required=True,
help='Path to the config file to parse')
+ parser.add_argument(
+ '--verbosity', metavar='VERBOSITY', type=str,
+ default='INFO',
+ choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'],
+ help='Path to the config file to parse')
+
subparsers = parser.add_subparsers(dest='testbed')
emulab_p = subparsers.add_parser('emulab', help='Use emulab testbed')
jfed_p = subparsers.add_parser('jfed', help='Use jfed testbed')
@@ -254,7 +263,8 @@ if __name__ == '__main__':
experiment_class=exp_class,
experiment_kwargs={},
testbed_class=test_class,
- testbed_kwargs=testbed_args)
+ testbed_kwargs=testbed_args,
+ verbosity=args.verbosity)
except KeyboardInterrupt:
print("Interrupted. Closing down.")