help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: order in which imports happen?


From: Jamie Wilkinson
Subject: Re: order in which imports happen?
Date: Tue, 06 Dec 2005 13:55:04 +1100

On Tue, 2005-12-06 at 15:31 +1300, Steve Wray wrote:

> the file generic_environment.cf gets imported *after* aptconf.cf which 
> means that variables which are set in generic_environment.cf don't make 
> it into aptconf.cf
> 
> I've had to resort to importing all of my generic*.cf directly in my 
> cfagent.conf which makes it less maintainable and, well, ugly.
> 
> 
> Any ideas how to force a set of files to be imported in the right order?

The parser, for better or worse, imports all files at the end of the
current file; so what's happening is:

* cfagent.conf gets parsed, a list of imports is built
* generic.cf gets parsed, and a list of imports is built, including
generic_environment.cf, appended to the list
* ...
* aptconf.cf gets parsed
* ...
* generic_environment.cf gets parsed

Yeah, it's pretty weird, when everything else on the planet handles
include files in place.  You could work around it by pushing everything
after generic.cf into another file, which would then have its imports
put after the generic imports.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]