Changeset 2148

Show
Ignore:
Timestamp:
05/11/12 04:46:48 (9 years ago)
Author:
jwoithe
Message:

ffado-diag: some systems don't have the location of lspci (normally /sbin) in the path for normal users. Try to work around this.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/support/tools/ffado_diag_helpers.py

    r2147 r2148  
    141141 
    142142def get_command_path(name): 
    143     cmd = "which %s" % name 
     143    cmd = "which %s 2> /dev/null" % name 
    144144    return run_command(cmd) 
    145145 
     
    152152 
    153153def list_host_controllers(): 
    154     cmd = "lspci | grep 1394" 
     154    lspci_cmd = get_command_path("lspci") 
     155    if lspci_cmd == "": 
     156        lspci_cmd = "/sbin/lspci" 
     157    cmd = lspci_cmd + " | grep 1394" 
    155158    controllers = run_command(cmd).split("\n") 
    156     log.debug("lspci | grep 1394: %s" % controllers) 
     159    log.debug(lspci_cmd + " | grep 1394: %s" % controllers) 
    157160    for c in controllers: 
    158161        tmp = c.split() 
    159162        if len(tmp) > 0: 
    160163            tmp 
    161             cmd = "lspci -vv -nn -s %s" % tmp[0] 
     164            cmd = lspci_cmd + " -vv -nn -s %s" % tmp[0] 
    162165            print run_command(cmd) 
    163166