Use empty username when username is not present
in snapshot. This commit is fixing a crash when the snapshot has no username field in JSON. The missing username is replaced with a space.
This commit is contained in:
parent
880b47131c
commit
011b658805
1 changed files with 1 additions and 1 deletions
|
@ -117,7 +117,7 @@ class ResticCollector(object):
|
||||||
clients.append({
|
clients.append({
|
||||||
'snapshot_hash': snap['hash'],
|
'snapshot_hash': snap['hash'],
|
||||||
'hostname': snap['hostname'],
|
'hostname': snap['hostname'],
|
||||||
'username': snap['username'],
|
'username': snap['username'] if 'username' in snap else '',
|
||||||
'timestamp': timestamp,
|
'timestamp': timestamp,
|
||||||
'size_total': stats['total_size'],
|
'size_total': stats['total_size'],
|
||||||
'files_total': stats['total_file_count'],
|
'files_total': stats['total_file_count'],
|
||||||
|
|
Loading…
Reference in a new issue