Class: Actions::Katello::Environment::LibraryCreate

Inherits:
Base
  • Object
show all
Defined in:
app/lib/actions/katello/environment/library_create.rb

Instance Method Summary collapse

Instance Method Details

#humanized_nameObject



23
24
25
# File 'app/lib/actions/katello/environment/library_create.rb', line 23

def humanized_name
  _("Create")
end

#plan(library_env) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/lib/actions/katello/environment/library_create.rb', line 5

def plan(library_env)
  library_env.save!
  library_view = ::Katello::ContentView.create!(:default => true,
                                                :name => "Default Organization View",
                                                :organization => library_env.organization)

  ::Katello::ContentViewVersion.create! do |v|
    v.content_view = library_view
    v.major = 1
  end

  version = library_view.versions.first

  plan_action(Katello::ContentView::Create, library_view)
  plan_action(Katello::ContentView::AddToEnvironment, version, library_env)
  plan_action(Katello::Foreman::ContentUpdate, library_env, library_view)
end