Fixing shutdown/reboot call to use new .

This commit is contained in:
Roland 2025-03-02 12:29:00 -07:00
parent 612682f3bf
commit 21919b3783
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680

View file

@ -196,14 +196,13 @@ async def shutdown(reboot: bool = False, delay: int = 10):
if DOCKERIZED:
raise ShutdownFailed('Cannot Reboot because we are dockerized')
reboot = '--reboot' if reboot else ''
cmd = (SUDO_BIN, 'shutdown', '--reboot', '0') if reboot else (SUDO_BIN, 'shutdown', '0')
async def _():
await asyncio.sleep(delay)
try:
# Call shutdown (or reboot) with no delay now that we have slept.
cmd = [SUDO_BIN, 'shutdown', 'reboot', '0']
result = await run_command(cmd)
except subprocess.CalledProcessError as e:
if reboot: