Sha256: 6c7e677e77b7563fdeb8bce40630467fbbf690898bf9d79b1cbf6aed7c9a5786

Contents?: true

Size: 661 Bytes

Versions: 23

Compression:

Stored size: 661 Bytes

Contents

module Katello
  module Concerns
    module Api::V2::RegistrationControllerExtensions
      extend ActiveSupport::Concern

      def prepare_host
        if params['uuid']
          @host = Katello::Host::SubscriptionFacet.find_by(uuid: params['uuid'])&.host
          if @host.nil?
            msg = N_("Host was not found by the subscription UUID: '%s', this can happen if the host is registered already, but not to this Foreman") % params['uuid']
            fail ActiveRecord::RecordNotFound, msg
          end
          @host.assign_attributes(host_params('host'))
          @host.save!
        else
          super
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
katello-4.0.3 app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb
katello-3.18.5 app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb
katello-4.0.2.1 app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb
katello-4.0.2 app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb
katello-3.18.4 app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb
katello-4.0.1.2 app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb
katello-3.18.3.1 app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb
katello-4.0.1.1 app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb
katello-3.18.3 app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb
katello-4.0.1 app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb
katello-4.0.0 app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb
katello-4.0.0.rc3.1 app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb
katello-4.0.0.rc3 app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb
katello-3.18.2.1 app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb
katello-3.18.2 app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb
katello-4.0.0.rc2 app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb
katello-3.18.1.1 app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb
katello-4.0.0.rc1 app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb
katello-3.18.1 app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb
katello-3.18.0 app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb