Sha256: 2df91a42247248d0fceee75ad9a5eb1fd2ca470db22652df6d2bb84398c40e52

Contents?: true

Size: 1.2 KB

Versions: 68

Compression:

Stored size: 1.2 KB

Contents

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

          def plan(host, groups)
            action_subject(host, :groups => groups)
            plan_action(Pulp::Consumer::ContentUninstall,
                        consumer_uuid: host.content_facet.uuid,
                        type:          'package_group',
                        args:          groups)
            plan_self(:host_id => host.id)
          end

          def humanized_name
            _("Remove package group")
          end

          def humanized_input
            [input[:groups].join(', ')] + super
          end

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

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

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

Version data entries

68 entries across 68 versions & 1 rubygems

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