diff options
| author | Luke Kanies <luke@madstop.com> | 2008-10-17 09:01:04 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-10-17 09:01:04 -0500 |
| commit | 8aee40de69e6fe8d67ab58a2e223443b15820584 (patch) | |
| tree | 89e230df3b43302a542f2cb6869f63e2fb93f6d8 /lib/puppet/node | |
| parent | 1b517d2fb048603bd1743a662bde74e8ae4b13dc (diff) | |
| parent | a74ec60d33dee1c592ec858faeccc23d7a7b79f3 (diff) | |
| download | puppet-8aee40de69e6fe8d67ab58a2e223443b15820584.tar.gz puppet-8aee40de69e6fe8d67ab58a2e223443b15820584.tar.xz puppet-8aee40de69e6fe8d67ab58a2e223443b15820584.zip | |
Merge branch '0.24.x' Removed the 'after' blocks that call Type.clear,
since that method is deprecated.
Conflicts:
CHANGELOG
bin/puppetca
lib/puppet/file_serving/fileset.rb
lib/puppet/network/xmlrpc/client.rb
lib/puppet/type/file/selcontext.rb
spec/unit/file_serving/metadata.rb
spec/unit/type/file.rb
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] |
