Output the driver info as json
This patch fixes the output of the dict format to json, so it can be
consumed a bit easier.
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():
