Commit db8c911e authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Tomasz Zawadzki
Browse files

rpc: replace underscores only in option names



To be backwards compatible, we allow users to pass options with both the
underscores and hyphens, e.g. `bdev_get_bdevs --timeout-us 100` and
`bdev_get_bdevs --timeout_us 100` are equivalent.  However, python's
argparse allows users to pass option values after equals sign and we would
also replace any underscores in those values (e.g. `bdev_get_bdevs
--name=bdev_null0` would become `bdev_get_bdevs --name=bdev-null0`).
This patch fixes that.

Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I82d3adb39167ff5e20451e8ab7de7bb50edb670e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16334


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 9a1457ff
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3454,7 +3454,8 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
        for i in range(len(args)):
            arg = args[i]
            if arg.startswith('--') and "_" in arg:
                args[i] = arg.replace('_', '-')
                opt, *vals = arg.split('=')
                args[i] = '='.join([opt.replace('_', '-'), *vals])

    plugins = []
    load_plugin(None)