From: Silvio Rhatto Date: Fri, 30 Sep 2016 19:36:16 +0000 (-0300) Subject: Support for localhost at hydra_get_fqdn_from_nodename X-Git-Tag: 0.2.4~75 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=b385b9d83d4aa69de834c8e062fa9fff03cdf79b;p=hydra.git Support for localhost at hydra_get_fqdn_from_nodename --- 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 }