Sha256: bedb94718c209bdbcd09044251c1b72c6f47d73772437fd4ac015597b0afca05

Contents?: true

Size: 1.37 KB

Versions: 59

Compression:

Stored size: 1.37 KB

Contents

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

          def plan(host, packages)
            Type! host, ::Host::Managed

            action_subject(host, :hostname => host.name, :packages => packages)
            plan_action(Pulp::Consumer::ContentInstall,
                        consumer_uuid: host.content_facet.uuid,
                        type:          'rpm',
                        args:          packages)
            plan_self(:host_id => host.id)
          end

          def humanized_name
            if input.try(:[], :hostname)
              _("Install package for %s") % input[:hostname]
            else
              _("Install package")
            end
          end

          def humanized_input
            [input[:packages].join(", ")] + super
          end

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

          def rescue_strategy
            Dynflow::Action::Rescue::Skip
          end

          def finalize
            host = ::Host.find_by(:id => input[:host_id])
            host.update(audit_comment: (_("Installation of package(s) requested: %{packages}") % {packages: input[:packages].join(", ")}).truncate(255))
          end
        end
      end
    end
  end
end

Version data entries

59 entries across 59 versions & 1 rubygems

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