Thanks for your suggestion,
but infact it does not change anything here renaming the modules itself - I
just renamed the module to more usual name without the colon
but as before it works but still throws the syntax error.
I finally just got rid of the syntax error by writing the variable $(host) like
${host} - using curly braces it works without throwing errors
Using curly braces for the variable I can write it using a colon, with or
without quotes - It always works without errors.
@ Mark: Maybe you ought to update the example in your documentation accordingly?
(https://cfengine.com/inside/manuals/cf2-Modularize#Preparatory-modules )
(I am currently using 2.2.10 from DAG repositories for RHEL 5)
Cheers to everyone and a Happy weekend ...
Andreas
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Paul Krizak
Gesendet: Freitag, 26. Februar 2010 16:16
An: [email protected]
Betreff: Re: cf2: Mysterious Syntax error
That's not how I've ever used PrepModule (with quotes) -- here's what my
syntax looks like:
loaded_cfengine_version = ( PrepModule(cfengine_version, "") )
I also don't name my modules with colons in the filename...
Paul Krizak 7171 Southwest Pkwy MS B200.3A
Senior Systems Engineer Austin, TX 78735
Advanced Micro Devices Desk: (512) 602-8775
Linux/Unix Systems Engineering Cell: (512) 791-0686
Silicon Design Division Fax: (512) 602-0468
On 02/26/10 04:42, [email protected] wrote:
> Hi there ,
>
> the following line gives me errors although either way infact it seems
> to work as expected.
>
> Whats the problem - how do I have to write it? Where is my error?
>
> cf.groups contains the following:
>
> groups:
>
> # this preparatory module sets groups from contents of hostlist.xml
>
> services = ( PrepModule("module:services", "$(host)") )
>
> Output of cfagent -vqKn is:
>
> Looking for an input file cf.groups
>
> ---------------------------------------------------------------------
>
> Plug-in `module:services'
>
> ---------------------------------------------------------------------
>
> Exec module [/var/cfengine/modules/module:services buex-01-08]
>
> Activated classes: unused_111
>
> cf:cfengine:buex-01-08:/var/cfengine/inputs/cf.groups:17: Quoted scripts
> must begin with / for absolute path
>
> cf:cfengine:buex-01-08:/var/cfengine/inputs/cf.groups:17: syntax error
>
> Written like this:
>
> services = (PrepModule("module:services", $(host)))
>
> it gives me:
>
> cf:cfengine:buex-01-08:/var/cfengine/inputs/cf.groups:17: Bracket
> mismatch, in [class=))], level = -2
>
> Allright - if I add the spaces and quotes:
>
> services = ( PrepModule("module:services", "$(host)") )
>
> I get:
>
> cf:cfengine:buex-01-08:/var/cfengine/inputs/cf.groups:17: Quoted scripts
> must begin with / for absolute path
>
> cf:cfengine:buex-01-08:/var/cfengine/inputs/cf.groups:17: syntax error
>
> Written like this (spaces - no quotes on variable) :
>
> services = ( PrepModule("module:services", $(host)) )
>
> Results in:
>
> cf:cfengine:buex-01-08:/var/cfengine/inputs/cf.groups:17: syntax error
>
> Thank you very much in advance for helping me out .
>
> Best regards,
>
> Andreas
>
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine