diff options
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/boot.py | 2 | ||||
-rw-r--r-- | src/utils/hw_inventory.py | 6 | ||||
-rw-r--r-- | src/utils/legacy.py | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/utils/boot.py b/src/utils/boot.py index 528c052..04cae8e 100644 --- a/src/utils/boot.py +++ b/src/utils/boot.py @@ -130,6 +130,6 @@ def boot_os_at(disk, part): elif not is_uefi and os_family == OSFamily.LINUX: _boot_bios_linux(disk, part, mountpoint) else: - raise RuntimeError('Unknown OS family') + raise RuntimeError(f'Unknown OS family {os_family}') finally: umount(mountpoint) diff --git a/src/utils/hw_inventory.py b/src/utils/hw_inventory.py index 23c8765..c534101 100644 --- a/src/utils/hw_inventory.py +++ b/src/utils/hw_inventory.py @@ -55,7 +55,7 @@ class HardwareInventory(): def add_element(self, elem): if elem.type not in HardwareType: - raise ValueError('Unsupported hardware type') + raise ValueError(f'Unsupported hardware type, received {elem.type}') if not elem.name: raise ValueError('Empty hardware element name') self.elements.append(elem) @@ -250,7 +250,7 @@ def legacy_hardware_element(element): represented as "vga=Foo" """ if type(element) is not HardwareElement: - raise TypeError('Invalid type') + raise TypeError('Invalid hardware element type') elif element.type is HardwareType.MULTIMEDIA: nemonic = 'mul' elif element.type is HardwareType.BOOTMODE: @@ -297,7 +297,7 @@ def get_hardware_inventory(): if type(j) is list: root = j[0] if type(root) is not dict: - raise ValueError('Unvalid lshw json output') + raise ValueError('Invalid lshw json output') inventory = HardwareInventory() _fill_computer_model(inventory, root) diff --git a/src/utils/legacy.py b/src/utils/legacy.py index d3a0318..76fc6c6 100644 --- a/src/utils/legacy.py +++ b/src/utils/legacy.py @@ -174,7 +174,7 @@ def ogChangeRepo(ip, smb_user='opengnsys', smb_pass='og'): try: ipaddr = ipaddress.ip_address(ip) except ValueError as e: - raise ValueError('Invalid ip address') + raise ValueError(f'Invalid IP address {ip} received') mounted = False with open('/etc/mtab') as f: |