From ef2698adb4aed4fdfb47e6bc186ece1e76c13337 Mon Sep 17 00:00:00 2001 From: Rusty Bird Date: Sun, 9 Sep 2018 20:01:14 +0000 Subject: [PATCH] storage/reflink: make revisions() more readable, use iglob --- qubes/storage/reflink.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qubes/storage/reflink.py b/qubes/storage/reflink.py index bcf2e3dc..20fa2a97 100644 --- a/qubes/storage/reflink.py +++ b/qubes/storage/reflink.py @@ -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):