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.

pirms 4 gadiem
123456789101112131415161718
  1. from zfs import *
  2. def new_snapshot(base, fun, name):
  3. type_ = zfs_get_type(base)
  4. if type_ != 'snapshot':
  5. raise ValueError('Provided base dataset is not a snapshot')
  6. if '/' not in name:
  7. root = '/'.join(base.split('/')[:-1])
  8. name = root + '/' + name
  9. zfs_run(['zfs', 'clone', base, name])
  10. try:
  11. fun()
  12. except:
  13. zfs_run(['zfs', 'destroy', name])
  14. raise
  15. zfs_run(['zfs', 'set', 'readonly=on', name])
  16. zfs_run(['zfs', 'snapshot', name + '@1'])