Sha256: 1ed4946ab315a93db5c3c83f2bd9df97c9650b1e109413476cd874459642ebd0

Contents?: true

Size: 1.4 KB

Versions: 20

Compression:

Stored size: 1.4 KB

Contents

module Actions
  module Katello
    module Host
      module Package
        class Remove < Actions::EntryAction
          include Helpers::Presenter

          def plan(host, packages)
            action_subject(host, :packages => packages)
            plan_action(Pulp::Consumer::ContentUninstall,
                        consumer_uuid: host.content_facet.uuid,
                        type:          'rpm',
                        args:          packages)
          end

          def humanized_name
            _("Remove package")
          end

          def humanized_input
            [humanized_package_names.join(', ')] + super
          end

          def humanized_package_names
            input[:packages].inject([]) do |result, package|
              if package.is_a?(Hash)
                new_name = package.include?(:name) ? package[:name] : ""
                new_name += '-' + package[:version] if package.include?(:version)
                new_name += '.' + package[:release] if package.include?(:release)
                new_name += '.' + package[:arch] if package.include?(:arch)
                result << new_name
              else
                result << package
              end
            end
          end

          def presenter
            Helpers::Presenter::Delegated.new(
                self, planned_actions(Pulp::Consumer::ContentUninstall))
          end
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
katello-3.2.1.1 app/lib/actions/katello/host/package/remove.rb
katello-3.2.1 app/lib/actions/katello/host/package/remove.rb
katello-3.2.0 app/lib/actions/katello/host/package/remove.rb
katello-3.2.0.rc3 app/lib/actions/katello/host/package/remove.rb
katello-3.2.0.rc2 app/lib/actions/katello/host/package/remove.rb
katello-3.2.0.rc1.1 app/lib/actions/katello/host/package/remove.rb
katello-3.2.0.rc1 app/lib/actions/katello/host/package/remove.rb
katello-3.1.0.1 app/lib/actions/katello/host/package/remove.rb
katello-3.1.0 app/lib/actions/katello/host/package/remove.rb
katello-3.1.0.rc2.1 app/lib/actions/katello/host/package/remove.rb
katello-3.0.2 app/lib/actions/katello/host/package/remove.rb
katello-3.1.0.rc1 app/lib/actions/katello/host/package/remove.rb
katello-3.0.1 app/lib/actions/katello/host/package/remove.rb
katello-3.0.0 app/lib/actions/katello/host/package/remove.rb
katello-3.0.0.rc7 app/lib/actions/katello/host/package/remove.rb
katello-3.0.0.rc5 app/lib/actions/katello/host/package/remove.rb
katello-3.0.0.rc4 app/lib/actions/katello/host/package/remove.rb
katello-3.0.0.rc3 app/lib/actions/katello/host/package/remove.rb
katello-3.0.0.rc2 app/lib/actions/katello/host/package/remove.rb
katello-3.0.0.rc1 app/lib/actions/katello/host/package/remove.rb