Skip to content

Commit

Permalink
Merge pull request #4578 from jlsherrill/7074
Browse files Browse the repository at this point in the history
fixes #7074 - allow registrations even when there is no host
  • Loading branch information
jlsherrill committed Aug 13, 2014
2 parents fb5f673 + beb0197 commit da56e03
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def consumer_create
content_view_environment = find_content_view_environment
foreman_host = find_foreman_host(content_view_environment.environment.organization)

sync_task(::Actions::Katello::System::Destroy, foreman_host.content_host) if foreman_host.content_host
sync_task(::Actions::Katello::System::Destroy, foreman_host.content_host) if foreman_host.try(:content_host)

@system = System.new(system_params.merge(:environment => content_view_environment.environment,
:content_view => content_view_environment.content_view,
Expand Down Expand Up @@ -225,7 +225,7 @@ def consumer_activate
activation_keys = find_activation_keys
foreman_host = find_foreman_host(activation_keys.first.organization)

sync_task(::Actions::Katello::System::Destroy, foreman_host.content_host) if foreman_host.content_host
sync_task(::Actions::Katello::System::Destroy, foreman_host.content_host) if foreman_host.try(:content_host)

@system = System.new(system_params.merge(:host_id => foreman_host.try(:id)))
sync_task(::Actions::Katello::System::Create, @system, activation_keys)
Expand Down

0 comments on commit da56e03

Please sign in to comment.