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)
# frozen_string_literal: true
module ForemanUuidBoot
module HostDiscoveredExtensions
def populate_fields_from_facts(parser, type, source_proxy)
super
populate_facet_fields(parser, type, source_proxy)
end
end
end
......@@ -4,6 +4,7 @@ module ForemanUuidBoot
class Engine < ::Rails::Engine
engine_name 'foreman_uuid_boot'
config.autoload_paths += Dir["#{config.root}/app/models/concerns"]
config.autoload_paths += Dir["#{config.root}/app/services/foreman/unattended_installation/concerns"]
initializer 'foreman_uuid_boot.load_app_instance_data' do |app|
......@@ -17,13 +18,27 @@ module ForemanUuidBoot
requires_foreman '>= 2.5'
register_facet ForemanUuidBoot::UuidbootHostFacet, :uuidboot_facet do
set_dependent_action :destroy
configure_host do
set_dependent_action :destroy
end
end
end
end
config.to_prepare do
::Foreman::UnattendedInstallation::HostFinder.prepend ForemanUuidBoot::HostFinderExtensions
# Slight hack for foreman_discovery - to store UUID for provision
begin
# Ensure that Host::Discovered applies host facets
unless ::Host::Discovered.include? Facets::ModelExtensionsBase
::Host::Discovered.include SelectiveClone
::Host::Discovered.include Facets::ManagedHostExtensions
::Host::Discovered.prepend ForemanUuidBoot::HostDiscoveredExtensions
end
rescue NameError => e
Rails.logger.warn "ForemanUuidBoot: Discovery not installed(#{e}), skipping discovery extensions"
end
rescue StandardError => e
Rails.logger.warn "ForemanUuidBoot: skipping engine hook(#{e})"
end
......
# frozen_string_literal: true
module ForemanUuidBoot
VERSION = '0.3.0'
VERSION = '0.4.0'
end