App.os_release: Fix debug logging

cat /etc/os-release sometimes fails over the wire, and the reason
should be logged but isn't. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-04-09 08:05:07 +02:00
commit 1caae611ba

View file

@ -311,6 +311,7 @@ class App(Base):
) )
self.__os_release = result.decode().stdout.strip() self.__os_release = result.decode().stdout.strip()
except Exception as e: except Exception as e:
log(INFO, f'Failed to read {release_file} ({str(e)}), falling back to uname')
result = self.call_async( result = self.call_async(
self.exec_context.run( self.exec_context.run(
['uname', '-s'], ['uname', '-s'],
@ -321,7 +322,6 @@ class App(Base):
if result.status != 0: if result.status != 0:
log(ERR, f'/etc/os-release and uname both failed, the latter with exit status {result.status}') log(ERR, f'/etc/os-release and uname both failed, the latter with exit status {result.status}')
raise raise
log(INFO, f'Failed to read {release_file} ({str(e)}), falling back to uname')
uname = result.decode().stdout.strip().lower() uname = result.decode().stdout.strip().lower()
self.__os_release = f'ID={uname}\nVERSION_CODENAME=unknown' self.__os_release = f'ID={uname}\nVERSION_CODENAME=unknown'