1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-01-01 12:45:34 +00:00

remote exceptions: simplify sysinfo processing

in the sysinfo function, there is a way to suppress
all sysinfo output via an env var and just return an
empty string.

so we can expect it is always in unpacked, but it
might be the empty string.
This commit is contained in:
Thomas Waldmann 2023-05-24 15:29:59 +02:00
parent 2331341b74
commit 90c6b7f794
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01

View file

@ -209,6 +209,7 @@ def serve(self):
else:
logging.debug("\n".join(ex_full))
sys_info = sysinfo()
try:
msg = msgpack.packb(
{
@ -218,7 +219,7 @@ def serve(self):
"exception_full": ex_full,
"exception_short": ex_short,
"exception_trace": ex_trace,
"sysinfo": sysinfo(),
"sysinfo": sys_info,
}
)
except TypeError:
@ -230,7 +231,7 @@ def serve(self):
"exception_full": ex_full,
"exception_short": ex_short,
"exception_trace": ex_trace,
"sysinfo": sysinfo(),
"sysinfo": sys_info,
}
)
@ -438,7 +439,7 @@ def exception_full(self):
@property
def sysinfo(self):
return self.unpacked.get("sysinfo", "")
return self.unpacked["sysinfo"]
class RPCServerOutdated(Error):
"""Borg server is too old for {}. Required version {}"""