Sha256: e00c3940fc2c2cd620d2ac95bcaf51b99cd1bdd6c2c4f2af81580323c63229bb

Contents?: true

Size: 1.17 KB

Versions: 202

Compression:

Stored size: 1.17 KB

Contents

module Actions
  module Pulp
    module Repository
      module Presenters
        class AbstractSyncPresenter < Helpers::Presenter::Base
          def humanized_output
            if action.external_task
              humanized_details
            end
          end

          private

          def humanized_details
            fail NotImplementedError
          end

          def sync_task
            tasks = action.external_task.select do |task|
              if task.key? 'tags'
                task['tags'].include?("pulp:action:sync")
              else
                # workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1131537
                # as the sync plan tasks don't have tags in pulp
                task['result'] &&
                    task['result']['importer_type_id'].to_s =~ /_importer$/
              end
            end
            tasks.first
          end

          def cancelled?
            sync_task['state'] == 'canceled'
          end

          def task_result
            sync_task['result']
          end

          def task_result_details
            task_result && task_result['details']
          end
        end
      end
    end
  end
end

Version data entries

202 entries across 202 versions & 1 rubygems

Version Path
katello-4.7.6 app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb
katello-4.7.5 app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb
katello-4.7.4 app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb
katello-4.7.3 app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb
katello-4.7.2 app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb
katello-4.7.1 app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb
katello-4.6.2.1 app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb
katello-4.6.2 app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb
katello-4.7.0 app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb
katello-4.6.1 app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb
katello-4.7.0.rc2 app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb
katello-4.7.0.rc1 app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb
katello-4.4.2.2 app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb
katello-4.4.2.1 app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb
katello-4.4.2 app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb
katello-4.5.1 app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb
katello-4.6.0 app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb
katello-4.6.0.rc2 app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb
katello-4.6.0.rc1 app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb
katello-4.5.0 app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb