rpc: fix removing a listener with an empty trsvcid

If trsvcid is not set in the nvmf_subsystem_remove_listener call,
rpc client treats it as 'None' and sends "null" to the application,
which causes decode failure in SPDK.

Trsvcid is described as optional and should be treated this way.
For such a listener removal call with an empty trsvcid, "" should be
sent as trsvcid instead of "null" in the json request.

Signed-off-by: Blachut, Bartosz <bartosz.blachut@intel.com>
Change-Id: Ic26907c22a2600c9618354ce8ff63e93e00aec09
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9659
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@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:
Blachut, Bartosz 2021-09-28 09:59:24 +02:00 committed by Jim Harris
parent ed8be4ad05
commit dc82055029

View File

@ -291,8 +291,10 @@ def nvmf_subsystem_remove_listener(
True or False
"""
listen_address = {'trtype': trtype,
'traddr': traddr,
'trsvcid': trsvcid}
'traddr': traddr}
if trsvcid:
listen_address['trsvcid'] = trsvcid
if adrfam:
listen_address['adrfam'] = adrfam