Skip to content

pmb.install: fall back to a valid hostname if none set

clayton craft requested to merge craftyguy/valid-hostname into master

If the device name does not make a valid hostname, fall back to some simple valid hostname. Some device names (e.g. 'generic-x86_64') are valid names for apk packages and such, but are not valid host names. It assumes that the user (real, or CI) doesn't care if it's unset and just expects pmb to work and not conditionally crash based on the device they selected.

Situations where the user sets an invalid hostname are still validated separately and cause an exception so that they know their config was wrong and to fit it.

This fixes an issue that came up in CI when doing pmb config device generic-x86_64 followed by pmb install.

Edited by clayton craft

Merge request reports