On Aug 27, 2008, at 5:21 AM, Brice Figureau wrote:

>
> On Tue, 2008-08-26 at 21:14 -0700, Luke Kanies wrote:
>> On Aug 26, 2008, at 1:56 PM, Brice Figureau wrote:
>>
>>>
>>> This is the second attempt of a daemontools (only for the moment)
>>> provider for the service type. I added a rspec unit type, and tried
>>> to take into account all of Luke's previous comments.
>>
>> This is great stuff, and I'd accept as-is.
>
> Thanks. Give me some more time so that I can finish the runit part,  
> and
> fix a few thing :-)
>
> I do have a question though, when does the provider "self.instances"
> method is called for service prodider?
> I don't seem to be able to trigger a call to this method by running  
> sth
> along the line of:
>
> puppet daemontools.pp
> with daemontools.pp that looks like:
> service {
>  "test":
>    ensure => running, provider => "daemontools";
> }
>
> Maybe it's called only when doing a full transaction between a client
> and master?
> I'll do more test to find that.

Unless you have prefetch supported, 'instances' is never used by  
puppetd.  It's used by 'ralsh', though -- just run 'ralsh service' on  
a machine that supports this provider.

>
>> In fact, the only comment I have is...
>>> +
>>> +    # find the service dir on this node
>>> +    def servicedir
>>> +      unless defined?(@servicedir) and @servicedir
>>> +        ["/service", "/etc/service","/var/lib/svscan"].each do | 
>>> path|
>>> +            if FileTest.exist?(path)
>>> +                @servicedir = path
>>> +                break
>>> +            end
>>> +        end
>>> +        raise "Could not find service directory" unless @servicedir
>>> +      end
>>> +      @servicedir
>>> +    end
>>> +
>>> +    # returns the daemon dir on this node
>>> +    def self.daemondir
>>> +        self.class.defpath
>>> +    end
>>
>> Why is the servicedir (which is an instance method) mixed in with the
>> class methods like this?  It makes me think there was a mistake
>> somewhere.
>
> Actually, I think you are right, it could well be a class method (and
> then I leave it here, I even think that I first designed it as a class
> method and changed my mind later) or moved with the other instance
> method.
>
>> I'd prefer it be moved down to the other instance methods.
>
> OK, will do. I also have a few improvements to add.
>
>> Obviously that's a really niggling point, though.
>>
>> I can't tell indentation from email, but please make sure you're  
>> using
>> 4-space indentation.
>
> Yes, this is indented with 4 spaces, but I think there are a few lines
> with leading spaces (my editor doesn't seem to show them, I noticed  
> them
> when I rebased yesterday). I'll fix this in a new commit.
>
> To get this project (when it'll be finished) included, should I file a
> redmine ticket ?

Please do.

-- 
The chief lesson I have learned in a long life is that the only way to
make a man trustworthy is to trust him; and the surest way to make him
untrustworthy is to distrust him and show your distrust.
     -- Henry L. Stimson
---------------------------------------------------------------------
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to