Use empty username when username is not present

Use empty username when username is not present in snapshot.
This commit is contained in:
Diego Heras 2023-03-18 16:04:46 +01:00 committed by GitHub
commit 26bab7ba5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -168,7 +168,7 @@ class ResticCollector(object):
clients.append( clients.append(
{ {
"hostname": snap["hostname"], "hostname": snap["hostname"],
"username": snap["username"], "username": snap["username"] if "username" in snap else "",
"snapshot_hash": snap["hash"], "snapshot_hash": snap["hash"],
"snapshot_tag": tag, "snapshot_tag": tag,
"timestamp": timestamp, "timestamp": timestamp,