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. Change-Id: I7574c6eefddb8f085422387f9d4892b8dbe9977d
This commit is contained in:
parent
693ced05f5
commit
76304ef091
@ -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():
|
||||
|
Loading…
Reference in New Issue
Block a user