gnu.cfengine.help
[Top] [All Lists]

RegCmp

Subject: RegCmp
From: SimonB <barrett.simon@xxxxxxxxx>
Date: Thu, 1 May 2008 03:13:39 -0700 (PDT)
Newsgroups: gnu.cfengine.help

I am trying to set a class based on the following:

classes:
  admin     = ( RegCmp(".*adm.*","${host}" ))

i.e. Set the admin class if adm is included in the hostname.

The class never gets set. The debug output is as follows:

HandleFunctionObject(RegCmp(".*adm.*","${host}" ))
IsBuiltinFunction(RegCmp(".*adm.*","${host}" ))
IsBuiltinFunction: RegCmp(".*adm.*","${host}" )
HandleFunction: RegCmp(".*adm.*","${host}" )
FunctionStringToCode(RegCmp)
Appending [.*adm.*]
ListArg[0]=(.*adm.*)
Appending [${host} ]
ListArg[1]=(${host} )
Check ListLen
ExpandVarstring( .*adm.* )
Add |.*adm.*| to str, waiting at ||
Returning varstring (.*adm.*)
ARG[0] .*adm.*
ExpandVarstring( ${host}  )
Add || to str, waiting at |${host} |
ExtractOuterVarString(${host} ) - syntax verify
Extracted outer variable |${host}|
Returning substring value host
Scanning variable host
Add |nycpadm050 | to str, waiting at ||
Returning varstring (tstadm050 )
ARG[1] tstadm050
List source = (11)[tstadm050 ]
SplitStringAsItemList(tstadm050 ,:)
Appending [tstadm050 ]
ExpandVarstring( XX_CF_opposite_any_XX )
Add |XX_CF_opposite_any_XX| to str, waiting at ||
Returning varstring (XX_CF_opposite_any_XX)
[No match of class XX_CF_opposite_any_XX]


The syntax looks OK (based on what I've read elsewhere). I've tried
the ${host} with or without quotes, but still no joy. Does anyone have
any suggestions as to where I am going wrong ?

Many thanks

Simon

<Prev in Thread] Current Thread [Next in Thread>
  • RegCmp, SimonB <=