CP-9795: Improve comparison of hostname against localhost
CP-9795: Improve comparison of hostname against localhost

On RHEL-based systems prior to 7, the output of hostname with no
hostname setup is "localhost.localdomain".  On RHEL 7-based systems and
Debian-based systems, the output of hostname is "localhost".  Compare
the name label against either of these values for resilience.

Signed-off-by: Ross Lagerwall <d769abb2ab51a4b3c6d56e5ec4ccdd860b82f07a@citrix.com>

rafalmiel/xen-api,euanh/xen-api,euanh/xen-api,Frezzle/xen-api,agimofcarmen/xen-api,thomassa/xen-api,srowe/xen-api,robertbreker/xen-api,koushikcgit/xen-api,rafalmiel/xen-api,cheng--zhang/xen-api,thomassa/xen-api,robertbreker/xen-api,djs55/xen-api,koushikcgit/xen-api,srowe/xen-api,cheng-z/xen-api,guard163/xen-api,djs55/xen-api,euanh/xen-api,simonjbeaumont/xen-api,jjd27/xen-api,koushikcgit/xen-api,guard163/xen-api,djs55/xen-api,robertbreker/xen-api,rafalmiel/xen-api,thomassa/xen-api,agimofcarmen/xen-api,cheng--zhang/xen-api,djs55/xen-api,anoobs/xen-api,cheng-z/xen-api,huizh/xen-api,rafalmiel/xen-api,thomassa/xen-api,djs55/xen-api,guard163/xen-api,anoobs/xen-api,robertbreker/xen-api,vasilenkomike/xen-api,salvocambria/xen-api,vasilenkomike/xen-api,huizh/xen-api,srowe/xen-api,cheng-z/xen-api,simonjbeaumont/xen-api,thomassa/xen-api,koushikcgit/xen-api,euanh/xen-api,thomassa/xen-api,huizh/xen-api,jjd27/xen-api,guard163/xen-api,agimofcarmen/xen-api,jjd27/xen-api,vasilenkomike/xen-api,vasilenkomike/xen-api,Frezzle/xen-api,koushikcgit/xen-api,cheng-z/xen-api,cheng-z/xen-api,cheng--zhang/xen-api,srowe/xen-api,Frezzle/xen-api,simonjbeaumont/xen-api,vasilenkomike/xen-api,robertbreker/xen-api,Frezzle/xen-api,euanh/xen-api,salvocambria/xen-api,salvocambria/xen-api,Frezzle/xen-api,simonjbeaumont/xen-api,agimofcarmen/xen-api,huizh/xen-api,anoobs/xen-api,cheng-z/xen-api,guard163/xen-api,srowe/xen-api,euanh/xen-api,anoobs/xen-api,koushikcgit/xen-api,robertbreker/xen-api,cheng-z/xen-api,huizh/xen-api,guard163/xen-api,cheng--zhang/xen-api,agimofcarmen/xen-api,simonjbeaumont/xen-api,rafalmiel/xen-api,vasilenkomike/xen-api,jjd27/xen-api,salvocambria/xen-api,salvocambria/xen-api,anoobs/xen-api,agimofcarmen/xen-api,cheng--zhang/xen-api,cheng--zhang/xen-api,jjd27/xen-api,salvocambria/xen-api,simonjbeaumont/xen-api,cheng--zhang/xen-api,djs55/xen-api,rafalmiel/xen-api,huizh/xen-api,anoobs/xen-api,jjd27/xen-api