Keeping the node names in the node object, so that they are available to the interpreter

This commit is contained in:
Luke Kanies 2007-08-15 17:05:49 -05:00
Родитель 297dabb637
Коммит a9539548d9
2 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -9,7 +9,7 @@ require 'puppet/util/instance_loader'
class Puppet::Network::Handler::Node < Puppet::Network::Handler
# A simplistic class for managing the node information itself.
class SimpleNode
attr_accessor :name, :classes, :parameters, :environment, :source, :ipaddress
attr_accessor :name, :classes, :parameters, :environment, :source, :ipaddress, :names
def initialize(name, options = {})
@name = name
@ -136,6 +136,7 @@ class Puppet::Network::Handler::Node < Puppet::Network::Handler
if node
node.source = @source
node.names = names
# Merge the facts into the parameters.
if fact_merge?

Просмотреть файл

@ -193,6 +193,9 @@ class TestNodeInterface < Test::Unit::TestCase
# Make sure its source is set
node.expects(:source=).with(handler.source)
# And that the names are retained
node.expects(:names=).with(%w{a b c})
# And make sure we actually get it back
handler.expects(:nodesearch).with("c").returns(node)