Sha256: 0c8a67f47152c30c1eb69fda09b90e7037c21d4783a96c3a8eef47e4b2d9d62a

Contents?: true

Size: 834 Bytes

Versions: 2

Compression:

Stored size: 834 Bytes

Contents

module Actions
  module Katello
    module System
      class Destroy < Actions::EntryAction
        middleware.use ::Actions::Middleware::RemoteAction

        def plan(system, options = {})
          skip_candlepin = options.fetch(:skip_candlepin, false)
          skip_pulp = system.hypervisor?
          action_subject(system)

          concurrence do
            plan_action(Candlepin::Consumer::Destroy, uuid: system.uuid) unless skip_candlepin
            plan_action(Pulp::Consumer::Destroy, uuid: system.uuid) unless skip_pulp
          end

          plan_self(:system_id => system.id)
        end

        def finalize
          system = ::Katello::System.find(input[:system_id])
          system.destroy!
        end

        def humanized_name
          _("Destroy Content Host")
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
katello-2.4.0.rc2 app/lib/actions/katello/system/destroy.rb
katello-2.4.0.rc1 app/lib/actions/katello/system/destroy.rb