Project

General

Profile

Download (694 Bytes) Statistics
| Branch: | Tag: | Revision:

foreman_pipeline / app / lib / actions / foreman_pipeline / job / create_activation_key.rb @ be52ca64

1
module Actions
2
  module ForemanPipeline
3
    module Job
4
      class CreateActivationKey < Actions::EntryAction
5

    
6
        def run
7
          ::User.current = ::User.anonymous_admin
8
          output[:new_key] = ::Katello::ActivationKey.create(
9
                        name:             "key-for-#{input[:name]}",
10
                        organization_id:   input[:organization_id],
11
                        environment_id:    input[:environment_id],
12
                        content_view_id:   input[:content_view_id],
13
                        user_id:           ::User.current.id,
14
                        cp_id:             input[:cp_id] 
15
                      )
16
        end
17
      end
18
    end
19
  end
20
end