Class: Actions::Katello::ContentViewVersion::Export

Inherits:
EntryAction
  • Object
show all
Defined in:
app/lib/actions/katello/content_view_version/export.rb

Instance Method Summary collapse

Instance Method Details

#finalizeObject



31
32
33
34
35
# File 'app/lib/actions/katello/content_view_version/export.rb', line 31

def finalize
  history = ::Katello::ContentViewHistory.find(input[:history_id])
  history.status = ::Katello::ContentViewHistory::SUCCESSFUL
  history.save!
end

#humanized_nameObject



27
28
29
# File 'app/lib/actions/katello/content_view_version/export.rb', line 27

def humanized_name
  _("Export")
end

#plan(content_view_version, export_to_iso, since, iso_size) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/lib/actions/katello/content_view_version/export.rb', line 7

def plan(content_view_version, export_to_iso, since, iso_size)
  # assemble data to feed to Pulp
  content_view = ::Katello::ContentView.find(content_view_version.content_view_id)
  org_label = ::Organization.find_by(:id => content_view.organization_id).label
  group_id = "#{org_label}-#{content_view.label}-"\
             "v#{content_view_version.major}.#{content_view_version.minor}"
  action_subject(content_view_version)

  repos = content_view_version.archived_repos.select { |r| r.content_type == 'yum' }

  history = ::Katello::ContentViewHistory.create!(:content_view_version => content_view_version,
                                                  :user => ::User.current.,
                                                  :status => ::Katello::ContentViewHistory::IN_PROGRESS,
                                                  :task => self.task)

  plan_action(Katello::Repository::Export, repos, export_to_iso, since, iso_size,
                                           group_id)
  plan_self(:history_id => history.id)
end

#rescue_strategyObject



37
38
39
# File 'app/lib/actions/katello/content_view_version/export.rb', line 37

def rescue_strategy
  Dynflow::Action::Rescue::Skip
end