Skip to content

Commit

Permalink
(FACT-2714) Check if dhcpinfo command is in path, if it is not, defau…
Browse files Browse the repository at this point in the history
…lt to solaris 10 path.
  • Loading branch information
BogdanIrimie committed Aug 6, 2020
1 parent 6b97bb4 commit bdc64d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 5 additions & 0 deletions lib/facter/resolvers/solaris/ffi/ffi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ module FFI
INET_ADDRSTRLEN = 16
INET6_ADDRSTRLEN = 46
end

BINDINGS_KEY = {
FFI::AF_INET => :bindings,
FFI::AF_INET6 => :bindings6
}.freeze
end
end
end
8 changes: 2 additions & 6 deletions lib/facter/resolvers/solaris/networking_resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ class Networking < BaseResolver
@fact_list ||= {}
@interfaces = {}

BINDINGS_KEY = {
FFI::AF_INET => :bindings,
FFI::AF_INET6 => :bindings6
}.freeze

class << self
private

Expand Down Expand Up @@ -141,7 +136,8 @@ def primary_interface
end

def add_dhcp(interface_name)
result = Facter::Core::Execution.execute("dhcpinfo -i #{interface_name} ServerID", logger: log)
dhcpinfo_command = Facter::Core::Execution.which('dhcpinfo') || '/sbin/dhcpinfo'
result = Facter::Core::Execution.execute("#{dhcpinfo_command} -i #{interface_name} ServerID", logger: log)

@interfaces[interface_name][:dhcp] = result.chomp
end
Expand Down

0 comments on commit bdc64d6

Please sign in to comment.