• Home
  • Raw
  • Download

Lines Matching refs:host

45 def read_file(path_to_file, host=None):  argument
51 if host:
52 if not host.path_exists(path_to_file):
54 return host.run('cat %s' % path_to_file).stdout.strip()
61 def system_output(command, host=None, ignore_status=False): argument
68 if host:
69 return host.run(command, ignore_status=ignore_status).stdout.strip()
74 def get_udev_info(blockdev, method='udev', host=None): argument
100 output = system_output(cmd, host, ignore_status=ignore_status)
113 def get_lsusb_info(host=None): argument
131 lsusb_output = system_output(LSUSB_CMD, host)
149 def get_usbdevice_type_and_serial(device, lsusb_info, host=None): argument
164 host)
176 lsusb_info=[], host=None): argument
206 info = get_udev_info(device, "blkid", host=host)
213 readonly = read_file("%s/ro" % part_path, host)
215 partition_blocks = read_file("%s/size" % part_path, host)
225 mounts = read_file("/proc/mounts", host).splitlines()
253 host=host)
269 info = get_udev_info(device, 'blkid', host=host)
281 host=host)
286 def get_device_info(blockdev, lsusb_info, host=None): argument
300 host))
301 is_removable = bool(int(read_file("%s/removable" % spath, host)))
303 info = get_udev_info(blockdev, "udev", host=host)
311 for basename in system_output('ls %s' % spath, host).splitlines():
324 lsusb_info=lsusb_info, host=host)
331 lsusb_info=lsusb_info, host=host)
337 def get_all(host=None): argument
344 lsusb_info = get_lsusb_info(host)
345 for dev in system_output('ls %s' % INFO_PATH, host).splitlines():
349 ret.extend(get_device_info(dev, lsusb_info, host=host))