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


Daniel V. Klein Wrote:
-------------------------------------------------------
> After this, you have the short hostname in
> $(short_host[1]), and the long one has always been
> available as $(sys.fqhost)


I like your regextract idea.  It's short and elegant, but that one-liner would 
not take care of the case-sensitivity problem so you'd still need two more 
statements to do the case conversion.

I started out using $(sys.fqhost), but I ran into a host where the FQDN and the 
hostname both returned only the hostname without the domain.  I couldn't figure 
out why it was doing that, so I thought it was best to just work around it in 
case there were others.  Then I ran into an internal host that did not have a 
domain defined, hence my trapping for an undefined domain.

So, yes, it's a bit of work, but in my situation it covers all the bases pretty 
well.

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

Reply via email to