Commit c5c7de44 authored by Tomasz Zawadzki's avatar Tomasz Zawadzki
Browse files

scripts/rpc: allow methods without params in load_config/load_subsystem_config RPC



JSON-RPC allows for methods that do not contain any params.
Turns out that so far this scenario has not occured for load_config or load_sybsystem_config
RPC, which processes JSON config file saved from previous app run.

Next patch writes out bdev_wait_for_examine to bdev subsystem
configuration. As that methods does not contain any params following
error was seen:
# /home/vagrant/spdk_repo/spdk/scripts/rpc.py load_config
Traceback (most recent call last):
  File "/home/vagrant/spdk_repo/spdk/scripts/rpc.py", line 2671, in <module>
    call_rpc_func(args)
  File "/home/vagrant/spdk_repo/spdk/scripts/rpc.py", line 2601, in call_rpc_func
    args.func(args)
  File "/home/vagrant/spdk_repo/spdk/scripts/rpc.py", line 100, in load_config
    include_aliases=args.include_aliases)
  File "/home/vagrant/spdk_repo/spdk/scripts/rpc/__init__.py", line 143, in load_config
    client.call(elem['method'], elem['params'])
KeyError: 'params'

Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I4a56a9d0caa4b752fb9c1fad4ae581aad8a4c2c1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5860


Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatar <dongx.yi@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 77b6f4bc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ def load_config(client, fd, include_aliases=False):
                if 'method' not in elem or elem['method'] not in allowed_methods:
                    continue

                client.call(elem['method'], elem['params'])
                client.call(**elem)
                config.remove(elem)
                allowed_found = True

@@ -194,7 +194,7 @@ def load_subsystem_config(client, fd):
        if 'method' not in elem or elem['method'] not in allowed_methods:
            continue

        client.call(elem['method'], elem['params'])
        client.call(**elem)
        config.remove(elem)

    if config: