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: Wipf, Stefan
Subject: Re: Module variables being set late
Date: Wed, 07 Jan 2004 17:37:30 -0600

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



address@hidden 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:  address@hidden
> Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> _______________________________________________
> Help-cfengine mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/help-cfengine

-- 
Stefan Wipf
address@hidden




reply via email to

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