Class: Actions::Pulp3::Orchestration::ContentViewVersion::ExportLibrary
- Inherits:
-
EntryAction
- Object
- EntryAction
- Actions::Pulp3::Orchestration::ContentViewVersion::ExportLibrary
- Defined in:
- app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb
Instance Method Summary collapse
- #humanized_name ⇒ Object
- #plan(organization, destination_server: nil, chunk_size: nil, from_history: nil, fail_on_missing_content: false, format: ::Katello::Pulp3::ContentViewVersion::Export::IMPORTABLE) ⇒ Object
- #rescue_strategy ⇒ Object
- #run ⇒ Object
- #validate_repositories_immediate!(organization) ⇒ Object
Instance Method Details
#humanized_name ⇒ Object
38 39 40 |
# File 'app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb', line 38 def humanized_name _("Export Library") end |
#plan(organization, destination_server: nil, chunk_size: nil, from_history: nil, fail_on_missing_content: false, format: ::Katello::Pulp3::ContentViewVersion::Export::IMPORTABLE) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb', line 6 def plan(organization, destination_server: nil, chunk_size: nil, from_history: nil, fail_on_missing_content: false, format: ::Katello::Pulp3::ContentViewVersion::Export::IMPORTABLE) action_subject(organization) validate_repositories_immediate!(organization) if fail_on_missing_content content_view = ::Katello::Pulp3::ContentViewVersion::Export.find_library_export_view(destination_server: destination_server, organization: organization, create_by_default: true, format: format) repo_ids_in_library = organization.default_content_view_version.repositories.exportable(format: format).immediate_or_none.pluck(:id) content_view.update!(repository_ids: repo_ids_in_library) sequence do publish_action = plan_action(::Actions::Katello::ContentView::Publish, content_view, '') export_action = plan_action(Actions::Katello::ContentViewVersion::Export, content_view_version: publish_action.version, destination_server: destination_server, chunk_size: chunk_size, from_history: from_history, validate_incremental: false, fail_on_missing_content: fail_on_missing_content, format: format) plan_self(export_action_output: export_action.output) end end |
#rescue_strategy ⇒ Object
42 43 44 |
# File 'app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb', line 42 def rescue_strategy Dynflow::Action::Rescue::Skip end |
#run ⇒ Object
34 35 36 |
# File 'app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb', line 34 def run output[:export_history_id] = input[:export_action_output][:export_history_id] end |
#validate_repositories_immediate!(organization) ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb', line 46 def validate_repositories_immediate!(organization) non_immediate_repos = organization.default_content_view_version.repositories.yum_type.non_immediate if non_immediate_repos.any? fail _("NOTE: Unable to fully export '%{organization}' organization's library because"\ " it contains repositories without the 'immediate' download policy."\ " Update the download policy and sync affected repositories to include them in the export."\ " \n %{repos}" % { organization: organization.name, repos: ::Katello::Pulp3::ContentViewVersion::Export .generate_product_repo_strings(repositories: non_immediate_repos)}) end end |