From 3eaf92650b82067d5b752895886bf6870360f852 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Tue, 27 Mar 2018 14:04:40 -0700 Subject: [PATCH] scripts/rpc.py: pass named args to subsystem.py As an example of how we want the Python wrappers for the RPC interface to look, convert the methods in scripts/rpc/subsystem.py to have explicitly named arguments and pass the JSONRPCClient object explicitly. Change-Id: I9d2e194ce7fde535d323383925f7825ab93909de Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/405500 Tested-by: SPDK Automated Test System Reviewed-by: Shuhei Matsumoto Reviewed-by: Jim Harris --- scripts/rpc.py | 4 ++-- scripts/rpc/subsystem.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/rpc.py b/scripts/rpc.py index 5d143d143..5046c7a47 100755 --- a/scripts/rpc.py +++ b/scripts/rpc.py @@ -665,14 +665,14 @@ if __name__ == "__main__": # subsystem def get_subsystems(args): - print_dict(rpc.subsystem.get_subsystems(args.client, args)) + print_dict(rpc.subsystem.get_subsystems(args.client)) p = subparsers.add_parser('get_subsystems', help=""""Print subsystems array in initialization order. Each subsystem entry contain (unsorted) array of subsystems it depends on.""") p.set_defaults(func=get_subsystems) def get_subsystem_config(args): - print_dict(rpc.subsystem.get_subsystem_config(args.client, args)) + print_dict(rpc.subsystem.get_subsystem_config(args.client, args.name)) p = subparsers.add_parser('get_subsystem_config', help=""""Print subsystem configuration""") p.add_argument('name', help='Name of subsystem to query') diff --git a/scripts/rpc/subsystem.py b/scripts/rpc/subsystem.py index db734f902..c8e662bcb 100755 --- a/scripts/rpc/subsystem.py +++ b/scripts/rpc/subsystem.py @@ -1,7 +1,7 @@ -def get_subsystems(client, args): +def get_subsystems(client): return client.call('get_subsystems') -def get_subsystem_config(client, args): - params = {'name': args.name} +def get_subsystem_config(client, name): + params = {'name': name} return client.call('get_subsystem_config', params)