scripts/rpc.py: move print_array to rpc.py
This isn't needed in client.py. Change-Id: I7034aea06cd59af55a33e91cc4583aca899e7201 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-on: https://review.gerrithub.io/404431 Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
parent
80c81017ce
commit
e44aef95f8
@ -1,10 +1,20 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from rpc.client import print_dict, print_array
|
||||
from rpc.client import print_dict
|
||||
|
||||
import argparse
|
||||
import rpc
|
||||
|
||||
try:
|
||||
from shlex import quote
|
||||
except ImportError:
|
||||
from pipes import quote
|
||||
|
||||
|
||||
def print_array(a):
|
||||
print " ".join((quote(v) for v in a))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(
|
||||
description='SPDK RPC command line interface')
|
||||
|
@ -2,20 +2,11 @@ import json
|
||||
import socket
|
||||
import time
|
||||
|
||||
try:
|
||||
from shlex import quote
|
||||
except ImportError:
|
||||
from pipes import quote
|
||||
|
||||
|
||||
def print_dict(d):
|
||||
print json.dumps(d, indent=2)
|
||||
|
||||
|
||||
def print_array(a):
|
||||
print " ".join((quote(v) for v in a))
|
||||
|
||||
|
||||
class JSONRPCClient(object):
|
||||
def __init__(self, addr, port=None, verbose=False, timeout=60.0):
|
||||
self.verbose = verbose
|
||||
|
Loading…
Reference in New Issue
Block a user