Sha256: cd3fbb4c88e56e4de00b84b15b7a73e98f8b9a52271037c08d1fa93a89b5a7fb

Contents?: true

Size: 1.04 KB

Versions: 44

Compression:

Stored size: 1.04 KB

Contents

module Katello
  module Services
    module PuppetClassImporterExtensions
      extend ActiveSupport::Concern

      included do
        def update_environment
          change_types = %w(new obsolete updated)
          changed = self.changes

          change_types.each do |kind|
            changed[kind].slice!(@environment) unless changed[kind].empty?
          end

          #prevent the puppet environment from being deleted, by removing special '_destroy_' String
          if changed['obsolete'][@environment]
            changed['obsolete'][@environment] =
              changed['obsolete'][@environment].select { |klass| klass != '_destroy_' }
          end

          # PuppetClassImporter expects [kind][env] to be in json format
          change_types.each do |kind|
            unless (envs = changed[kind]).empty?
              envs.keys.sort.each do |env|
                changed[kind][env] = changed[kind][env].to_json
              end
            end
          end

          self.obsolete_and_new(changed)
        end
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
katello-3.7.1.1 app/services/katello/puppet_class_importer_extensions.rb
katello-3.7.1 app/services/katello/puppet_class_importer_extensions.rb
katello-3.7.0 app/services/katello/puppet_class_importer_extensions.rb
katello-3.7.0.rc2 app/services/katello/puppet_class_importer_extensions.rb
katello-3.7.0.rc1 app/services/katello/puppet_class_importer_extensions.rb
katello-3.5.2 app/services/katello/puppet_class_importer_extensions.rb
katello-3.6.0 app/services/katello/puppet_class_importer_extensions.rb
katello-3.6.0.1.rc2 app/services/katello/puppet_class_importer_extensions.rb
katello-3.6.0.rc2 app/services/katello/puppet_class_importer_extensions.rb
katello-3.6.0.rc1 app/services/katello/puppet_class_importer_extensions.rb
katello-3.5.1.1 app/services/katello/puppet_class_importer_extensions.rb
katello-3.5.1 app/services/katello/puppet_class_importer_extensions.rb
katello-3.5.0.1 app/services/katello/puppet_class_importer_extensions.rb
katello-3.5.0 app/services/katello/puppet_class_importer_extensions.rb
katello-3.5.0.rc2 app/services/katello/puppet_class_importer_extensions.rb
katello-3.5.0.rc1 app/services/katello/puppet_class_importer_extensions.rb
katello-3.4.5 app/services/katello/puppet_class_importer_extensions.rb
katello-3.4.4 app/services/katello/puppet_class_importer_extensions.rb
katello-3.4.2 app/services/katello/puppet_class_importer_extensions.rb
katello-3.4.1 app/services/katello/puppet_class_importer_extensions.rb