Sha256: 7f40541c9741c3e39eef6daf9cffdea7e326ebfaf0c883736caefd89d6dc56e8

Contents?: true

Size: 949 Bytes

Versions: 17

Compression:

Stored size: 949 Bytes

Contents

module Actions
  module Katello
    module Host
      class Hypervisors < Actions::EntryAction
        def plan(hypervisor_params)
          sequence do
            hypervisor_results = ::Katello::Resources::Candlepin::Consumer.register_hypervisors(hypervisor_params)
            plan_action(Katello::Host::HypervisorsUpdate, parse_hypervisors(hypervisor_results))
          end
        end

        def parse_hypervisors(hypervisor_results)
          hypervisors = []
          %w(created updated unchanged).each do |group|
            if hypervisor_results[group]
              hypervisors += hypervisor_results[group].map do |hypervisor|
                {
                  :name => hypervisor['name'],
                  :uuid => hypervisor['uuid'],
                  :organization_label => hypervisor['owner']['key']
                }
              end
            end
          end
          hypervisors
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
katello-3.3.2 app/lib/actions/katello/host/hypervisors.rb
katello-3.4.0.rc2 app/lib/actions/katello/host/hypervisors.rb
katello-3.4.0.rc1 app/lib/actions/katello/host/hypervisors.rb
katello-3.3.1.1 app/lib/actions/katello/host/hypervisors.rb
katello-3.3.1 app/lib/actions/katello/host/hypervisors.rb
katello-3.3.0.1 app/lib/actions/katello/host/hypervisors.rb
katello-3.3.0 app/lib/actions/katello/host/hypervisors.rb
katello-3.3.0.rc2 app/lib/actions/katello/host/hypervisors.rb
katello-3.3.0.rc1.1 app/lib/actions/katello/host/hypervisors.rb
katello-3.3.0.rc1 app/lib/actions/katello/host/hypervisors.rb
katello-3.2.1.1 app/lib/actions/katello/host/hypervisors.rb
katello-3.2.1 app/lib/actions/katello/host/hypervisors.rb
katello-3.2.0 app/lib/actions/katello/host/hypervisors.rb
katello-3.2.0.rc3 app/lib/actions/katello/host/hypervisors.rb
katello-3.2.0.rc2 app/lib/actions/katello/host/hypervisors.rb
katello-3.2.0.rc1.1 app/lib/actions/katello/host/hypervisors.rb
katello-3.2.0.rc1 app/lib/actions/katello/host/hypervisors.rb