diff options
| author | Luke Kanies <luke@madstop.com> | 2007-08-15 14:21:59 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-08-15 14:21:59 -0500 |
| commit | aabad8e1e262fb2f63fa4eef0f0e6fc00cc4b01f (patch) | |
| tree | d1a1b72fe61107878b349ac68897cffcdfe5951c /lib/puppet/network/handler | |
| parent | 65559af75e3da6522f4c3e952a73d80e0040609c (diff) | |
| download | puppet-aabad8e1e262fb2f63fa4eef0f0e6fc00cc4b01f.tar.gz puppet-aabad8e1e262fb2f63fa4eef0f0e6fc00cc4b01f.tar.xz puppet-aabad8e1e262fb2f63fa4eef0f0e6fc00cc4b01f.zip | |
Adding the necessary name/ip fields to the node methods
Diffstat (limited to 'lib/puppet/network/handler')
| -rw-r--r-- | lib/puppet/network/handler/node.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/puppet/network/handler/node.rb b/lib/puppet/network/handler/node.rb index c9548f10b..898db7c22 100644 --- a/lib/puppet/network/handler/node.rb +++ b/lib/puppet/network/handler/node.rb @@ -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 + attr_accessor :name, :classes, :parameters, :environment, :source, :ipaddress def initialize(name, options = {}) @name = name @@ -114,7 +114,7 @@ class Puppet::Network::Handler::Node < Puppet::Network::Handler # Return an entire node configuration. This uses the 'nodesearch' method # defined in the node_source to look for the node. - def details(key) + def details(key, client = nil, clientip = nil) facts = node_facts(key) node = nil names = node_names(key, facts) @@ -148,7 +148,7 @@ class Puppet::Network::Handler::Node < Puppet::Network::Handler end # Return a given node's environment. - def environment(key) + def environment(key, client = nil, clientip = nil) if node = details(key) node.environment else @@ -169,14 +169,8 @@ class Puppet::Network::Handler::Node < Puppet::Network::Handler super end - # Short-hand for creating a new node, so the node sources don't need to - # specify the constant. - def newnode(options) - SimpleNode.new(options) - end - # Try to retrieve a given node's parameters. - def parameters(key) + def parameters(key, client = nil, clientip = nil) if node = details(key) node.parameters else @@ -194,6 +188,12 @@ class Puppet::Network::Handler::Node < Puppet::Network::Handler @fact_handler end + # Short-hand for creating a new node, so the node sources don't need to + # specify the constant. + def newnode(options) + SimpleNode.new(options) + end + # Look up the node facts from our fact handler. def node_facts(key) if facts = fact_handler.get(key) |
