Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ITI/foreman_uuid_boot
1 result
Show changes
Commits on Source (2)
...@@ -5,10 +5,17 @@ module ForemanUuidBoot ...@@ -5,10 +5,17 @@ module ForemanUuidBoot
include Facets::Base include Facets::Base
def self.populate_fields_from_facts(host, parser, _type, _proxy) def self.populate_fields_from_facts(host, parser, _type, _proxy)
facet = host.uuidboot_facet || host.build_uuidboot_facet uuid = parser.facts.dig('dmi', 'product', 'uuid') || parser.facts['uuid']
facet.uuid = parser.facts.dig('dmi', 'product', 'uuid') || parser.facts['uuid']
facet.save if facet.uuid && facet.changed? if uuid
facet.destroy if !facet.uuid && facet.persisted? facet = host.uuidboot_facet || host.build_uuidboot_facet
facet.uuid = uuid
facet.save if facet.changed? || !facet.persisted?
facet
else
host.uuidboot_facet&.destroy
nil
end
end end
end end
end end
# frozen_string_literal: true # frozen_string_literal: true
module ForemanUuidBoot module ForemanUuidBoot
VERSION = '0.4.3' VERSION = '0.4.4'
end end