Remove unused imports and unused function. Move nvmet_command function to Kernel Target as it's specific only to this class. Signed-off-by: Karol Latecki <karol.latecki@intel.com> Change-Id: I30699ca1d8541ff2f57ea609e5caf0304feb4282 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14740 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Michal Berger <michal.berger@intel.com> Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
26 lines
808 B
Python
26 lines
808 B
Python
from subprocess import check_output
|
|
|
|
|
|
def get_nvme_devices_count():
|
|
output = get_nvme_devices_bdf()
|
|
return len(output)
|
|
|
|
|
|
def get_nvme_devices_bdf():
|
|
print("Getting BDFs for NVMe section")
|
|
output = check_output("rootdir=$PWD; \
|
|
source test/common/autotest_common.sh; \
|
|
get_nvme_bdfs 01 08 02",
|
|
executable="/bin/bash", shell=True)
|
|
output = [str(x, encoding="utf-8") for x in output.split()]
|
|
print("Done getting BDFs")
|
|
return output
|
|
|
|
|
|
def get_nvme_devices():
|
|
print("Getting kernel NVMe names")
|
|
output = check_output("lsblk -o NAME -nlp", shell=True).decode(encoding="utf-8")
|
|
output = [x for x in output.split("\n") if "nvme" in x]
|
|
print("Done getting kernel NVMe names")
|
|
return output
|