summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-08-20 22:25:00 -0500
committerLuke Kanies <luke@madstop.com>2007-08-20 22:25:00 -0500
commit4eb87ed7c8829a6fbc558595be9149e9b3cf5b36 (patch)
tree5c8319949022f932eb6467b17b55debaa42fa125 /lib/puppet/network
parent2a4e1011dbc244754f434f7eb97f3d41463e5cd4 (diff)
downloadpuppet-4eb87ed7c8829a6fbc558595be9149e9b3cf5b36.tar.gz
puppet-4eb87ed7c8829a6fbc558595be9149e9b3cf5b36.tar.xz
puppet-4eb87ed7c8829a6fbc558595be9149e9b3cf5b36.zip
A round of bugfixing. Many more tests now pass -- I think we are largely down to tests that (yay!) fail in trunk.
Diffstat (limited to 'lib/puppet/network')
-rw-r--r--lib/puppet/network/handler.rb6
-rw-r--r--lib/puppet/network/handler/configuration.rb2
-rw-r--r--lib/puppet/network/handler/master.rb16
-rw-r--r--lib/puppet/network/handler/node.rb3
4 files changed, 16 insertions, 11 deletions
diff --git a/lib/puppet/network/handler.rb b/lib/puppet/network/handler.rb
index 33343e4fe..c2fbfcba5 100644
--- a/lib/puppet/network/handler.rb
+++ b/lib/puppet/network/handler.rb
@@ -10,7 +10,7 @@ module Puppet::Network
# This is so that the handlers can subclass just 'Handler', rather
# then having to specify the full class path.
Handler = self
- attr_accessor :server
+ attr_accessor :server, :local
extend Puppet::Util::SubclassLoader
extend Puppet::Util
@@ -44,6 +44,10 @@ module Puppet::Network
# Create an empty init method with the same signature.
def initialize(hash = {})
end
+
+ def local?
+ self.local
+ end
end
end
diff --git a/lib/puppet/network/handler/configuration.rb b/lib/puppet/network/handler/configuration.rb
index f1a20ee74..3539ab9a4 100644
--- a/lib/puppet/network/handler/configuration.rb
+++ b/lib/puppet/network/handler/configuration.rb
@@ -57,7 +57,7 @@ class Puppet::Network::Handler
# Return the configuration version.
def version(client = nil, clientip = nil)
- v = interpreter.configuration_version
+ v = interpreter.parsedate
# If we can find the node, then store the fact that the node
# has checked in.
if client and node = node_handler.details(client)
diff --git a/lib/puppet/network/handler/master.rb b/lib/puppet/network/handler/master.rb
index 0aa50a426..acc6c4cda 100644
--- a/lib/puppet/network/handler/master.rb
+++ b/lib/puppet/network/handler/master.rb
@@ -13,7 +13,7 @@ class Puppet::Network::Handler
include Puppet::Util
- attr_accessor :ast, :local
+ attr_accessor :ast
attr_reader :ca
@interface = XMLRPC::Service::Interface.new("puppetmaster") { |iface|
@@ -23,7 +23,7 @@ class Puppet::Network::Handler
# Tell a client whether there's a fresh config for it
def freshness(client = nil, clientip = nil)
- config_handler.version(client)
+ config_handler.version(client, clientip)
end
def initialize(hash = {})
@@ -42,7 +42,7 @@ class Puppet::Network::Handler
@local = false
end
- args[:Local] = @local
+ args[:Local] = local?
if hash.include?(:CA) and hash[:CA]
@ca = Puppet::SSLCertificates::CA.new()
@@ -79,12 +79,10 @@ class Puppet::Network::Handler
return config_handler.configuration(client)
end
- def local?
- if defined? @local and @local
- return true
- else
- return false
- end
+ def local=(val)
+ @local = val
+ config_handler.local = val
+ fact_handler.local = val
end
private
diff --git a/lib/puppet/network/handler/node.rb b/lib/puppet/network/handler/node.rb
index 0d685b1f1..a21d571b0 100644
--- a/lib/puppet/network/handler/node.rb
+++ b/lib/puppet/network/handler/node.rb
@@ -15,6 +15,9 @@ class Puppet::Network::Handler::Node < Puppet::Network::Handler
def initialize(name, options = {})
@name = name
+ # Provide a default value.
+ @names = [name]
+
if classes = options[:classes]
if classes.is_a?(String)
@classes = [classes]