IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

21 строка
428B

  1. import subprocess
  2. import csv
  3. import io
  4. def zfs_run(command):
  5. out = subprocess.check_output(command)
  6. return out
  7. def zfs_parse_output(command):
  8. out = zfs_run(command)
  9. s = io.StringIO(out.decode('utf-8'))
  10. r = csv.reader(s, delimiter='\t')
  11. return [a for a in r]
  12. def zfs_get_type(name):
  13. lst = zfs_parse_output(['zfs', 'list', '-o', 'name,type', '-H', name])
  14. return lst[0][1]