Forum: Cfengine Help
Subject: Re: Class case sensitivity
Author: babudro
Link to topic: https://cfengine.com/forum/read.php?3,19548,19559#msg-19559

Hi Neil.

I'm the one who posted that question regarding the hostnames about a month or 
so ago.  My "feature request" is on the Bug Tracker (issue #358).

The short-term solution I came up with was to define global variables for the 
classes I wanted to be case-insensitive, like this:



    linux::
      "short_hostname" string => execresult("/bin/hostname -s | /usr/bin/tr 
'[:upper:]' '[:lower:]'"
    linux.domain_missing::
      "long_hostname"  string => "$(short_hostname).$(default_domain)";
    linux.!domain_missing::
      "long_hostname"  string => execresult("/bin/hostname -f | /usr/bin/tr 
'[:upper:]' '[:lower:]'"

  classes:
    "domain_missing" expression => strcmp("$(sys.domain)", "undefined_domain");


-- Angelo

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to