Do not log to journald on non-systemd systems.

Some systems like WSL do not support systemd and we cannot rely on
journald for logging. Thus we remove the progress controller that would
always be blank.

Co-authored-by: Didier Roche <didrocks@ubuntu.com>
This commit is contained in:
Jean-Baptiste Lallement 2021-09-01 19:03:52 +02:00
parent dadbb55fd2
commit 15664d9016
1 changed files with 12 additions and 8 deletions

View File

@ -319,14 +319,18 @@ class SubiquityClient(TuiApplication):
print(line)
return
await super().start()
journald_listen(
self.aio_loop,
[status.event_syslog_id],
self.controllers.Progress.event)
journald_listen(
self.aio_loop,
[status.log_syslog_id],
self.controllers.Progress.log_line)
# Progress uses systemd to collect and display the installation
# logs. Although some system don't have systemd, so we disable
# the progress page
if hasattr(self.controllers, "Progress"):
journald_listen(
self.aio_loop,
[status.event_syslog_id],
self.controllers.Progress.event)
journald_listen(
self.aio_loop,
[status.log_syslog_id],
self.controllers.Progress.log_line)
if not status.cloud_init_ok:
self.add_global_overlay(CloudInitFail(self))
self.error_reporter.load_reports()