scripts/config_converter: remove always empty subsystems
JSON configuration that does not contain a particular subsystem is a valid one. If needed, the defaults are always present in the subsystem itself. accel, interface, net_framework, scsi, nbd do not have legacy configuration to convert. Including those in the output of config_converter does not serve any purpose. Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Change-Id: I6442ac1b8f65ac7271102e782068846f86c2d09f Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5878 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Reviewed-by: Michal Berger <michalx.berger@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: <dongx.yi@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
5ef79a17ec
commit
25b3a770bd
@ -35,13 +35,8 @@ nvmf_dict["subsystems"] = []
|
||||
|
||||
# dictionary with new config that will be written to new json config file
|
||||
subsystem = {
|
||||
"accel": None,
|
||||
"interface": None,
|
||||
"net_framework": None,
|
||||
"bdev": bdev_dict,
|
||||
"scsi": [],
|
||||
"nvmf": nvmf_dict,
|
||||
"nbd": [],
|
||||
"vhost": vhost_dict,
|
||||
"iscsi": iscsi_dict
|
||||
}
|
||||
@ -60,32 +55,23 @@ no_yes_map = {"no": False, "No": False, "Yes": True, "yes": True}
|
||||
|
||||
def generate_new_json_config():
|
||||
json_subsystem = [
|
||||
{'subsystem': "accel", 'config': None},
|
||||
{"subsystem": "interface", "config": None},
|
||||
{"subsystem": "net_framework", "config": None},
|
||||
{"subsystem": "bdev", "config": []},
|
||||
{"subsystem": "scsi", "config": None},
|
||||
{"subsystem": "nvmf", "config": []},
|
||||
{"subsystem": "nbd", "config": []},
|
||||
{"subsystem": "vhost", "config": []},
|
||||
{"subsystem": "iscsi", "config": []}
|
||||
]
|
||||
for method in subsystem['bdev']:
|
||||
for item in subsystem['bdev'][method]:
|
||||
json_subsystem[3]['config'].append(item)
|
||||
for item in subsystem['scsi']:
|
||||
if json_subsystem[4]['config'] is None:
|
||||
json_subsystem[4]['config'] = []
|
||||
json_subsystem[4]['config'].append(item)
|
||||
json_subsystem[0]['config'].append(item)
|
||||
for method in subsystem['nvmf']:
|
||||
for item in subsystem['nvmf'][method]:
|
||||
json_subsystem[5]['config'].append(item)
|
||||
json_subsystem[1]['config'].append(item)
|
||||
for method in subsystem['vhost']:
|
||||
for item in subsystem['vhost'][method]:
|
||||
json_subsystem[7]['config'].append(item)
|
||||
json_subsystem[2]['config'].append(item)
|
||||
for method in subsystem['iscsi']:
|
||||
for item in subsystem['iscsi'][method]:
|
||||
json_subsystem[8]['config'].append(item)
|
||||
json_subsystem[3]['config'].append(item)
|
||||
|
||||
return {"subsystems": json_subsystem}
|
||||
|
||||
|
@ -1,17 +1,5 @@
|
||||
{
|
||||
"subsystems": [
|
||||
{
|
||||
"subsystem": "accel",
|
||||
"config": null
|
||||
},
|
||||
{
|
||||
"subsystem": "interface",
|
||||
"config": null
|
||||
},
|
||||
{
|
||||
"subsystem": "net_framework",
|
||||
"config": null
|
||||
},
|
||||
{
|
||||
"subsystem": "bdev",
|
||||
"config": [
|
||||
@ -168,10 +156,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"subsystem": "scsi",
|
||||
"config": null
|
||||
},
|
||||
{
|
||||
"subsystem": "nvmf",
|
||||
"config": [
|
||||
@ -306,10 +290,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"subsystem": "nbd",
|
||||
"config": []
|
||||
},
|
||||
{
|
||||
"subsystem": "vhost",
|
||||
"config": [
|
||||
|
@ -1,17 +1,5 @@
|
||||
{
|
||||
"subsystems": [
|
||||
{
|
||||
"subsystem": "accel",
|
||||
"config": null
|
||||
},
|
||||
{
|
||||
"subsystem": "interface",
|
||||
"config": null
|
||||
},
|
||||
{
|
||||
"subsystem": "net_framework",
|
||||
"config": null
|
||||
},
|
||||
{
|
||||
"subsystem": "bdev",
|
||||
"config": [
|
||||
@ -74,10 +62,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"subsystem": "scsi",
|
||||
"config": null
|
||||
},
|
||||
{
|
||||
"subsystem": "nvmf",
|
||||
"config": [
|
||||
@ -95,10 +79,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"subsystem": "nbd",
|
||||
"config": []
|
||||
},
|
||||
{
|
||||
"subsystem": "vhost",
|
||||
"config": []
|
||||
|
Loading…
Reference in New Issue
Block a user