help-cfengine
[Top][All Lists]
Advanced

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

Re: Module variables being set late


From: Mark . Burgess
Subject: Re: Module variables being set late
Date: Thu, 8 Jan 2004 08:22:04 +0100 (MET)

This seems to be based on old code. The problem is one of reentrance
of the private structures. I cannot comment on this until I get "back into"
the code in the next weeks.

M

On  7 Jan, Wipf, Stefan wrote:
> I previously posted a simple patch for nesting imports:
> Sorry, I don't remember which version of cfengine,
> but the patch is simple enough.
> 
> 
> 
> diff parse.c.original parse.c.fix
> 127c127
> < { struct Item *ptr;
> ---
>> { struct Item *ptr, *nextptr
> 216c216,224
> <    ParseFile(filename,sp);
> ---
>>    nextptr = ptr->next;
>>    while (VIMPORT != NULL) { VIMPORT = VIMPORT->next; }
>>    ParseFile(filename,sp); 
>>    if (VIMPORT != NULL)
>>       {
>>       ptr->next = VIMPORT;
>>       while (VIMPORT->next != NULL) { VIMPORT = VIMPORT->next; }
>>       VIMPORT->next = nextptr;
>>       }
> 
> 
> 
> This patch will change the behavior as follows:
> 
> example:
> 
> cfagent.conf:
>  import: 
>   cf.classes
>   cf.variables
>   cf.main
> 
> cf.classes:
>  import:
>   cf.classes1
>   cf.classes2
>   ...
> 
> Without the patch:
> importing cf.classes
> importing cf.variables
> importing cf.main
> importing cf.classes1
> importing cf.classes2
> 
> With the patch:
> importing cf.classes
> importing cf.classes1
> importing cf.classes2
> importing cf.variables
> importing cf.main
> 
> 
> 
> Mark.Burgess@iu.hio.no wrote:
>> 
>> On  7 Jan, Wheeler, John wrote:
>> >>If you
>> >> follow
>> >> the suggested structure and use cfagent.conf only to import the
>> > content
>> >> of the configuration, then it never matters that imports are done "at
>> > the
>> >> end".
>> > [Wheeler, John]
>> > I didn't realize this was a limitation/feature/characteristic/property
>> > (i.e. don't read into the adjective) of cfengine. I have many nested
>> > imports of cfengine some as deep as 5 levels.
>> >
>> > Is this bad? Will this fail with future releases of cfengine?
>> 
>> No - nesting is ok. But the nesting is evaluated linearly.
>> Nested evaluation is technically challenging and not something
>> I want to spent time on.
>> 
>> M
>> 
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> Work: +47 22453272            Email:  Mark.Burgess@iu.hio.no
>> Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> 
>> _______________________________________________
>> Help-cfengine mailing list
>> Help-cfengine@gnu.org
>> http://mail.gnu.org/mailman/listinfo/help-cfengine
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272            Email:  Mark.Burgess@iu.hio.no
Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





reply via email to

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