Skip to content

Instantly share code, notes, and snippets.

@GregSutcliffe
Created November 10, 2014 10:48
Show Gist options
  • Select an option

  • Save GregSutcliffe/d86c495d49907b7d9fca to your computer and use it in GitHub Desktop.

Select an option

Save GregSutcliffe/d86c495d49907b7d9fca to your computer and use it in GitHub Desktop.
diff --git a/app/lib/puppet_fact_parser_extensions.rb b/app/lib/puppet_fact_parser_extensions.rb
index 94fd4f6..fe12d63 100644
--- a/app/lib/puppet_fact_parser_extensions.rb
+++ b/app/lib/puppet_fact_parser_extensions.rb
@@ -18,6 +18,7 @@ module PuppetFactParserExtensions
# search for IP of interface with primary interface macaddress (ipaddress fact does not have to be interface used for boot)
def ip_with_discovery_fact
facts[:interfaces].split(',').each do |interface|
+ next if facts["macaddress_#{interface}"].nil?
if facts["macaddress_#{interface}"].try(:downcase) == facts[discovery_mac_fact_name].try(:downcase)
return facts["ipaddress_#{interface}"]
end
diff --git a/lib/foreman_discovery/engine.rb b/lib/foreman_discovery/engine.rb
index c5a108f..181b4f3 100644
--- a/lib/foreman_discovery/engine.rb
+++ b/lib/foreman_discovery/engine.rb
@@ -62,9 +62,9 @@ module ForemanDiscovery
# add dashboard widget
widget 'discovery_widget', :name=>N_('Discovery widget'), :sizex => 4, :sizey =>1
- if respond_to? :tests_to_skip
- tests_to_skip "HostTest::import host and facts" => ["should find a host by certname not fqdn when provided"]
- end
+ #if respond_to? :tests_to_skip
+ # tests_to_skip "HostTest::import host and facts" => ["should find a host by certname not fqdn when provided"]
+ #end
end
end
initializer "foreman_discovery.apipie" do
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment