Sha256: dc45c534ac760fc26816fda8344d63a6cf1f082f88585d6b8dde55f217d38abb

Contents?: true

Size: 727 Bytes

Versions: 9

Compression:

Stored size: 727 Bytes

Contents

module Actions
  module Katello
    module System
      class Reassign < Actions::Base
        def plan(system, content_view_id, environment_id)
          system.content_view_id = content_view_id
          system.environment_id = environment_id

          if system.foreman_host
            cve = ::Katello::ContentViewPuppetEnvironment.in_content_view(content_view_id).in_environment(environment_id).first
            if cve && cve.puppet_environment
              system.foreman_host.environment = cve.puppet_environment
              system.foreman_host.save!
            end

          end
          system.save!
          plan_action(::Actions::Candlepin::Consumer::Update, system)
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
katello-2.4.5 app/lib/actions/katello/system/reassign.rb
katello-2.4.4 app/lib/actions/katello/system/reassign.rb
katello-2.4.3 app/lib/actions/katello/system/reassign.rb
katello-2.4.2 app/lib/actions/katello/system/reassign.rb
katello-2.4.1 app/lib/actions/katello/system/reassign.rb
katello-2.4.0 app/lib/actions/katello/system/reassign.rb
katello-2.4.0.rc3 app/lib/actions/katello/system/reassign.rb
katello-2.4.0.rc2 app/lib/actions/katello/system/reassign.rb
katello-2.4.0.rc1 app/lib/actions/katello/system/reassign.rb