Sha256: 9d37e25d9031601786c188d448acfec81be75306c62d80e6848704ba67d33a31

Contents?: true

Size: 1.22 KB

Versions: 81

Compression:

Stored size: 1.22 KB

Contents

module Actions
  module Katello
    module Organization
      class Create < Actions::EntryAction
        def plan(organization)
          organization.setup_label_from_name
          organization.create_library
          organization.create_anonymous_provider unless organization.anonymous_provider
          organization.create_redhat_provider unless organization.redhat_provider
          cp_create = nil

          organization.save!

          sequence do
            if ::SETTINGS[:katello][:use_cp]
              cp_create = plan_action(Candlepin::Owner::Create,
                                      label:  organization.label,
                                      name: organization.name)
            end
            plan_action(Environment::LibraryCreate, organization.library)
          end
          if cp_create
            action_subject organization, label: cp_create.output[:response][:key]
          else
            action_subject organization
          end
          plan_self(:organization_id => organization.id)
        end

        def run
          ::Organization.find_by(:id => input[:organization_id]).try(:load_debug_cert)
        end

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

Version data entries

81 entries across 81 versions & 1 rubygems

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