help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Thanks. --- RE: special feature or dark area??


From: Guolin Cheng
Subject: Thanks. --- RE: special feature or dark area??
Date: Wed, 1 Sep 2004 23:15:11 -0700

Mark,

 Thanks. I know some languages have a definition like " A valid identifier is a 
sequence of one or more letters, digits or underline symbols(_)...." :)

 But my question is: becasue some of my hostnames have hyphen characters, and I 
figure out that "hyphened" hostnames fail to work as classes directly, I want 
to make sure that it is not a bug and the behavior will keep intact for a while 
since we implement cfengine in production enviroment.

 Now I will use "ops_test2" instead of "ops-test2" as class names, either in 
cf.groups or directly in cf.main. It is not a big problem for not-very-smart 
users like me, as long as this rule -- replace hyphen with underbar -- will 
remain valid for a long time.

 Thanks.
 --Guolin

 


-----Original Message-----
From:   Mark.Burgess@iu.hio.no [mailto:Mark.Burgess@iu.hio.no]
Sent:   Wed 9/1/2004 10:15 PM
To:     Guolin Cheng
Cc:     help-cfengine@gnu.org; ops; Mark.Burgess@iu.hio.no
Subject:        Re: special feature or dark area?? hostname's hyphen character 
brings inconsistency in cfengine

Hyphens cannot be used in class names, just as they cannot be used in
variable names in any language I know of. Underscores can be used so you
must have a different problem. I am guessing that your class definition
is parsed after your rule to echo a string. 

This all works fine, it is used all the time for internal stuff.
M

On  1 Sep, Guolin Cheng wrote:
> Hi, 
> 
>   We got a problem to implement cfengine to hosts with hyphen
> character(s) in their names like "ops-test2". According to our tests, we
> can use either "ops-test2" or "ops_test2" in group|class definitions, or
> take advantage of group definitions in NIS netgroup map in cf.groups
> file.  But if we directly use hostnames to work as class names in
> cf.main, we find that "ops-test2" class will fails, while "ops_test2"
> class works fine.
> 
>   If this a special feature? Or just a dark area, bug needs to be fixed
> soon?  My cfengine is 2.1.7p1 on Linux, we have the same issue for older
> versions as well. Thanks.
> 
>  The following are related statements in my cf.groups and cf.main
> configurations files, both are included in cfagent.conf. 
> 
> ------------------------------------------------------------------------
> ------------------------------------------------------------------------
> ------------------------------------------------------
>  Cf.groups:
>  .......
>   ## testing hyphen characters in hostnames,
>    opsTest2Group1 = ( ops-test2 )
>    opsTest2Group2 = ( ops_test2 )
>  .......
> 
> 
> Cf.main:
>  
>  .............
> shellcommands:
> 
>   ops-test2::
>     "/bin/echo ops-test2, If this line is displayed, then host names
> work with hyphen unchanged"
> 
>   ops_test2::
>     "/bin/echo ops_test2, If this line is displayed, then host names
> work with hyphen replaced with underbar."
> 
>   opsTest2Group1::
>     "/bin/echo opsTest2Group1, If this line is displayed, then group
> definitions can have host names with hyphen."
> 
>   opsTest2Group2::
> "/bin/echo opsTest2Group2, If this line is displayed, then group
> definitions can have host names with hyphen replaced with underbar."
> ........ 
> 
> The testing results are:
> Case 1: ( with the above configurations )
> 
> [root@ops-test2 inputs]# cfagent -q
> cf:cfengine::/var/lib/cfengine2/inputs/cf.main:1095: scripts or commands
> must have absolute path names 
> cfengine: concerns: ops-test2::
> [root@ops-test2 inputs]# 
> 
> Case 2: comment out the "ops-test2::" stanza from cf.main file only,
> then the results are:
> [root@ops-test2 inputs]# cfagent -q
> cfengine:ops-test2:/bin/echo ops_t: ops_test2, If this line is
> displayed, then host names work with hyphen replaced with underbar.
> cfengine:ops-test2:/bin/echo opsTe: opsTest2Group1, If this line is
> displayed, then group definitions can have host names with hyphen.
> cfengine:ops-test2:/bin/echo opsTe: opsTest2Group2, If this line is
> displayed, then group definitions can have host names with hyphen
> replaced with underbar.
> 
> Any ideas and suggestions? Thanks a lot.
> 
> --Guolin Cheng
> 
> 
> 
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272            Email:  Mark.Burgess@iu.hio.no
Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~







reply via email to

[Prev in Thread] Current Thread [Next in Thread]