test/bdevio: present info when RPC lib is missing from PYTHONPATH
The test.py script relies upon importing SPDK Python RPC libs. This requires user to add ./spdk/scripts/ to PYTHONPATH. Unfortunately --help could not be reached when the import failed, to user executing the script directly wouldn't know that. This patch adds instructions for user when importing RPC lib fails. Change-Id: Icb87fbc5ae9d1c5b71699827d6ea0cd922d38627 Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460908 Reviewed-by: Karol Latecki <karol.latecki@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
feff62c7e5
commit
14034200d9
@ -1,13 +1,17 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
from rpc.client import print_dict, JSONRPCException
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import argparse
|
import argparse
|
||||||
import rpc
|
|
||||||
import sys
|
import sys
|
||||||
import shlex
|
import shlex
|
||||||
|
|
||||||
|
try:
|
||||||
|
from rpc.client import print_dict, JSONRPCException
|
||||||
|
import rpc
|
||||||
|
except ImportError:
|
||||||
|
print("SPDK RPC library missing. Please add spdk/scripts/ directory to PYTHONPATH:")
|
||||||
|
print("'export PYTHONPATH=$PYTHONPATH:./spdk/scripts/'")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from shlex import quote
|
from shlex import quote
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
Loading…
Reference in New Issue
Block a user