Commit c334f836 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Make helper fail is OSFAMILY property is missing

Also did a minor cleanup in AssignHostname task
parent 7ee2a43d
......@@ -75,6 +75,11 @@ fi
trap '{ umount "$target"; }' ERR
if [ -z "$SNF_IMAGE_PROPERTY_EXCLUDE_ALL_TASKS" ]; then
if [[ ! "$SNF_IMAGE_PROPERTY_OSFAMILY" =~ ^(linux|windows)$ ]]; then
log_error "Supported values for OSFAMILY propertry are: linux|windows"
fi
# Redirect standard error to standard output,
# prepend a timestamp before each line of output.
echo "Execute all snf-image tasks...."
......
......@@ -58,9 +58,8 @@ linux_hostname() {
slackware|suse)
#local domain=$(sed -e 's/^[^\.]*//g' < /etc/HOSTNAME)
# In slackware hostname and domain name are joined together. For now I
# will not retain the domain name.
# In slackware hostname and domain name are joined together. For now
# I will not retain the domain name.
echo "$hostname" > "${target}/etc/HOSTNAME";;
gentoo)
sed -ie "s/\(\(HOSTNAME\)\|\(hostname\)\)=.*$/\1=\"$hostname\"/" "$target/etc/conf.d/hostname";;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment