Skip to content

Commit

Permalink
Merge pull request #16946 from gildub/activate-new-network-discovery
Browse files Browse the repository at this point in the history
Activate network discovery refactor
  • Loading branch information
bdunne authored Feb 21, 2018
2 parents 5e05b8d + 98ab8cb commit 643a4a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ gem "linux_admin", "~>1.2.0", :require => false
gem "log_decorator", "~>0.1", :require => false
gem "manageiq-api-client", "~>0.1.0", :require => false
gem "manageiq-messaging", :require => false, :git => "https://github.com/ManageIQ/manageiq-messaging", :branch => "master"
gem "manageiq-network_discovery", "~>0.1.2", :require => false
gem "memoist", "~>0.15.0", :require => false
gem "mime-types", "~>2.6.1", :path => File.expand_path("mime-types-redirector", __dir__)
gem "more_core_extensions", "~>3.5"
Expand Down
12 changes: 6 additions & 6 deletions app/models/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ def self.discoverByIpRange(starting, ending, options = {:ping => true})
end

discover_options = {:ipaddr => ipaddr,
:usePing => options[:ping],
:ping => options[:ping],
:timeout => options[:timeout],
:discover_types => options[:discover_types],
:credentials => options[:credentials]
Expand Down Expand Up @@ -924,11 +924,11 @@ def self.ost_inspect(ost)
end

def rediscover(ipaddr, discover_types = [:esx])
require 'manageiq-network_discovery'
ost = OpenStruct.new(:usePing => true, :discover_types => discover_types, :ipaddr => ipaddr)
require 'manageiq/network_discovery/discovery'
ost = OpenStruct.new(:ping => true, :discover_types => discover_types, :ipaddr => ipaddr)
_log.info("Rediscovering Host: #{ipaddr} with types: #{discover_types.inspect}")
begin
ManageIQ::NetworkDiscovery.scanHost(ost)
ManageIQ::NetworkDiscovery::Discovery.scan_host(ost)
_log.info("Rediscovering Host: #{ipaddr} raw results: #{self.class.ost_inspect(ost)}")

unless ost.hypervisor.empty?
Expand All @@ -944,11 +944,11 @@ def rediscover(ipaddr, discover_types = [:esx])
end

def self.discoverHost(options)
require 'manageiq-network_discovery'
require 'manageiq/network_discovery/discovery'
ost = OpenStruct.new(Marshal.load(options))
_log.info("Discovering Host: #{ost_inspect(ost)}")
begin
ManageIQ::NetworkDiscovery.scanHost(ost)
ManageIQ::NetworkDiscovery::Discovery.scan_host(ost)

if ost.hypervisor.empty?
_log.info("NOT Discovered: #{ost_inspect(ost)}")
Expand Down

0 comments on commit 643a4a3

Please sign in to comment.