summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-28 17:03:21 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-28 17:03:21 +0000
commit90806867a15b8f97f3d289617b13a6fc2facbca8 (patch)
tree6959db716d0831e436aeb64ea07d6c93262351e3
parent17c59f8d83145c728bca3636dfa7c42f66967169 (diff)
downloadpuppet-90806867a15b8f97f3d289617b13a6fc2facbca8.tar.gz
puppet-90806867a15b8f97f3d289617b13a6fc2facbca8.tar.xz
puppet-90806867a15b8f97f3d289617b13a6fc2facbca8.zip
Committing patch by Dennis Jacobfeuerborn to only use the domain name if it is set.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2246 980ebf18-57e1-0310-9a29-db15c13687c0
-rwxr-xr-xlib/puppet/daemon.rb6
-rwxr-xr-xlib/puppet/sslcertificates.rb6
-rw-r--r--lib/puppet/transaction/report.rb8
3 files changed, 17 insertions, 3 deletions
diff --git a/lib/puppet/daemon.rb b/lib/puppet/daemon.rb
index 26704af88..13caf4541 100755
--- a/lib/puppet/daemon.rb
+++ b/lib/puppet/daemon.rb
@@ -51,7 +51,11 @@ module Puppet
unless defined? @fqdn and @fqdn
hostname = Facter.value("hostname")
domain = Facter.value("domain")
- @fqdn = [hostname, domain].join(".")
+ if !domain || domain.empty? then
+ @fqdn = hostname
+ else
+ @fqdn = [hostname, domain].join(".")
+ end
end
return @fqdn
end
diff --git a/lib/puppet/sslcertificates.rb b/lib/puppet/sslcertificates.rb
index 8c93139a9..eaee75d6c 100755
--- a/lib/puppet/sslcertificates.rb
+++ b/lib/puppet/sslcertificates.rb
@@ -11,7 +11,11 @@ end
module Puppet::SSLCertificates
hostname = Facter["hostname"].value
domain = Facter["domain"].value
- fqdn = [hostname, domain].join(".")
+ if !domain || domain.empty? then
+ fqdn = hostname
+ else
+ fqdn = [hostname, domain].join(".")
+ end
Puppet.setdefaults("certificates",
:certdir => ["$ssldir/certs", "The certificate directory."],
diff --git a/lib/puppet/transaction/report.rb b/lib/puppet/transaction/report.rb
index e14135140..ad6b82a8a 100644
--- a/lib/puppet/transaction/report.rb
+++ b/lib/puppet/transaction/report.rb
@@ -20,7 +20,13 @@ class Puppet::Transaction::Report
hash[key] = []
end
- @host = [Facter.value("hostname"), Facter.value("domain")].join(".")
+ domain = Facter.value("domain")
+ hostname = Facter.value("hostname")
+ if !domain || domain.empty? then
+ @host = hostname
+ else
+ @host = [hostname, domain].join(".")
+ end
end
# Create a new metric.