opscode/ohai — pull request #182 by lamont-granquist (2013-08-28 00:20:59+00:00)
Title: fall back to hostname if hostname -f broken

stop stabbing ourselves in the eye.

in darwin, openbsd, netbsd, freebsd, etc we just use 'hostname'
which is whatever is set on the box. on linux, we're trying to be
clever and using 'hostname -f' which is in some sense more canonically
correct way to resolve the hostname, but requires doing DNS lookups.

since we don't bother with that on other operating systems, this is
clearly not a requirement, however, and if it fails, we can fall
back to hostname. if people have flaky DNS going on, they need to
make sure their hostnames on the box match the name in DNS and/or they
need to be setting their node_name's correctly in config.rb -- either
way i'm perfectly happy creating that problem via solving this one.