From 1544376db06fbe9b73e412758f67b00bd4870915 Mon Sep 17 00:00:00 2001 From: Justin Sherrill Date: Fri, 16 Dec 2016 16:37:05 -0500 Subject: [PATCH] Fixes #17721 - check for fqdn before adding custom fact --- templates/rhsm-katello-reconfigure.erb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/rhsm-katello-reconfigure.erb b/templates/rhsm-katello-reconfigure.erb index 20a5d7e4..1364fbf3 100755 --- a/templates/rhsm-katello-reconfigure.erb +++ b/templates/rhsm-katello-reconfigure.erb @@ -99,8 +99,9 @@ fi systemctl try-restart goferd >/dev/null 2>&1 -if [ -d /etc/rhsm/facts/ ]; then - echo "{\"network.hostname-override\":\"`hostname -f`\"}" > /etc/rhsm/facts/katello.facts +FQDN=`hostname -f` +if [ $? == "0" ] && [ -d /etc/rhsm/facts/ ]; then + echo "{\"network.hostname-override\":\"$FQDN\"}" > /etc/rhsm/facts/katello.facts fi exit 0