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!
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

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