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 <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446379
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
Shuhei Matsumoto 2019-02-27 13:06:54 +09:00 committed by Darek Stojaczyk
parent 49e0400920
commit c781fdee2f

View File

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