Skip to content

Instantly share code, notes, and snippets.

@fiddyspence
Last active August 29, 2015 14:05
Show Gist options
  • Save fiddyspence/fadba0042c4b80a5c1f7 to your computer and use it in GitHub Desktop.
Save fiddyspence/fadba0042c4b80a5c1f7 to your computer and use it in GitHub Desktop.
ruby 1.9.3p448 (2013-06-27) [i386-mingw32]
C:\Program Files (x86)\Puppet Labs\Puppet\bin>facter domain
Could not retrieve domain: undefined method `gsub' for nil:NilClass
The system cannot find the path specified.
The system cannot find the path specified.
Using Facter::Util::Resolution.exec with a shell built-in is deprecated. Most bu
ilt-ins can be replaced with native ruby commands. If you really have to run a b
uilt-in, pass "cmd /c your_builtin" as a command (command responsible for this m
essage was "dnsdomainname 2> /dev/null")
C:\Program Files (x86)\Puppet Labs\Puppet\bin>
spenceware:codeonboarding fids$ diff bootstrapdomain.rb domain.rb
31a32
> windows_hostname = 'hostname > NUL'
36a38,39
> elsif Facter.value(:kernel) == "windows"
> windows_hostname
45c48
< elsif domain = Facter::Util::Resolution.exec('dnsdomainname 2> /dev/null') \
---
> elsif Facter.value(:kernel) != "windows" and domain = Facter::Util::Resolution.exec('dnsdomainname 2> /dev/null') \
79,80c82,85
< domain = nic.DNSDomain
< break
---
> if nic.DNSDomain && nic.DNSDomain.length > 0
> domain = nic.DNSDomain
> break
> end
82a88,90
>
> domain ||= ''
>
86d93
<
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment