Skip to content

Commit

Permalink
security: handle exception on early anaconda certificate import
Browse files Browse the repository at this point in the history
Present human readable error message.

The case for this fix is missing --dir option.  The option will be
probably made required in pykickstart but we still want to handle
import exceptions in user friendly way.

Related: INSTALLER-4030
Resolves: rhbz#2342245
  • Loading branch information
rvykydal committed Jan 28, 2025
1 parent e36e634 commit c15ebc0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pyanaconda/startup_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
STORAGE,
TIMEZONE,
)
from pyanaconda.modules.common.errors.installation import SecurityInstallationError
from pyanaconda.modules.common.structures.logging import LoggingData
from pyanaconda.modules.common.structures.timezone import (
GeolocationData,
Expand Down Expand Up @@ -656,7 +657,16 @@ def initialize_security():
certificates_proxy = SECURITY.get_proxy(CERTIFICATES)
import_task_path = certificates_proxy.ImportWithTask()
task_proxy = SECURITY.get_proxy(import_task_path)
sync_run_task(task_proxy)
try:
sync_run_task(task_proxy)
except SecurityInstallationError as e:
log.error(e)
print(_("\nAn error occurred during certificate import:"
"\n%s\n") % str(e).strip())

print(_("The installation cannot continue"))
ipmi_report(IPMI_ABORTED)
sys.exit(1)


def print_dracut_errors(stdout_logger):
Expand Down

0 comments on commit c15ebc0

Please sign in to comment.