aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/hydra/misc14
1 files changed, 10 insertions, 4 deletions
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
}