-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathcv_manager.py
More file actions
executable file
·57 lines (45 loc) · 1.67 KB
/
cv_manager.py
File metadata and controls
executable file
·57 lines (45 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python3
import sys
import os
import importlib
import argparse
if sys.version_info[0] != 3:
print("This script requires Python 3")
exit(1)
sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../")))
cv_test_manager = importlib.import_module("py-json.cv_test_manager")
cv_test = cv_test_manager.cv_test
class CVManager(cv_test):
def __init__(self,
scenario=None,
debug=False,
lfclient_host='localhost'):
self.scenario = scenario
self.debug = debug
self.exit_on_error = False
self.lfclient_host = lfclient_host
def apply_and_build_scenario(self):
self.apply_cv_scenario(self.scenario)
self.build_cv_scenario()
def main():
parser = argparse.ArgumentParser(
prog='cv_manager.py',
formatter_class=argparse.RawTextHelpFormatter,
description='''This is a simple driver script to load a CV Scenario''')
parser.add_argument('--scenario', help='Scenario you wish to build')
parser.add_argument('--debug', help='Enable debugging', default=False, action="store_true")
parser.add_argument('--mgr', default='localhost')
parser.add_argument('--help_summary', action="store_true", help='Show summary of what this script does')
args = parser.parse_args()
help_summary = '''\
cv_manager.py is a simple driver script to load a CV Scenario'
'''
if args.help_summary:
print(help_summary)
exit(0)
manager = CVManager(scenario=args.scenario,
debug=args.debug,
lfclient_host=args.mgr)
manager.apply_and_build_scenario()
if __name__ == "__main__":
main()