Commit dc820550 authored by Blachut, Bartosz's avatar Blachut, Bartosz Committed by Jim Harris
Browse files

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: default avatarBlachut, 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: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent ed8be4ad
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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