This fix ensures that the system binds the hostname to the assigned IP
without any changes required to /etc/hosts.
https://lists.opendaylight.org/pipermail/release/2017-October/012736.html
Jira: releng-581
Change-Id: I8485001843753753d56cef896edfeca88db4641d
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
echo "No extra steps for $FACTER_OS"
;;
esac
+
+ # Update /etc/nss-switch.conf to map hostname with IP instead of using `localhost`
+ # from /etc/hosts which is required by some of the Java API's to avoid
+ # Java UnknownHostException: "Name or service not known" error.
+ sed -i "/^hosts:/s/$/ myhostname/" /etc/nsswitch.conf
}
echo "---> Attempting to detect OS"