From 9a553765b458df510b50b44499bb5988a169d014 Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Tue, 30 Jul 2024 16:37:28 +0200 Subject: utils: postinstall: show hostname in logs Display the hostname that is set in the logs. --- src/utils/postinstall.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/utils/postinstall.py b/src/utils/postinstall.py index 374a1cd..f52ca77 100644 --- a/src/utils/postinstall.py +++ b/src/utils/postinstall.py @@ -23,7 +23,7 @@ CONFIGUREOS_LEGACY_ENABLED = False def set_windows_hostname(disk, partition, name): - logging.info(f'Configuring hostname') + logging.info(f'Setting Windows hostname to {name}') if len(name) > 15: logging.warning(f'Windows does nor permit hostnames that exceed 15 characters. Truncating {name}') @@ -61,13 +61,13 @@ def set_windows_hostname(disk, partition, name): hive.commit(hive_path) except Exception as e: - raise OgError(f'Unable to configure Windows hostname: {e}') from e + raise OgError(f'Unable to set Windows hostname: {e}') from e finally: umount(mountpoint) def set_linux_hostname(disk, partition, name): - logging.info(f'Configuring hostname') + logging.info(f'Setting Linux hostname to {name}') device = get_partition_device(disk, partition) mountpoint = device.replace('dev', 'mnt') @@ -80,7 +80,7 @@ def set_linux_hostname(disk, partition, name): with open(hostname_path, 'w') as f: f.write(name) except OSError as e: - raise OgError(f'Unable to configure Linux hostname: {e}') from e + raise OgError(f'Unable to set Linux hostname: {e}') from e finally: umount(mountpoint) -- cgit v1.2.3-18-g5258