Make 'qvm-volume revert' really use the latest revision
admin.vm.volume.ListSnapshots returned volume revisions in undefined order, but 'qvm-volume revert' assumes the list to be in chronological order. Make that assumption true.
This commit is contained in:
parent
bf1f1ac5ff
commit
fe77b0ec85
@ -347,7 +347,8 @@ class QubesAdminAPI(qubes.api.AbstractQubesAPI):
|
||||
assert self.arg in self.dest.volumes.keys()
|
||||
|
||||
volume = self.dest.volumes[self.arg]
|
||||
revisions = [revision for revision in volume.revisions]
|
||||
id_to_timestamp = volume.revisions
|
||||
revisions = sorted(id_to_timestamp, key=id_to_timestamp.__getitem__)
|
||||
revisions = self.fire_event_for_filter(revisions)
|
||||
|
||||
return ''.join('{}\n'.format(revision) for revision in revisions)
|
||||
|
Loading…
Reference in New Issue
Block a user