Sha256: a7ca735d8e0c53314fe6bcafaf84eb4e607a9f4c55872d30445ca1215de01086

Contents?: true

Size: 1.23 KB

Versions: 46

Compression:

Stored size: 1.23 KB

Contents

module Actions
  module Katello
    module ContentViewPuppetEnvironment
      class Create < Actions::EntryAction
        def plan(puppet_environment, clone = false)
          internal_capsule = SmartProxy.pulp_master
          fail _("Content View %s  cannot be published without an internal capsule." % puppet_environment.name) unless internal_capsule

          User.as_anonymous_admin { puppet_environment.save! }

          action_subject(puppet_environment)
          sequence do
            plan_self(:content_view_puppet_environment_id => puppet_environment.id)

            # when creating a clone, the following actions are handled by the
            # publish/promote process
            unless clone
              plan_action(Katello::Repository::MetadataGenerate, puppet_environment) if puppet_environment.environment
            end
          end
        end

        def run
          puppet_environment = ::Katello::ContentViewPuppetEnvironment.find(input[:content_view_puppet_environment_id])
          output[:response] = ::Katello::Pulp::Repository::Puppet.new(puppet_environment.nonpersisted_repository, SmartProxy.pulp_master).create
        end

        def humanized_name
          _("Create")
        end
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
katello-3.16.2 app/lib/actions/katello/content_view_puppet_environment/create.rb
katello-3.16.1.2 app/lib/actions/katello/content_view_puppet_environment/create.rb
katello-3.16.1.1 app/lib/actions/katello/content_view_puppet_environment/create.rb
katello-3.16.1 app/lib/actions/katello/content_view_puppet_environment/create.rb
katello-3.17.0.rc1 app/lib/actions/katello/content_view_puppet_environment/create.rb
katello-3.16.0 app/lib/actions/katello/content_view_puppet_environment/create.rb
katello-3.16.0.rc5.1 app/lib/actions/katello/content_view_puppet_environment/create.rb
katello-3.16.0.rc5 app/lib/actions/katello/content_view_puppet_environment/create.rb
katello-3.16.0.rc4.1 app/lib/actions/katello/content_view_puppet_environment/create.rb
katello-3.15.3.1 app/lib/actions/katello/content_view_puppet_environment/create.rb
katello-3.15.3 app/lib/actions/katello/content_view_puppet_environment/create.rb
katello-3.16.0.rc4 app/lib/actions/katello/content_view_puppet_environment/create.rb
katello-3.16.0.rc3.1 app/lib/actions/katello/content_view_puppet_environment/create.rb
katello-3.15.2 app/lib/actions/katello/content_view_puppet_environment/create.rb
katello-3.16.0.rc3 app/lib/actions/katello/content_view_puppet_environment/create.rb
katello-3.16.0.rc2.1 app/lib/actions/katello/content_view_puppet_environment/create.rb
katello-3.16.0.rc2 app/lib/actions/katello/content_view_puppet_environment/create.rb
katello-3.15.1.1 app/lib/actions/katello/content_view_puppet_environment/create.rb
katello-3.16.0.rc1.1 app/lib/actions/katello/content_view_puppet_environment/create.rb
katello-3.15.1 app/lib/actions/katello/content_view_puppet_environment/create.rb