Commit 3eaf9265 authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Jim Harris
Browse files

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: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405500


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 96dc91d6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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')
+3 −3
Original line number Diff line number Diff line
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)