diff options
| author | Luke Kanies <luke@madstop.com> | 2008-10-09 15:51:05 +0200 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-10-09 15:51:05 +0200 |
| commit | 9ef6209b3ed1269f7cd1e6a8d0f189f6b5712800 (patch) | |
| tree | 3c786b42679f3bea18979aceb8e3bf2a5184f366 /lib/puppet/node | |
| parent | b96bdc6a63f7be6b724c2aa7ad0ea007cba81718 (diff) | |
| parent | 0fff7d76e89a650f5d2e78b2c69b30635880c36b (diff) | |
| download | puppet-9ef6209b3ed1269f7cd1e6a8d0f189f6b5712800.tar.gz puppet-9ef6209b3ed1269f7cd1e6a8d0f189f6b5712800.tar.xz puppet-9ef6209b3ed1269f7cd1e6a8d0f189f6b5712800.zip | |
Merge branch '0.24.x' of git://github.com/jamtur01/puppet into 0.24.x
Diffstat (limited to 'lib/puppet/node')
| -rw-r--r-- | lib/puppet/node/environment.rb | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/lib/puppet/node/environment.rb b/lib/puppet/node/environment.rb index 343720a62..b64b9c2c4 100644 --- a/lib/puppet/node/environment.rb +++ b/lib/puppet/node/environment.rb @@ -1,30 +1,14 @@ # Model the environment that a node can operate in. This class just # provides a simple wrapper for the functionality around environments. class Puppet::Node::Environment - # Return the list of valid environments. Just looks them up in - # the settings. - def self.valid - # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com] - x = Puppet.settings.value(:environments).split(",").collect { |e| e.to_sym } - end - - # Is the provided environment valid? - def self.valid?(name) - return false if name.to_s == "" - valid.include?(name.to_sym) - end - @seen = {} - # Return an existing environment instance, or create a new one, - # validating the environment name. + # Return an existing environment instance, or create a new one. def self.new(name = nil) name ||= Puppet.settings.value(:environment) raise ArgumentError, "Environment name must be specified" unless name - raise(ArgumentError, "'%s' is not a valid environment" % name) unless valid?(name) - symbol = name.to_sym return @seen[symbol] if @seen[symbol] |
