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 <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405500
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Daniel Verkamp 2018-03-27 14:04:40 -07:00 committed by Jim Harris
parent 96dc91d608
commit 3eaf92650b
2 changed files with 5 additions and 5 deletions

View File

@ -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')

View File

@ -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)