snapshot: Handle snapper list output change

Fixes #1408.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
This commit is contained in:
James Valleroy 2018-10-24 21:29:28 -04:00 committed by Joseph Nuthalapati
parent 0654d34d60
commit 30fd4015b7
No known key found for this signature in database
GPG Key ID: 5398F00A2FA43C35

View File

@ -134,7 +134,7 @@ def _get_snapper_list():
def subcommand_list(_):
"""List snapshots."""
lines = _get_snapper_list()
keys = ('type', 'number', 'pre_number', 'date', 'user', 'cleanup',
keys = ('number', 'type', 'pre_number', 'date', 'user', 'cleanup',
'description')
snapshots = []
for line in lines[2:]:
@ -192,7 +192,7 @@ def subcommand_delete(arguments):
def subcommand_delete_all(_):
"""Delete all the snapshots (except the active one)."""
lines = _get_snapper_list()
snapshot_range = [line.split('|')[1].strip() for line in lines[3:]]
snapshot_range = [line.split('|')[0].strip() for line in lines[3:]]
default_snapshot = _get_default_snapshot()
if snapshot_range:
if default_snapshot: