On May 2, 2009, at 4:46 PM, Brice Figureau wrote:
>
> All the snippets tests were failing because some parser and scope
> tests activated storeconfigs without reseting the state.
> Activating storeconfigs is not undoable at the moment by just
> setting storeconfig=false as some terminus are changed.
>
> Signed-off-by: Brice Figureau <[email protected]>
> ---
> lib/puppet/defaults.rb | 9 +++++++++
> test/language/parser.rb | 2 ++
> test/language/scope.rb | 1 +
> 3 files changed, 12 insertions(+), 0 deletions(-)
>
> diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
> index bcfa833..524e26f 100644
> --- a/lib/puppet/defaults.rb
> +++ b/lib/puppet/defaults.rb
> @@ -712,9 +712,18 @@ module Puppet
> require 'puppet/resource/catalog'
> if value
> raise "StoreConfigs not supported without
> ActiveRecord 2.3" unless Puppet.features.rails?
> + if @node_cache_class != :active_record
> + @catalog_cache_class =
> Puppet::Resource::Catalog.indirection.cache_class
> + @facts_cache_class =
> Puppet::Node::Facts.indirection.cache_class
> + @node_cache_class =
> Puppet::Node.indirection.cache_class
> + end
> Puppet::Resource::Catalog.cache_class
> = :active_record unless Puppet.settings[:async_storeconfigs]
> Puppet::Node::Facts.cache_class = :active_record
> Puppet::Node.cache_class = :active_record
> + elsif @node_cache_chass != :active_record
Looks like you've got a bit of a typo here: s/chass/class/
>
> + Puppet::Resource::Catalog.cache_class =
> @catalog_cache_class
> + Puppet::Node::Facts.cache_class =
> @facts_cache_class
> + Puppet::Node.cache_class = @node_cache_class
There are tests in integration/defaults.rb for setting storeconfigs to
true; it'd be great to have them for setting it to false.
>
> end
> end
> }
> diff --git a/test/language/parser.rb b/test/language/parser.rb
> index 30baea4..832e1f4 100755
> --- a/test/language/parser.rb
> +++ b/test/language/parser.rb
> @@ -496,6 +496,7 @@ file { "/tmp/yayness":
> check.call(res, "multiresource")
> end
> end
> + Puppet[:storeconfigs] = false if Puppet.features.rails?
> end
>
> def test_collections
> @@ -523,6 +524,7 @@ file { "/tmp/yayness":
> assert_instance_of(AST::Collection, coll)
> assert_equal(form, coll.form)
> end
> + Puppet[:storeconfigs] = false if Puppet.features.rails?
> end
>
> def test_collectionexpressions
> diff --git a/test/language/scope.rb b/test/language/scope.rb
> index 0fbc17d..f41700a 100755
> --- a/test/language/scope.rb
> +++ b/test/language/scope.rb
> @@ -442,6 +442,7 @@ Host <<||>>"
> assert(flat.find{|o| o.name == name }, "Did not find
> #{name}")
> end
> }
> + Puppet[:storeconfigs] = false
> end
> else
> $stderr.puts "No ActiveRecord -- skipping collection tests"
> --
> 1.6.0.2
>
>
> >
--
Should I say "I believe in physics", or "I know that physics is true"?
-- Ludwig Wittgenstein, On Certainty, 602.
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---