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 ...@@ -75,6 +75,11 @@ fi
trap '{ umount "$target"; }' ERR trap '{ umount "$target"; }' ERR
if [ -z "$SNF_IMAGE_PROPERTY_EXCLUDE_ALL_TASKS" ]; then 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, # Redirect standard error to standard output,
# prepend a timestamp before each line of output. # prepend a timestamp before each line of output.
echo "Execute all snf-image tasks...." echo "Execute all snf-image tasks...."
......
...@@ -56,14 +56,13 @@ linux_hostname() { ...@@ -56,14 +56,13 @@ linux_hostname() {
redhat) redhat)
sed -ie "s/HOSTNAME=.*$/HOSTNAME=$hostname/g" "$target/etc/sysconfig/network";; sed -ie "s/HOSTNAME=.*$/HOSTNAME=$hostname/g" "$target/etc/sysconfig/network";;
slackware|suse) slackware|suse)
#local domain=$(sed -e 's/^[^\.]*//g' < /etc/HOSTNAME) #local domain=$(sed -e 's/^[^\.]*//g' < /etc/HOSTNAME)
# In slackware hostname and domain name are joined together. For now I # In slackware hostname and domain name are joined together. For now
# will not retain the domain name. # I will not retain the domain name.
echo "$hostname" > "${target}/etc/HOSTNAME";;
echo "$hostname" > "${target}/etc/HOSTNAME";; gentoo)
gentoo) sed -ie "s/\(\(HOSTNAME\)\|\(hostname\)\)=.*$/\1=\"$hostname\"/" "$target/etc/conf.d/hostname";;
sed -ie "s/\(\(HOSTNAME\)\|\(hostname\)\)=.*$/\1=\"$hostname\"/" "$target/etc/conf.d/hostname";;
esac esac
# Some Linux distributions assign the hostname to 127.0.1.1 in order to be # Some Linux distributions assign the hostname to 127.0.1.1 in order to be
......
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