[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Request: Suppress error "Non-convergent edit operation ReplaceAll" when
From: |
François LANGE. |
Subject: |
Request: Suppress error "Non-convergent edit operation ReplaceAll" when included in a BeginGroupIfNoLineMatching. |
Date: |
Thu, 26 Aug 2004 10:15:03 +0200 |
User-agent: |
Internet Messaging Program (IMP) 3.2.1 |
Good morning,
The error message has got a sense outside a group begin when the group avoid
multiple execution of the replacement.
In the small sample the group avoid multiple executions of replace.
Can the code change to provide the warning but continue the execution.
This could be made with the following option:
1) An argument which could disable some warning like :
Non-convergent edit operation
2) Remove the return false which is a little bit hard.
Thanks
Best regards François LANGE.
editfiles:
# { editfiles
oratab.oraclehome.stmt_stmt::
{ /u01/home/oracle/oracle_cron
AutoCreate
BeginGroupIfNoLineMatching ".*clean_up.sh.*"
Append "#Append by cfengine ${date}"
Append "40 23 * * * test -
x /u01/home/oracle/ksh/clean_up.sh && /u01/home/oracle/ksh/clean_up
.sh >/dev/null"
DefineInGroup "restart_cron"
EndGroup
BeginGroupIfNoLineMatching "40 23 \* \* \* test -
x /u01/home/oracle/ksh/clean_up.sh && /u01/home/oracle/ksh/clean_up.sh
> /dev/null"
LocateLineMatching ".*\/clean_up.sh.*"
ReplaceAll ".*clean_up.sh.*" With "40 23 * * *
test -x /u01/home/oracle/ksh/clean_up.sh && /u
01/home/oracle/ksh/clean_up.sh >/dev/null"
ReplaceLineWith "40 23 * * * test -
x /u01/home/oracle/ksh/clean_up.sh && /u01/home/oracle/ksh
/clean_up.sh >/dev/null"
DefineInGroup "restart_cron"
EndGroup
}
# } editfiles
cfengine:: WARNING: Non-convergent edit operation ReplaceAll [40 23 * * *
test -x /u01/home/oracle/ksh/clean_up.sh && /u01/ho
me/oracle/ksh/clean_up.sh >/dev/null] With [.*clean_up.sh.*]
cfengine:: Line begins [20 20 * * * test -x /u01/home/oracle/ksh]
cfengine:: Replacement matches search string and will thus replace every time -
edit was not done
cfengine:: Error editing file /u01/home/oracle/oracle_cron
In the "item-ext.c" file:
if (regexec(&rx,VBUFF,1,&matchcheck,0) == 0)
{
snprintf(OUTPUT,CF_BUFSIZE*2,"WARNING: Non-convergent edit operation
ReplaceAll [%s] With [%s]",replace,search);
CfLog(cferror,OUTPUT,"");
snprintf(OUTPUT,CF_BUFSIZE*2,"Line begins [%.40s]",ip->name);
CfLog(cferror,OUTPUT,"");
CfLog(cferror,"Replacement matches search string and will thus replace
every time - edit was not done","");
/* return false; To be removed */
}