Ensure we always exit the server

Co-authored-by: Didier Roche <didrocks@ubuntu.com>
This commit is contained in:
Jean-Baptiste Lallement 2021-09-01 17:42:19 +02:00
parent 805a84ab76
commit 5b2e78a8a1
1 changed files with 2 additions and 3 deletions

View File

@ -38,9 +38,7 @@ class SetupShutdownController(ShutdownController):
@with_context(description='mode={self.mode.name}')
def shutdown(self, context):
self.shuttingdown_event.set()
if self.opts.dry_run:
self.app.exit()
else:
if not self.opts.dry_run:
if self.mode == ShutdownMode.REBOOT:
# TODO WSL:
# Implement a reboot that doesn't depend on systemd
@ -49,3 +47,4 @@ class SetupShutdownController(ShutdownController):
# TODO WSL:
# Implement a poweroff that doesn't depend on systemd
log.Warning("poweroff command not implemented")
self.app.exit()