On Nov 5, 2008, at 10:29 AM, Lorenz Schori wrote:

>
> Hi Luke
>
> On Tue, 4 Nov 2008 12:11:54 -0600
> Luke Kanies <[EMAIL PROTECTED]> wrote:
>
>>> files and play with them on a vanilla puppet installation. See the
>>> first one on how to install and use the plugin:
>>> http://znerol.ch/files/vertical_dependencies.rb
>>> http://znerol.ch/files/vertical-dependencies-test.pp
>>
>> Great.  Are these available in a git repo somewhere?
>
> Fresh and shiny (hopefully):
> git remote add znerol git://znerol.ch/puppet
>
> Changes against master are in branch feature/master/vertdep. I did not
> include the plugin-variant because it only works if puppet runs in
> standalone mode like i mentioned in another posting.
>
> Tests are lacking, i was not able to figure out how to test
> metaparameters using rspec. Some suggestions on where to start? Which
> tests to look at for reference?
>
> I did some more research in redmine and found #428 (Deletion should
> invert sort order) which seems to be very related to what i am after.
> I'm thinking about some general model for dependency handling and will
> post again in a new therad if i'm able to come up with something
> usable...

It's a nice small patch; I'll have to help you get tests for it before  
we consider applying it, but that shouldn't be too hard.

I've got a couple of issues with it, though.  The 'Type' class already  
has a 'deleting?' method you can use to determine whether a resource  
is being deleted -- currently it has the same behaviour you're using,  
but it allows a resource type to override what deletion means.  This  
is useful for things like package purging -- it's a form of deletion  
that doesn't use :absent.

Also, what's with setting 'self.class.direction = (ens  
== :absent ? :out : :in)'?  That sets a class instance variable, which  
means it will affect every above/below parameter, which can't be what  
you mean.  I think the only way to get the behaviour you want is to do  
some refactoring -- maybe use an instance-level 'direction' method  
that normally just returns the class's direction and then override the  
direction instance method in theseparams (preferable), or refactor the  
'direction' method to accept the ensure value as an argument.

-- 
The conception of two people living together for twenty-five years
without having a cross word suggests a lack of spirit only to be
admired in sheep. --Alan Patrick Herbert
---------------------------------------------------------------------
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 puppet-dev@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to