From c781fdee2ff7e072d819f3c254857818205884d8 Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Wed, 27 Feb 2019 13:06:54 +0900 Subject: [PATCH] scripts/rpc: Change the separator of portal list parameter of add_portal_group The python script for add_portal_group had required each portal is an argument and portal list are made of remaining all arguments. However this prevents adding new parameters to add_portal_group. This patch changes portal list to be a single argument for python, and each portal is separated by a whitespace in the argument. Currently there will be very rare that a portal group has multiple portals. Hence this change will not break any compatibility. Updating CHANGELOG will be done together with other updates later. Change-Id: I8c597a1194fff338afb371e6d24f9273122b753c Signed-off-by: Shuhei Matsumoto Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446379 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Darek Stojaczyk --- scripts/rpc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/rpc.py b/scripts/rpc.py index 3a3306da3..ac1035239 100755 --- a/scripts/rpc.py +++ b/scripts/rpc.py @@ -815,7 +815,7 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse def add_portal_group(args): portals = [] - for p in args.portal_list: + for p in args.portal_list.strip().split(' '): ip, separator, port_cpumask = p.rpartition(':') split_port_cpumask = port_cpumask.split('@') if len(split_port_cpumask) == 1: @@ -833,9 +833,9 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse p = subparsers.add_parser('add_portal_group', help='Add a portal group') p.add_argument( 'tag', help='Portal group tag (unique, integer > 0)', type=int) - p.add_argument('portal_list', nargs=argparse.REMAINDER, help="""List of portals in 'host:port@cpumask' format, separated by whitespace + p.add_argument('portal_list', help="""List of portals in host:port@cpumask format, separated by whitespace (cpumask is optional and can be skipped) - Example: '192.168.100.100:3260' '192.168.100.100:3261' '192.168.100.100:3262@0x1""") + Example: '192.168.100.100:3260 192.168.100.100:3261 192.168.100.100:3262@0x1""") p.set_defaults(func=add_portal_group) def add_initiator_group(args):