diff options
| author | Matt Robinson <matt@puppetlabs.com> | 2010-07-01 12:01:46 -0700 |
|---|---|---|
| committer | Markus Roberts <Markus@reality.com> | 2010-07-01 13:48:03 -0700 |
| commit | 174e02a2b71fd51ff27f9186526352d79253da26 (patch) | |
| tree | bd7d78e2eb18dd3394344c4f0b3112b0d52a49ba /lib/puppet/util | |
| parent | 62e3b611e65deab60c615eac553cac9aa7e76d9d (diff) | |
| download | puppet-174e02a2b71fd51ff27f9186526352d79253da26.tar.gz puppet-174e02a2b71fd51ff27f9186526352d79253da26.tar.xz puppet-174e02a2b71fd51ff27f9186526352d79253da26.zip | |
[#4090] Change how RunMode instances are created so that an object for each RunMode is only created once instead of every time it's called
Got lots of unpredictable test failures, presumably because a new
RunMode was being created every time we accessed the RunMode.
Diffstat (limited to 'lib/puppet/util')
| -rw-r--r-- | lib/puppet/util/run_mode.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/puppet/util/run_mode.rb b/lib/puppet/util/run_mode.rb index 08f2c851f..029c1f921 100644 --- a/lib/puppet/util/run_mode.rb +++ b/lib/puppet/util/run_mode.rb @@ -5,8 +5,14 @@ module Puppet @name = name.to_sym end + @@run_modes = Hash.new {|h, k| h[k] = RunMode.new(k)} + attr :name + def self.[](name) + @@run_modes[name] + end + def master? name == :master end |
