diff --git a/tools/generate_driver_list.py b/tools/generate_driver_list.py index 23811001737..0d8518b1ed5 100755 --- a/tools/generate_driver_list.py +++ b/tools/generate_driver_list.py @@ -16,6 +16,7 @@ import argparse import os +import json from cinder.interface import util from cinder import objects @@ -118,14 +119,14 @@ def collect_driver_info(driver): def output_dict(): + """Output the results as a json 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) + print(json.dumps(driver_list)) def main():