26e8c8bb01ba9414f7f3d55b051764215158a770
[releng.git] / utils / test / reporting / yardstick / scenarios.py
1 #!/usr/bin/python
2 #
3 # This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 import requests
10 import yaml
11
12 import utils.reporting_utils as rp_utils
13
14 yardstick_conf = rp_utils.get_config('yardstick.test_conf')
15 response = requests.get(yardstick_conf)
16 yaml_file = yaml.safe_load(response.text)
17 reporting = yaml_file.get('reporting')
18
19 config = {}
20
21 for element in reporting:
22     name = element['name']
23     scenarios = element['scenario']
24     for s in scenarios:
25         if name not in config:
26             config[name] = {}
27         config[name][s] = True