V6.0.0 - GigaSPOT #5

Merged
clore merged 8 commits from gigaspot into main 2025-01-19 17:54:53 +00:00
1 changed files with 24 additions and 0 deletions
Showing only changes of commit 6665aa8fbb - Show all commits

View File

@ -76,6 +76,30 @@ async def ensure_packages_installed(
if return_code == 0: if return_code == 0:
log.debug(f"Successfully installed packages: {packages_to_install}") log.debug(f"Successfully installed packages: {packages_to_install}")
return True return True
elif return_code == 100:
dpkg_rc, dpkg_stdout, dpkg_stderr = await utils.async_run_command(
"sudo dpkg --configure -a",
timeout=200,
env=non_interactive_env
)
# Install packages
return_code, stdout, stderr = await utils.async_run_command(
install_cmd,
timeout=remaining_timeout,
env=non_interactive_env
)
if LOGGING_ENABLED:
await ensure_packages_installed_log(f"post-dpkg install stdout: {stdout}")
await ensure_packages_installed_log(f"post-dpkg install stderr: {stderr}\ncode: {str(return_code)}")
if return_code == 0:
log.debug(f"Successfully installed packages: {packages_to_install}")
return True
else:
log.error(f"Failed to install packages: {stderr}")
return False
else: else:
log.error(f"Failed to install packages: {stderr}") log.error(f"Failed to install packages: {stderr}")
return False return False