-
Notifications
You must be signed in to change notification settings - Fork 32
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
Conversation
The test failures are
looks like the tests may be using old Katello code? |
d686996
to
f46e7ea
Compare
@ShimShtein does the katello pin look good? |
@@ -108,6 +108,7 @@ class MachineTelemetriesControllerTest < ActionController::TestCase | |||
context '#branch_info' do | |||
setup do | |||
User.current = User.find_by(login: 'secret_admin') | |||
Setting[:allow_multiple_content_views] = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to break downstream, unless we expose the setting via foreman_theme_satellite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I am missing something. Is this setting introduced by the theme? I think I have seen it in Katello.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The multi-CV feature isn't fully complete yet, so it's blocked downstream. See https://github.com/RedHatSatellite/foreman_theme_satellite/blob/develop/app/models/concerns/upstream_only_settings.rb
This means that downstream, the setting is not exposed and Setting[:allow_multiple_content_views] = true
will error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
additional context: This had been working (unintentionally) until Katello implemented https://projects.theforeman.org/issues/37657
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeremylenz Can you add a if condition or dry catch to skip the test if the setting is not there?
@@ -108,6 +108,7 @@ class MachineTelemetriesControllerTest < ActionController::TestCase | |||
context '#branch_info' do | |||
setup do | |||
User.current = User.find_by(login: 'secret_admin') | |||
Setting[:allow_multiple_content_views] = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I am missing something. Is this setting introduced by the theme? I think I have seen it in Katello.
no upper limit
b0064ed
to
5396af3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great, thanks @jeremylenz. Looks fine from a code and function test. @ShimShtein do you have any more comments on the theme setting or the gem pin?
Tested on 6.16 latest snap
[root@ip-10-0-167-3 done]# cat 4dcdd615-bb4e-4500-84d5-b06a32969c80.json | jq
{
"report_slice_id": "4dcdd615-bb4e-4500-84d5-b06a32969c80",
"hosts": [
{
"fqdn": "ip-10-0-167-160.rhos-01.prod.psi.rdu2.redhat.com",
"account": "540155",
"subscription_manager_id": "4fa3fdf6-cb4d-4d0f-b186-6f67aaa21932",
"satellite_id": "4fa3fdf6-cb4d-4d0f-b186-6f67aaa21932",
"bios_uuid": "D903DB6C-4672-461F-A477-069556E70F05",
"convert2rhel_through_foreman": 1,
fe8452b
to
061703f
Compare
061703f
to
924f107
Compare
@ShimShtein @chris1984 updated to skip tests if multiCV isn't available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks @jeremylenz
To test:
Setup
On a registered host, create a custom fact file that includes
conversions.env.CONVERT2RHEL_THROUGH_FOREMAN
:Update facts:
Verify that the host's
subscription_facet_attributes
haveconvert2rhel_through_foreman: 1
Test
Ensure that the host's
host_registration_insights
parameter is set to trueOn the Inventory Upload page, click 'Sync inventory status' and wait for the sync to complete
On the host, run
You should see, at the end of the output, something like
CD into that directory, then run
All files except
metadata.json
will be about individual hosts. Find your host and verify its json containsconvert2rhel_through_foreman
: