Class: Actions::Pulp3::ContentViewVersion::CreateSyncableExportHistory

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

Instance Method Summary collapse

Instance Method Details

#humanized_nameObject



43
44
45
# File 'app/lib/actions/pulp3/content_view_version/create_syncable_export_history.rb', line 43

def humanized_name
  _("Create Syncable Export History")
end

#runObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'app/lib/actions/pulp3/content_view_version/create_syncable_export_history.rb', line 18

def run
  smart_proxy = ::SmartProxy.unscoped.find(input[:smart_proxy_id])
  output[:path] = input[:base_path]
  cvv = ::Katello::ContentViewVersion.find(input[:content_view_version_id])
  from_cvv = ::Katello::ContentViewVersion.find(input[:from_content_view_version_id]) unless input[:from_content_view_version_id].blank?
   = ::Katello::Pulp3::ContentViewVersion::Export.create(
                                             content_view_version: cvv,
                                             from_content_view_version: from_cvv,
                                             smart_proxy: smart_proxy,
                                             format: input[:format]).

  history = ::Katello::ContentViewVersionExportHistory.create!(
    content_view_version_id: input[:content_view_version_id],
    destination_server: input[:destination_server],
    path: input[:base_path],
    metadata: ,
    audit_comment: ::Katello::ContentViewVersionExportHistory.generate_audit_comment(content_view_version: cvv,
                                                                                     user: User.current,
                                                                                     from_version: from_cvv,
                                                                                     metadata: )
  )
  output[:export_history_id] = history.id
  output[:format] = ::Katello::Pulp3::ContentViewVersion::Export::SYNCABLE
end