mirror of https://git.48k.eu/ogclient
utils: postinstall: show hostname in logs
Display the hostname that is set in the logs.master
parent
1329c0955b
commit
9a553765b4
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue