summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-09-22 22:24:12 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-09-22 22:24:12 +0000
commit55f2873d454dfb32593171e3f2b16f3b4221d897 (patch)
treedb92bec4529d3f595ce3bc47a72e8b5785265b70 /lib/puppet
parent3aac2e1eb48efa8f97d9c2e00b224c448cb77e8f (diff)
downloadpuppet-55f2873d454dfb32593171e3f2b16f3b4221d897.tar.gz
puppet-55f2873d454dfb32593171e3f2b16f3b4221d897.tar.xz
puppet-55f2873d454dfb32593171e3f2b16f3b4221d897.zip
Merging the fix to server/master.rb
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1673 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/server/master.rb25
1 files changed, 18 insertions, 7 deletions
diff --git a/lib/puppet/server/master.rb b/lib/puppet/server/master.rb
index 198a6f682..1822e779e 100644
--- a/lib/puppet/server/master.rb
+++ b/lib/puppet/server/master.rb
@@ -36,6 +36,23 @@ class Server
end
end
+ # Manipulate the client name as appropriate.
+ def clientname(name, ip, facts)
+ # Always use the hostname from Facter.
+ client = facts["hostname"]
+ clientip = facts["ipaddress"]
+ if Puppet[:node_name] == 'cert'
+ if name
+ client = name
+ end
+ if ip
+ clientip = ip
+ end
+ end
+
+ return client, clientip
+ end
+
# Tell a client whether there's a fresh config for it
def freshness(client = nil, clientip = nil)
if defined? @interpreter
@@ -120,13 +137,7 @@ class Server
end
end
- # Always use the hostname from Facter.
- if Puppet[:node_name] == 'facter'
- client = facts["hostname"]
- clientip = facts["ipaddress"]
- else
- facts['hostname'] = client
- end
+ client, clientip = clientname(client, clientip, facts)
# Add any server-side facts to our server.
addfacts(facts)