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

bdevperf: add python/ dir to PYTHONPATH



The other python scripts (e.g. scripts/rpc.py) already add the relative
location of the python directory inside the repo.  It's very convenient,
as it doesn't require users running them from within the repo to adjust
PYTHONPATH by themselves.  Do the same for bdevperf.py.

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


Reviewed-by: default avatarTomasz Zawadzki <tomasz@tzawadzki.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Community-CI: Mellanox Build Bot
parent 7c0177b0
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -6,21 +6,24 @@

import logging
import argparse
import os
import sys
import shlex

try:
    from spdk.rpc.client import print_dict, JSONRPCException
    import spdk.rpc as rpc
    from shlex import quote
except ImportError:
    from pipes import quote

try:
    sys.path.append(os.path.dirname(__file__) + '/../../../python')
    from spdk.rpc.client import print_dict, JSONRPCException  # noqa
    import spdk.rpc as rpc  # noqa
except ImportError:
    print("SPDK RPC library missing. Please add spdk/python directory to PYTHONPATH:")
    print("'export PYTHONPATH=$PYTHONPATH:spdk/python'")
    exit(1)

try:
    from shlex import quote
except ImportError:
    from pipes import quote

PATTERN_TYPES_STR = ("read", "write", "randread", "randwrite", "rw", "randrw", "verify", "reset",
                     "unmap", "flush", "write_zeroes")