Project

General

Profile

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

foreman_pipeline / app / lib / actions / foreman_pipeline / job / create_activation_key.rb @ 4c01c2ee

1
module Actions
2
  module ForemanPipeline
3
    module Job
4
      class CreateActivationKey < Actions::EntryAction
5
        middleware.use ::Actions::Middleware::KeepCurrentUser
6

    
7
        def run
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