storage/reflink: make revisions() more readable, use iglob
This commit is contained in:
parent
18f9356c2c
commit
ef2698adb4
@ -297,10 +297,10 @@ class ReflinkVolume(qubes.storage.Volume):
|
||||
@property
|
||||
def revisions(self):
|
||||
prefix = self._path_clean + '.'
|
||||
paths = glob.glob(glob.escape(prefix) + '*@*Z')
|
||||
items = sorted((path[len(prefix):-1].split('@') for path in paths),
|
||||
key=lambda item: int(item[0]))
|
||||
return collections.OrderedDict(items)
|
||||
paths = glob.iglob(glob.escape(prefix) + '*@*Z')
|
||||
items = (path[len(prefix):-1].split('@') for path in paths)
|
||||
return collections.OrderedDict(sorted(items,
|
||||
key=lambda item: int(item[0])))
|
||||
|
||||
@property
|
||||
def usage(self):
|
||||
|
Loading…
Reference in New Issue
Block a user