summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-05-26 17:41:38 -0500
committerLuke Kanies <luke@madstop.com>2008-05-26 17:41:38 -0500
commit02411f5d74e9f437acdba9c75eb811b9976174c7 (patch)
treea019b22b9cb13466716d4fd5f7a8bfde1bcfa89e /lib/puppet/network
parent7b02f2ba443ba35d7305c24b87028456eaf6bd29 (diff)
downloadpuppet-02411f5d74e9f437acdba9c75eb811b9976174c7.tar.gz
puppet-02411f5d74e9f437acdba9c75eb811b9976174c7.tar.xz
puppet-02411f5d74e9f437acdba9c75eb811b9976174c7.zip
Always using the cert name to store yaml files, which fixes #1178.
The Master handler previously provided the support for the :node_name setting, and that functionality has now been moved into the Node class. At the same time, the names to search through have been changed somewhat: Previously, the certificate name and the hostname were both used for searching, but now, the cert name is always searched first (unless node_name == facter), but only the Facter hostname, domain, and fqdn are used otherwise. We no longer split the cert name, only the hostname/domain/fqdn. In the general case, this provides no behaviour change, because people's hostname is the same as their certname. This only results in a change in behaviour if you specify a certificate name that is a normal node name, and you want to look that node up by something other than the full name in the certificate. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/network')
-rw-r--r--lib/puppet/network/handler/master.rb24
1 files changed, 2 insertions, 22 deletions
diff --git a/lib/puppet/network/handler/master.rb b/lib/puppet/network/handler/master.rb
index 851ccc7b2..a050b089b 100644
--- a/lib/puppet/network/handler/master.rb
+++ b/lib/puppet/network/handler/master.rb
@@ -56,7 +56,8 @@ class Puppet::Network::Handler
# Call our various handlers; this handler is getting deprecated.
def getconfig(facts, format = "marshal", client = nil, clientip = nil)
facts = decode_facts(facts)
- client, clientip = clientname(client, clientip, facts)
+
+ client ||= facts["hostname"]
# Pass the facts to the fact handler
Puppet::Node::Facts.new(client, facts).save unless local?
@@ -66,27 +67,6 @@ class Puppet::Network::Handler
return translate(catalog.extract)
end
- private
-
- # 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
- facts["fqdn"] = client
- facts["hostname"], facts["domain"] = client.split('.', 2)
- end
- if ip
- clientip = ip
- end
- end
-
- return client, clientip
- end
-
#
def decode_facts(facts)
if @local