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!
浏览代码

Proper handling to add tags

tags/0.92
父节点
当前提交
1336e5a08c
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. +6
    -1
      zfs.py

+ 6
- 1
zfs.py 查看文件

@@ -73,6 +73,10 @@ def zfs_snapshot_by_sha256(sha256):
def zfs_tag(name, tags):
lst = zfs_parse_output(['zfs', 'list', '-o', 'focker:tags', '-H', name])
tags = list(tags)
tags.extend(lst[0][0].split(' '))
tags = list(set(tags))
if len(tags) > 0:
zfs_run(['zfs', 'set', 'focker:tags=' + ' '.join(tags), name])
else:
@@ -85,7 +89,8 @@ def zfs_untag(tags):
for row in lst:
cur_tags = row[1].split(' ')
for t in tags:
cur_tags.remove(t)
if t in cur_tags:
cur_tags.remove(t)
zfs_tag(row[0], cur_tags)


正在加载...
取消
保存