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!
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

21 líneas
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]