rpc/load_config: handle empty config

Subsystems should be started anyway when empty configuration is
provided.

Change-Id: Iabc85d319b11d19be7ec182d1f6fa4f40eacf7e2
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/432552
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Pawel Wodkowski 2018-11-09 13:21:34 +01:00 committed by Jim Harris
parent ef7a97de6a
commit 1906a14e1f

View File

@ -85,6 +85,10 @@ def load_config(client, fd):
# check if methods in the config file are known
allowed_methods = client.call('get_rpc_methods')
if not subsystems and 'start_subsystem_init' in allowed_methods:
start_subsystem_init(client)
return
for subsystem in list(subsystems):
config = subsystem['config']
for elem in list(config):
@ -109,7 +113,7 @@ def load_config(client, fd):
subsystems.remove(subsystem)
if 'start_subsystem_init' in allowed_methods:
client.call('start_subsystem_init')
start_subsystem_init(client)
allowed_found = True
if not allowed_found: