From b385b9d83d4aa69de834c8e062fa9fff03cdf79b Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 30 Sep 2016 16:36:16 -0300 Subject: Support for localhost at hydra_get_fqdn_from_nodename --- lib/hydra/misc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/hydra/misc b/lib/hydra/misc index 0105760..0823148 100644 --- a/lib/hydra/misc +++ b/lib/hydra/misc @@ -147,14 +147,20 @@ function hydra_next_debian_release { # Get fqdn from nodename function hydra_get_fqdn_from_nodename { - if [ -z "$1" ]; then + local node="$1" + + if [ -z "$node" ]; then return fi - if echo $1 | grep -q '\.'; then - echo $1 + if [ "$node" == "localhost" ]; then + facter fqdn + fi + + if echo $node | grep -q '\.'; then + echo $node else domain=`hydra $HYDRA config domain` - echo $1.$domain + echo $node.$domain fi } -- cgit v1.2.3