Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add convert2rhel fact to host report #896

Merged
merged 4 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion foreman_rh_cloud.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Gem::Specification.new do |s|

s.add_dependency 'foreman_ansible'
s.add_dependency 'foreman-tasks'
s.add_dependency 'katello'
s.add_runtime_dependency 'katello', '>= 4.14.0.rc1.1'

s.add_development_dependency 'rdoc'
s.add_development_dependency 'theforeman-rubocop', '~> 0.1.0'
Expand Down
1 change: 1 addition & 0 deletions lib/foreman_inventory_upload/generators/slice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def report_host(host)
@stream.simple_field('account', account_id(host.organization).to_s)
@stream.simple_field('subscription_manager_id', uuid_value!(host.subscription_facet&.uuid))
@stream.simple_field('satellite_id', uuid_value!(host.subscription_facet&.uuid))
@stream.simple_field('convert2rhel_through_foreman', host.subscription_facet&.convert2rhel_through_foreman)
@stream.simple_field('bios_uuid', bios_uuid(host))
@stream.simple_field('vm_uuid', uuid_value(fact_value(host, 'virt::uuid')))
@stream.simple_field('insights_id', uuid_value(fact_value(host, 'insights_id')))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class MachineTelemetriesControllerTest < ActionController::TestCase

context '#branch_info' do
setup do
UpstreamOnlySettingsTestHelper.set_if_available('allow_multiple_content_views')
User.current = User.find_by(login: 'secret_admin')

@env = FactoryBot.create(:katello_k_t_environment)
Expand Down
8 changes: 8 additions & 0 deletions test/test_plugin_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,11 @@ module CandlepinIsolation
end
end
end

module UpstreamOnlySettingsTestHelper
def self.set_if_available(setting_name, value: true)
Setting[setting_name] = value
rescue Foreman::Exception
skip "Setting #{setting_name} is not available in Foreman"
end
end
1 change: 1 addition & 0 deletions test/unit/tags_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class TagsGeneratorTest < ActiveSupport::TestCase
include CandlepinIsolation

setup do
UpstreamOnlySettingsTestHelper.set_if_available('allow_multiple_content_views')
User.current = User.find_by(login: 'secret_admin')

env = FactoryBot.create(:katello_k_t_environment)
Expand Down