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개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
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]