[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: DefineInGroup doesn't work even inside group
From: |
Mark . Burgess |
Subject: |
Re: DefineInGroup doesn't work even inside group |
Date: |
Thu, 9 Dec 2004 21:04:23 +0100 (MET) |
Thanks. This is fixed in the next snapshot now.
M
On 24 Nov, Dmitry Tarasov wrote:
> Hi,
>
> I have updated cfengine from 2.1.3 to 2.1.11 and found that cfagent
> produces "DefineInGroup used outside edit-group", but the DefineInGroup
> directive is located inside the BeginGroupIfNoMatch ..... EndGroup
> block. The following block did work ok before updating, but it doesn't
> work now.
>
>
> Thanks
>
>
>
> PROBLEM SCRIPT:
>
> #!/usr/local/sbin/cfagent -q -v --inform -f
>
> control:
> AddInstallable = ( nss_should_be_fixed nss_were_updated )
> ifElapsed = ( 0 )
> actionsequence = ( editfiles shellcommands )
>
> editfiles:
> any::
> {
> /home/dias/cfe-test/etc/resolv.conf
>
> LocateLineMatching "^nameserver.*$"
> BeginGroupIfNoMatch "^nameserver 11.11.11.11$"
> DefineInGroup "nss_should_be_fixed"
> EndGroup
> BeginGroupIfNotDefined "nss_should_be_fixed"
> IncrementPointer "1"
> BeginGroupIfNoMatch "^nameserver 22.22.22.22$"
> DefineInGroup "nss_should_be_fixed"
> EndGroup
> EndGroup
>
>
> DeleteLinesAfterThisMatching "^.*nameserver.*$"
>
> BeginGroupIfDefined "nss_should_be_fixed"
> CatchAbort
> ResetSearch "1"
> DeleteLinesStarting "nameserver"
> GotoLastLine
> InsertLine "nameserver 11.11.11.11"
> InsertLine "nameserver 22.22.22.22"
> EndGroup
> DefineClasses "nss_were_updated"
>
> }
>
>
>
> alerts:
> nss_were_updated::
> "NAMESERVERS WERE UPDATED !!!!!"
>
> shellcommands:
> any::
> "/bin/cat /home/dias/cfe-test/etc/resolv.conf"
> ---------------------------------------------------------------------------------
> OUTPUT:
> engine::./test.cf:49: DefineInGroup used outside edit-group
> cf:cfengine::./test.cf:49: DefineInGroup used outside edit-group
> cfengine:: Executing script /bin/cat
> /home/dias/cfe-test/etc/resolv.conf...(timeout=0,uid=-1,gid=-1)
> cfengine::/bin/cat /home/: nameserver 127.0.0.1
> cfengine:: Finished script /bin/cat /home/dias/cfe-test/etc/resolv.conf
>
> OUTPUT in verbose mode:
>
> Begin editing /home/dias/cfe-test/etc/resolv.conf
> Edit: Search ended at line 1
> Edit: (Found nameserver 127.0.0.1)
> (Begin Group - no match for ^nameserver 11.11.11.11$)
> cf:cfengine::./test.cf:49: DefineInGroup used outside edit-group
> (End Group)
> (Begin Group - class nss_should_be_fixed not defined)
> inc pointer failed, still at 1
> (Begin Group - no match for ^nameserver 22.22.22.22$)
> cf:cfengine::./test.cf:49: DefineInGroup used outside edit-group
> (End Group)
> (End Group)
> (Begin Group - class nss_should_be_fixed not defined - skipping)
> End editing /home/dias/cfe-test/etc/resolv.conf
>
>
>
>
>
> _______________________________________________
> Bug-cfengine mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/bug-cfengine
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272 Email: address@hidden
Fax : +47 22453205 WWW : http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: DefineInGroup doesn't work even inside group,
Mark . Burgess <=