remove unused location from ClanError

This commit is contained in:
Jörg Thalheim
2024-09-29 16:06:27 +02:00
parent d4685e7208
commit 84cb54a537

View File

@@ -168,11 +168,10 @@ def generate_machine_hardware_info(
is_template = hw_file.exists() and "throw" in hw_file.read_text() is_template = hw_file.exists() and "throw" in hw_file.read_text()
if hw_file.exists() and not force and not is_template: if hw_file.exists() and not force and not is_template:
msg = "File exists." msg = "File exists"
raise ClanError( raise ClanError(
msg, msg,
description="Hardware file already exists. To force overwrite the existing configuration use '--force'.", description=f"'{hw_file}' already exists. To force overwrite the existing configuration use '--force'.",
location=f"{__name__} {hw_file}",
) )
backup_file = None backup_file = None
@@ -207,8 +206,7 @@ def generate_machine_hardware_info(
msg = "Invalid hardware-configuration.nix file" msg = "Invalid hardware-configuration.nix file"
raise ClanError( raise ClanError(
msg, msg,
description="The hardware-configuration.nix file is invalid. Please check the file and try again.", description=f"Configuration at '{hw_file}' is invalid. Please check the file and try again.",
location=f"{__name__} {hw_file}",
) from e ) from e
return HardwareReport(backend) return HardwareReport(backend)