forgot to handle if no snapshots are found

This commit is contained in:
brent s 2019-06-02 01:46:23 -04:00
parent 001925af88
commit 6d6d1e20b1

View File

@ -544,11 +544,15 @@ class Backup(object):
_stderr)) _stderr))
if not self.args['archive']: if not self.args['archive']:
if self.args['numlimit'] > 0: if self.args['numlimit'] > 0:
try:
if self.args['old']: if self.args['old']:
output[server][repo['name']] = output[server][repo['name']][:self.args['numlimit']] output[server][repo['name']] = output[server][repo['name']][:self.args['numlimit']]
else: else:
output[server][repo['name']] = list(reversed( output[server][repo['name']] = list(
reversed(
output[server][repo['name']]))[:self.args['numlimit']] output[server][repo['name']]))[:self.args['numlimit']]
except KeyError:
print('(No archives/snapshots found)')
if self.args['invert']: if self.args['invert']:
output[server][repo['name']] = reversed(output[server][repo['name']]) output[server][repo['name']] = reversed(output[server][repo['name']])
self.logger.debug('END: lister') self.logger.debug('END: lister')