Skip to content

Commit

Permalink
Fixes #36393 - Do not rebuild managed hosts in registration
Browse files Browse the repository at this point in the history
(cherry picked from commit 7c41286)
  • Loading branch information
stejskalleos authored and ekohl committed Aug 8, 2023
1 parent 32faf21 commit 6a8797a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion app/controllers/api/v2/registration_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ def host
return
end

@host.setBuild
# Do not rebuild managed hosts
# Hosts registered with subscription-manager are created
# as a Host::Managed, but have @host.managed? => false
# https://projects.theforeman.org/issues/36393
@host.setBuild unless @host.managed?
safe_render(@template)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ echo "#"
register_katello_host(){
UUID=$(subscription-manager identity | head -1 | awk '{print $3}')
curl --silent --show-error --cacert $KATELLO_SERVER_CA_CERT --request POST "<%= @registration_url %>" \
--data "uuid=$UUID" \
<%= headers.join(' ') %> \
--data "uuid=$UUID" \
--data "host[build]=false" \
<%= " --data 'host[organization_id]=#{@organization.id}' \\\n" if @organization -%>
<%= " --data 'host[location_id]=#{@location.id}' \\\n" if @location -%>
<%= " --data 'host[hostgroup_id]=#{@hostgroup.id}' \\\n" if @hostgroup -%>
Expand Down

0 comments on commit 6a8797a

Please sign in to comment.