Sha256: 494b9a646ef9b83f6ed1cb6176c09c77c6fc13bd4fb6e8e25b62c4c7e3512ffc

Contents?: true

Size: 1.49 KB

Versions: 36

Compression:

Stored size: 1.49 KB

Contents

module Actions
  module Pulp
    module Consumer
      class ContentInstall < AbstractContentAction
        include Helpers::Presenter
        include Actions::Pulp::ExpectOneTask

        input_format do
          param :consumer_uuid, String
          param :type, %w(rpm package_group erratum)
          param :args, array_of(String)
        end

        def invoke_external_task
          task = pulp_extensions.consumer.install_content(input[:consumer_uuid],
                                                   input[:type],
                                                   parse_units_for_type,
                                                    "importkeys" => true)
          schedule_timeout(Setting['content_action_accept_timeout'])
          task
        end

        def finalize
          check_error_details
        end

        def check_error_details
          output[:pulp_tasks].each do |pulp_task|
            error_details = pulp_task.try(:[], "result").try(:[], "details").try(:[], "rpm").try(:[], "details").try(:[], "trace")
            error_message = pulp_task.try(:[], "result").try(:[], "details").try(:[], "rpm").try(:[], "details").try(:[], "message")
            if error_details&.include?("YumDownloadError") && error_message
              fail _("An error occurred during the sync \n%{error_message}") % {:error_message => error_details}
            end
          end
        end

        def presenter
          Consumer::ContentPresenter.new(self)
        end
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
katello-3.18.5 app/lib/actions/pulp/consumer/content_install.rb
katello-3.18.4 app/lib/actions/pulp/consumer/content_install.rb
katello-3.18.3.1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.18.3 app/lib/actions/pulp/consumer/content_install.rb
katello-3.18.2.1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.18.2 app/lib/actions/pulp/consumer/content_install.rb
katello-3.17.3 app/lib/actions/pulp/consumer/content_install.rb
katello-3.18.1.1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.17.2 app/lib/actions/pulp/consumer/content_install.rb
katello-4.0.0.rc1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.18.1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.18.0 app/lib/actions/pulp/consumer/content_install.rb
katello-3.17.1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.16.2 app/lib/actions/pulp/consumer/content_install.rb
katello-3.18.0.rc2.1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.18.0.rc2 app/lib/actions/pulp/consumer/content_install.rb
katello-3.17.0 app/lib/actions/pulp/consumer/content_install.rb
katello-3.18.0.rc1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.17.0.rc2.2 app/lib/actions/pulp/consumer/content_install.rb
katello-3.17.0.rc2.1 app/lib/actions/pulp/consumer/content_install.rb