Re: [Puppet-dev] [PATCH/puppet 1/1] Fix #5610: Prevent unnecessary RAL lookups

2011-03-20 Thread Stefan Schulte
On Sun, Mar 20, 2011 at 08:06:56AM -0700, Jesse A Wolfe wrote: > > > > > > Is there a specific reason why uniqueness_key should be a SORTED list of > > keyattributes? If we do not sort them they appear in the array in the > > same order as the params were defined in the type definition (so the > >

Re: [Puppet-dev] [PATCH/puppet 1/1] Fix #5610: Prevent unnecessary RAL lookups

2011-03-20 Thread Jesse A Wolfe
> > > Is there a specific reason why uniqueness_key should be a SORTED list of > keyattributes? If we do not sort them they appear in the array in the > same order as the params were defined in the type definition (so the > order is still determined) [By type definition I mean the ruby source, > no

Re: [Puppet-dev] [PATCH/puppet 1/1] Fix #5610: Prevent unnecessary RAL lookups

2011-03-16 Thread Stefan Schulte
On Tue, Mar 15, 2011 at 05:50:42PM -0700, Jesse Wolfe wrote: > [...] >def uniqueness_key > -to_resource.uniqueness_key > +self.class.key_attributes.sort_by { |attribute_name| attribute_name.to_s > }.map{ |attribute_name| self[attribute_name] } >end > > [...] > > + describe "when

[Puppet-dev] [PATCH/puppet 1/1] Fix #5610: Prevent unnecessary RAL lookups

2011-03-15 Thread Jesse Wolfe
Reviewed-By: Paul Berry Signed-off-by: Jesse Wolfe --- lib/puppet/type.rb |2 +- spec/unit/type_spec.rb | 13 - 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index 205d809..d24cc85 100644 --- a/lib/puppet/type.rb +++