On 05/13/2011 02:49 AM, Mo Morsi wrote:
On 05/11/2011 06:04 AM, Mark McLoughlin wrote:
>>> I'm a bit surprised to see all this happening in http_method=
>>>
>>> Care to explain why, just for my own education? :)
>>
>>
>> Sure. When it comes to puppet resource types and providers you can only
>> perform operations in properties, for example in the 'service' provider
>> type, setting the 'ensure' property to 'running' will invoke
'service
>> <name> start', while setting the 'enable' property to
'true' will invoke
>> 'chkconfig <name> on'.
>>
>> Honestly wasn't sure what the best name for the property to actual
>> perform the operation in in this case, if you have a better suggestion
>> than 'http_method', I'm all ears.
>
> Okay, after reading a bit more I'm starting to grok it :)
>
> I'm still struggling to convince myself that we can be sure all the
> resource parameters are set before the http_method property is assigned
> to - i.e. that @resource[:uri] is guaranteed to be set before
> http_method= is called.
>
This occurs because uri is a property where as http_method is a
parameter. Properties are set before the parameter methods are invoked.
Arg sorry, reversed this, s/property/parameter and vice-versa
-Mo