[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: special feature or dark area?? hostname's hyphen character brings in
From: |
Mark . Burgess |
Subject: |
Re: special feature or dark area?? hostname's hyphen character brings inconsistency in cfengine |
Date: |
Thu, 2 Sep 2004 07:15:09 +0200 (MEST) |
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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~