parameters: (dev_id)
return_statement: return device
docstring: This function gets additional details for a PCI device
docstring_summary: This function gets additional details for a PCI device
docstring_tokens: This function gets additional details for a PCI device
function: def get_pci_device_details(dev_id):
      '''This function gets additional details for a PCI device'''
      device = {}
  
      extra_info = check_output(["lspci", "-vmmks", dev_id]).splitlines()
  
      # parse lspci details
      for line in extra_info:
          if len(line) == 0:
              continue
          name, value = line.split("\t", 1)
          name = name.strip(":") + "_str"
          device[name] = value
      # check for a unix interface name
      sys_path = "/sys/bus/pci/devices/%s/net/" % dev_id
      if exists(sys_path):
          device["Interface"] = ",".join(os.listdir(sys_path))
      else:
          device["Interface"] = ""
      # check if a port is used for ssh connection
      device["Ssh_if"] = False
      device["Active"] = ""
  
      return device
function_tokens: def get_pci_device_details ( dev_id ) : device = { } extra_info = check_output ( [ "lspci" , "-vmmks" , dev_id ] ) . splitlines ( ) # parse lspci details for line in extra_info : if len ( line ) == 0 : continue name , value = line . split ( "\t" , 1 ) name = name . strip ( ":" ) + "_str" device [ name ] = value # check for a unix interface name sys_path = "/sys/bus/pci/devices/%s/net/" % dev_id if exists ( sys_path ) : device [ "Interface" ] = "," . join ( os . listdir ( sys_path ) ) else : device [ "Interface" ] = "" # check if a port is used for ssh connection device [ "Ssh_if" ] = False device [ "Active" ] = "" return device