Skip to content
Merged
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
9 changes: 9 additions & 0 deletions app/models/katello/host/info_provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ def host_info
if host.content_facet.present?
info['parameters']['kickstart_repository'] = host.content_facet.kickstart_repository.try(:label)
end

if (rhsm_url = host.content_source&.rhsm_url)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I learned that simply registering a content host directly to the server does not establish a content source and so these won't be set. Is that compatible with how you see this being used, or should they get the values from the default smart proxy at that point? Or is it a bug that content_source is nil in that scenario?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would consider that a bug but I'm not sure how others see it. IMHO every host that has content should have a content_source assigned. Otherwise you always need to remember to do host.content_source || pulp3_primary.

It also means that #9780 may be based on an incorrect assumption and currently can't be used to reconfigure if the host is assigned to the primary.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#9780 works OK. I can create an issue to track that unless you want to dive into it on this PR

info['parameters']['rhsm_url'] = rhsm_url.to_s
end

if (content_url = host.content_source&.pulp_content_url)
info['parameters']['content_url'] = content_url.to_s
end

info
end

Expand Down