Sha256: 5ca6f1ad7c86653025e69d38a93777405a686654fee9e1a83a7aed0c405aef8a

Contents?: true

Size: 1.5 KB

Versions: 49

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],
                                                   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 && 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

49 entries across 49 versions & 1 rubygems

Version Path
katello-3.15.3.1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.15.3 app/lib/actions/pulp/consumer/content_install.rb
katello-3.15.2 app/lib/actions/pulp/consumer/content_install.rb
katello-3.15.1.1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.15.1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.15.0.1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.15.0 app/lib/actions/pulp/consumer/content_install.rb
katello-3.15.0.rc2 app/lib/actions/pulp/consumer/content_install.rb
katello-3.15.0.rc1.3 app/lib/actions/pulp/consumer/content_install.rb
katello-3.15.0.rc1.2 app/lib/actions/pulp/consumer/content_install.rb
katello-3.15.0.rc1.1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.15.0.rc1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.14.1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.13.4 app/lib/actions/pulp/consumer/content_install.rb
katello-3.14.0 app/lib/actions/pulp/consumer/content_install.rb
katello-3.13.3 app/lib/actions/pulp/consumer/content_install.rb
katello-3.14.0.rc2 app/lib/actions/pulp/consumer/content_install.rb
katello-3.13.2 app/lib/actions/pulp/consumer/content_install.rb
katello-3.14.0.rc1 app/lib/actions/pulp/consumer/content_install.rb
katello-3.13.1 app/lib/actions/pulp/consumer/content_install.rb