Sha256: dd49556eb91a5bf8613e4371eb3ab30c701fe0e4db2a8298af1792031499e127

Contents?: true

Size: 1.5 KB

Versions: 52

Compression:

Stored size: 1.5 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],
                                                   input[:args],
                                                    "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 && 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

52 entries across 52 versions & 1 rubygems

Version Path
katello-3.8.0.rc3 app/lib/actions/pulp/consumer/content_install.rb
katello-3.8.0.rc2 app/lib/actions/pulp/consumer/content_install.rb
katello-3.7.0 app/lib/actions/pulp/consumer/content_install.rb
katello-3.8.0.rc1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.7.0.rc2 app/lib/actions/pulp/consumer/content_install.rb
katello-3.7.0.rc1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.5.2 app/lib/actions/pulp/consumer/content_install.rb
katello-3.6.0 app/lib/actions/pulp/consumer/content_install.rb
katello-3.6.0.1.rc2 app/lib/actions/pulp/consumer/content_install.rb
katello-3.6.0.rc2 app/lib/actions/pulp/consumer/content_install.rb
katello-3.6.0.rc1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.5.1.1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.5.1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.5.0.1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.5.0 app/lib/actions/pulp/consumer/content_install.rb
katello-3.5.0.rc2 app/lib/actions/pulp/consumer/content_install.rb
katello-3.5.0.rc1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.4.5 app/lib/actions/pulp/consumer/content_install.rb
katello-3.4.4 app/lib/actions/pulp/consumer/content_install.rb
katello-3.4.2 app/lib/actions/pulp/consumer/content_install.rb