]> gitweb.fluxo.info Git - hydra.git/commitdiff
Support for localhost at hydra_get_fqdn_from_nodename
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 30 Sep 2016 19:36:16 +0000 (16:36 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 30 Sep 2016 19:36:16 +0000 (16:36 -0300)
lib/hydra/misc

index 01057608f40f8105c6ea9753ceca34f7d7178b92..08231489aaccd8f5e570b44e979eda4b14d2cbf1 100644 (file)
@@ -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
 }