>
> What you are doing byusing the getindices() list variable directly as an 
> arbument to the edit bundle is to iterate over the editing of the file 
> itself, i.e.  you are saying
>
> for each index do
>   edit file(...index ....)
>      edit lines
>
> You should pass the list as @(bundle.list) to the edit_line bundle and use 
> getindices() inside that bundle, so that you get
>
> edit file
>   for each index do
>     edit lines
>
> See an example like set_variable_values in the  COPBL

Thanks for your answer.

I (kind of) "feel" what you say but don't understand. What do you mean
" file(...index ....)"?

In my understanding my solution is less efficient, but should work as
well. No matter how many times I 'call' the edit line 'function' the
initial comment for example should be the same and the a line should
not be re-added if it's in the file already. Obviously this example
shows that I'm wrong.

I think my main problem is that I'm thinking in script-style, not in promises.

I could do a "workaround" (I mean workaround for me) based on the
COPBL example, but I'd like to understand it what's wrong in my
thinking.

Thanks,

Miklos
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to