On May 14, 2010, at 2:17 PM, R.I.Pienaar wrote:

> hey,
> 
> ----- "Luke Kanies" <[email protected]> wrote:
> 
>> Yep.
>> 
>> It's plenty dangerous.  In particular, it's probably pretty easy to
>> get cycles in your graph now.  E.g., say you do this:
>> 
>> Stage[pre] -> Stage[main] # yay new syntax
>> 
>> class apt {
>>  file { "/some/apt/config": ensure => present }
>>  exec { "/usr/bin/apt-get update": require => File[/some/apt/config],
>> stage => pre }
>> }
>> 
>> Boom.  You've got a cycle.  The config file is still in 'main', the
>> exec is in 'pre', main depends on pre, and the exec depends on the
>> file.
> 
> 
> since a specific stage isnt specified in the file, could the dependency pull 
> it into that stage?
> 
> You'd still have a deadlock situation when there are resources in multiple 
> stages depending on a resource - they cant pull it into both stages - but 
> this should be a situation you can detect and report with a specific error 
> message that makes it clear thats the situation rather than the usual 
> resource cycle spew?

I'm sure it could, but this is where things just start to get hairy and gross.

Before too long your pre stage would be completely full because we'd followed 
the dependency chain and found that everything was moved over.

If this is something we're concerned about, I'd rather move back to stages only 
affecting classes, forcing you to draw clean lines and move the whole chunk 
into a given stage.  Anything else becomes too magical and thus too 
unmaintainable.  It also discourages direct cross-boundary relationships (that 
is, it discourages depending on a resource rather than its containing class).

>> This is one reason why I wanted to restrict the stages to just classes
>> - it would at least discourage this ability, if not outright prohibit
>> it.
>> 
>> But in the end, it's probably better to leave the sharp knives lying
>> around than to limit people here.



-- 
An ounce of action is worth a ton of theory.  --Friedrich Engels
---------------------------------------------------------------------
Luke Kanies  -|-   http://puppetlabs.com   -|-   +1(615)594-8199

-- 
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