Commit 92861ff5 authored by Jim Harris's avatar Jim Harris
Browse files

scripts: remove --skip-alias from which commands



--skip-alias is not supported in all versions of which.

While here, explicitly import CalledProcessError - some
versions of Python didn't seem to mind, but it's not
true for all versions.  Also print related error
messages to stderr instead of stdout - this helps
with debugging since in some tests the stdout is
redirected to a file.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I7637adc36da6290ece28c77b3398185191347eef

Reviewed-on: https://review.gerrithub.io/423414


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
parent 58be43c0
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
#!/usr/bin/env python

from subprocess import check_call, call, check_output, Popen, PIPE
from subprocess import check_call, call, check_output, Popen, PIPE, CalledProcessError
import re
import sys
import signal
@@ -66,10 +66,10 @@ def main():

    configure_devices(devices)
    try:
            fio_executable = check_output("which --skip-alias fio", shell=True).split()[0]
    except subprocess.CalledProcessError as e:
            print(e)
            print("Can't find the fio binary, please install it.")
            fio_executable = check_output("which fio", shell=True).split()[0]
    except CalledProcessError as e:
            sys.stderr.write(str(e))
            sys.stderr.write("\nCan't find the fio binary, please install it.\n")
            sys.exit(1)

    device_paths = ['/dev/' + dev for dev in devices]
+5 −5
Original line number Diff line number Diff line
#!/usr/bin/env python

from subprocess import check_call, call, check_output, Popen, PIPE
from subprocess import check_call, call, check_output, Popen, PIPE, CalledProcessError
import re
import sys
import signal
@@ -66,10 +66,10 @@ def main():

    # configure_devices(devices)
    try:
            fio_executable = check_output("which --skip-alias fio", shell=True).split()[0]
    except subprocess.CalledProcessError as e:
            print(e)
            print("Can't find the fio binary, please install it.")
            fio_executable = check_output("which fio", shell=True).split()[0]
    except CalledProcessError as e:
            sys.stderr.write(str(e))
            sys.stderr.write("\nCan't find the fio binary, please install it.\n")
            sys.exit(1)

    device_paths = ['/dev/' + dev for dev in devices]