CI: Add CI_WIKI_NAME to all drivers

This patch adds a CI_WIKI_NAME to each driver object.  The value is the exact
name of the ThirdPartySystems wiki page.   This allows us to create an
automated tool to associated jobs to drivers and track their CI reporting
status correctly.

This patch also updates the generate_driver_list.py script to output the
driver list as a python list of dicts that can be directly consumed.

Change-Id: I0ec5f705e91f680a731648cf50738ea219565f70
This commit is contained in:
Walter A. Boring IV
2016-07-27 05:04:58 -07:00
parent 4559058147
commit 1a5de5d4bd
89 changed files with 311 additions and 14 deletions

View File

@@ -14,19 +14,29 @@
"""Generate list of cinder drivers"""
import argparse
import os
import sys
from cinder.interface import util
parser = argparse.ArgumentParser(prog="generate_driver_list")
parser.add_argument("--format", default='str', choices=['str', 'dict'],
help="Output format type")
# Keep backwards compatibilty with the gate-docs test
# The tests pass ['docs'] on the cmdln, but it's never been used.
parser.add_argument("output_list", default=None, nargs='?')
class Output(object):
def __init__(self, base_dir):
def __init__(self, base_dir, output_list):
# At this point we don't care what was passed in, just a trigger
# to write this out to the doc tree for now
self.driver_file = None
if len(sys.argv) > 1:
if output_list:
self.driver_file = open(
'%s/doc/source/drivers.rst' % base_dir, 'w+')
self.driver_file.write('===================\n')
@@ -67,25 +77,57 @@ def print_drivers(drivers, config_name, output):
output.write('')
def output_str(cinder_root, args):
with Output(cinder_root, args.output_list) as output:
output.write('Volume Drivers')
output.write('==============')
print_drivers(util.get_volume_drivers(), 'volume_driver', output)
output.write('Backup Drivers')
output.write('==============')
print_drivers(util.get_backup_drivers(), 'backup_driver', output)
output.write('FC Zone Manager Drivers')
output.write('=======================')
print_drivers(util.get_fczm_drivers(), 'zone_driver', output)
def collect_driver_info(driver):
"""Build the dictionary that describes this driver."""
info = {'name': driver.class_name,
'version': driver.version,
'fqn': driver.class_fqn,
'description': driver.desc,
'ci_wiki_name': driver.ci_wiki_name}
return info
def output_dict():
import pprint
driver_list = []
drivers = util.get_volume_drivers()
for driver in drivers:
driver_list.append(collect_driver_info(driver))
pprint.pprint(driver_list)
def main():
tools_dir = os.path.dirname(os.path.abspath(__file__))
cinder_root = os.path.dirname(tools_dir)
cur_dir = os.getcwd()
os.chdir(cinder_root)
args = parser.parse_args()
try:
with Output(cinder_root) as output:
output.write('Volume Drivers')
output.write('==============')
print_drivers(util.get_volume_drivers(), 'volume_driver', output)
if args.format == 'str':
output_str(cinder_root, args)
elif args.format == 'dict':
output_dict()
output.write('Backup Drivers')
output.write('==============')
print_drivers(util.get_backup_drivers(), 'backup_driver', output)
output.write('FC Zone Manager Drivers')
output.write('=======================')
print_drivers(util.get_fczm_drivers(), 'zone_driver', output)
finally:
os.chdir(cur_dir)