mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 17:23:36 +02:00
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:
parent
2852c65bf1
commit
1caae611ba
1 changed files with 1 additions and 1 deletions
|
|
@ -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'
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue