katello 4.1.4 → 4.2.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of katello might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +2 -2
- data/app/controllers/katello/api/v2/content_credentials_controller.rb +3 -3
- data/app/controllers/katello/api/v2/content_uploads_controller.rb +3 -1
- data/app/controllers/katello/api/v2/content_view_components_controller.rb +33 -1
- data/app/controllers/katello/api/v2/content_views_controller.rb +12 -0
- data/app/controllers/katello/api/v2/host_errata_controller.rb +1 -1
- data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +1 -2
- data/app/controllers/katello/api/v2/products_controller.rb +4 -4
- data/app/controllers/katello/api/v2/repositories_bulk_actions_controller.rb +3 -11
- data/app/controllers/katello/api/v2/repositories_controller.rb +68 -47
- data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +0 -28
- data/app/controllers/katello/concerns/api/v2/registration_commands_controller_extensions.rb +26 -5
- data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +26 -1
- data/app/lib/actions/candlepin/environment/destroy.rb +2 -0
- data/app/lib/actions/katello/agent_action.rb +2 -2
- data/app/lib/actions/katello/capsule_content/sync_capsule.rb +3 -2
- data/app/lib/actions/katello/{gpg_key → content_credential}/update.rb +1 -1
- data/app/lib/actions/katello/content_view/publish.rb +6 -1
- data/app/lib/actions/katello/content_view_version/create_repos.rb +1 -1
- data/app/lib/actions/katello/content_view_version/incremental_update.rb +0 -47
- data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +1 -1
- data/app/lib/actions/katello/repository/clone_contents.rb +1 -7
- data/app/lib/actions/katello/repository/clone_to_environment.rb +1 -7
- data/app/lib/actions/katello/repository/create.rb +4 -8
- data/app/lib/actions/katello/repository/create_root.rb +1 -1
- data/app/lib/actions/katello/repository/destroy.rb +1 -3
- data/app/lib/actions/katello/repository/import_upload.rb +3 -2
- data/app/lib/actions/katello/repository/instance_update.rb +1 -1
- data/app/lib/actions/katello/repository/metadata_generate.rb +2 -8
- data/app/lib/actions/katello/repository/multi_clone_contents.rb +0 -1
- data/app/lib/actions/katello/repository/refresh_repository.rb +1 -4
- data/app/lib/actions/katello/repository/remove_content.rb +6 -4
- data/app/lib/actions/katello/repository/sync.rb +5 -25
- data/app/lib/actions/katello/repository/update.rb +1 -2
- data/app/lib/actions/katello/repository/update_http_proxy_details.rb +2 -5
- data/app/lib/actions/katello/repository/update_redhat_repository.rb +1 -1
- data/app/lib/actions/katello/repository/upload_files.rb +8 -3
- data/app/lib/actions/katello/repository/upload_package_group.rb +2 -11
- data/app/lib/actions/katello/repository/verify_checksum.rb +0 -1
- data/app/lib/actions/katello/repository_set/enable_repository.rb +1 -1
- data/app/lib/actions/pulp3/orchestration/repository/create.rb +2 -2
- data/app/lib/actions/pulp3/repository/create.rb +3 -4
- data/app/lib/actions/pulp3/repository/create_remote.rb +1 -6
- data/app/lib/actions/pulp3/repository/repair.rb +4 -0
- data/app/lib/katello/errors.rb +1 -0
- data/app/lib/katello/http_resource.rb +26 -73
- data/app/lib/katello/qpid/connection.rb +1 -3
- data/app/lib/katello/resources/candlepin/consumer.rb +1 -1
- data/app/lib/katello/resources/candlepin/environment.rb +2 -0
- data/app/lib/katello/resources/registry.rb +7 -20
- data/app/lib/katello/util/http_proxy.rb +0 -3
- data/app/lib/katello/validators/gpg_key_content_validator.rb +1 -1
- data/app/models/katello/authorization/{gpg_key.rb → content_credential.rb} +1 -1
- data/app/models/katello/authorization/product.rb +0 -4
- data/app/models/katello/concerns/host_managed_extensions.rb +2 -16
- data/app/models/katello/concerns/organization_extensions.rb +1 -1
- data/app/models/katello/concerns/pulp_database_unit.rb +13 -5
- data/app/models/katello/concerns/smart_proxy_extensions.rb +45 -41
- data/app/models/katello/{gpg_key.rb → content_credential.rb} +4 -4
- data/app/models/katello/content_view.rb +6 -1
- data/app/models/katello/generic_content_unit.rb +16 -0
- data/app/models/katello/glue/pulp/repos.rb +9 -25
- data/app/models/katello/kt_environment.rb +1 -1
- data/app/models/katello/product.rb +4 -4
- data/app/models/katello/repository.rb +13 -7
- data/app/models/katello/repository_generic_content_unit.rb +7 -0
- data/app/models/katello/root_repository.rb +38 -7
- data/app/models/setting/content.rb +5 -0
- data/app/services/cert/certs.rb +16 -8
- data/app/services/katello/applicability/applicable_content_helper.rb +1 -2
- data/app/services/katello/candlepin/consumer.rb +6 -0
- data/app/services/katello/component_view_presenter.rb +27 -0
- data/app/services/katello/pulp/repository.rb +1 -1
- data/app/services/katello/pulp/server.rb +2 -2
- data/app/services/katello/pulp3/api/core.rb +4 -0
- data/app/services/katello/pulp3/api/generic.rb +68 -0
- data/app/services/katello/pulp3/generic_content_unit.rb +29 -0
- data/app/services/katello/pulp3/pulp_content_unit.rb +5 -1
- data/app/services/katello/pulp3/repository/generic.rb +94 -0
- data/app/services/katello/pulp3/repository/yum.rb +4 -5
- data/app/services/katello/pulp3/repository.rb +27 -12
- data/app/services/katello/pulp3/repository_mirror.rb +2 -2
- data/app/services/katello/pulp3/smart_proxy_repository.rb +4 -4
- data/app/services/katello/registration_manager.rb +18 -7
- data/app/services/katello/repository_type.rb +59 -1
- data/app/services/katello/repository_type_manager.rb +116 -24
- data/app/views/katello/api/v2/content_views/base.json.rabl +4 -4
- data/app/views/katello/api/v2/repositories/show.json.rabl +1 -0
- data/app/views/smart_proxies/plugins/_pulpcore.html.erb +2 -5
- data/app/views/smart_proxies/pulp_status.html.erb +0 -7
- data/config/katello.yaml.example +0 -21
- data/config/routes/api/v2.rb +2 -1
- data/db/functions/deb_version_cmp_v01.sql +200 -0
- data/db/migrate/20171110082124_add_ssl_certs_to_products_and_repos.rb +5 -1
- data/db/migrate/20200402130013_add_repsoitory_docker_meta_tag_f_key.rb +3 -1
- data/db/migrate/20210624221630_katello_generic_content.rb +22 -0
- data/db/migrate/20210625095042_add_retain_package_versions_count.rb +9 -0
- data/db/migrate/20210628182553_add_generic_remote_options_to_root_repository.rb +5 -0
- data/db/migrate/20210714140440_remove_repo_export_permission.rb +5 -0
- data/db/migrate/20210721163730_change_gpg_keys_to_content_credentials.rb +8 -0
- data/db/migrate/20210728130748_create_function_deb_version_cmp.rb +12 -0
- data/db/seeds.d/111-upgrade_tasks.rb +1 -2
- data/engines/bastion/app/views/bastion/layouts/assets.html.erb +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.controller.js +7 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html +4 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/apply-errata.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/views/apply-errata-confirm.html +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +25 -33
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/views/products-bulk-advanced-sync-modal.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-repositories.controller.js +1 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +10 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.filter.js +9 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details.controller.js +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-advanced-sync-options.html +1 -25
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-details.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +31 -13
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +11 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +0 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/aggregate-task.factory.js +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task.factory.js +1 -1
- data/lib/katello/engine.rb +2 -4
- data/lib/katello/permission_creator.rb +6 -12
- data/lib/katello/plugin.rb +76 -80
- data/lib/katello/repository_types/python.rb +37 -0
- data/lib/katello/tasks/reimport.rake +0 -9
- data/lib/katello/tasks/repository.rake +3 -4
- data/lib/katello/version.rb +1 -1
- data/locale/action_names.rb +28 -29
- data/locale/bn/katello.po +699 -221
- data/locale/cs/katello.po +167 -59
- data/locale/de/katello.po +585 -352
- data/locale/en/katello.po +167 -59
- data/locale/es/katello.po +1388 -1189
- data/locale/fr/katello.po +1740 -1494
- data/locale/gu/katello.po +896 -416
- data/locale/hi/katello.po +892 -415
- data/locale/it/katello.po +371 -170
- data/locale/ja/katello.po +1657 -1439
- data/locale/katello.pot +933 -736
- data/locale/kn/katello.po +894 -416
- data/locale/ko/katello.po +515 -317
- data/locale/mr/katello.po +857 -415
- data/locale/or/katello.po +894 -416
- data/locale/pa/katello.po +874 -411
- data/locale/pt/katello.po +347 -154
- data/locale/pt_BR/katello.po +1398 -1215
- data/locale/ru/katello.po +671 -463
- data/locale/ta/katello.po +697 -221
- data/locale/te/katello.po +891 -415
- data/locale/zh_CN/katello.po +2029 -1845
- data/locale/zh_TW/katello.po +735 -407
- data/package.json +3 -1
- data/webpack/components/EditableTextInput/EditableTextInput.js +3 -3
- data/webpack/components/RoutedTabs/RoutedTabs.js +7 -8
- data/webpack/components/Table/TableWrapper.js +19 -11
- data/webpack/components/Table/helpers.js +1 -1
- data/webpack/components/extensions/HostDetails/Tabs/ContentTab.js +42 -0
- data/webpack/components/extensions/HostDetails/Tabs/SubscriptionTab.js +12 -0
- data/webpack/components/extensions/RegistrationCommands/__tests__/__snapshots__/ActivationKeys.test.js.snap +4 -0
- data/webpack/components/extensions/RegistrationCommands/fields/ActivationKeys.js +1 -1
- data/webpack/components/extensions/RegistrationCommands/index.js +1 -2
- data/webpack/components/pf3Table/formatters/selectionHeaderCellFormatter.js +2 -1
- data/webpack/fills_index.js +4 -1
- data/webpack/redux/actions/RedHatRepositories/helpers.js +2 -4
- data/webpack/redux/reducers/RedHatRepositories/enabled.js +4 -1
- data/webpack/scenes/ContentViews/ContentViewsActions.js +16 -1
- data/webpack/scenes/ContentViews/ContentViewsConstants.js +15 -0
- data/webpack/scenes/ContentViews/ContentViewsPage.js +12 -22
- data/webpack/scenes/ContentViews/Copy/CopyContentViewForm.js +4 -3
- data/webpack/scenes/ContentViews/Create/CreateContentViewForm.js +25 -14
- data/webpack/scenes/ContentViews/Create/CreateContentViewModal.js +4 -2
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewAddModal.js +153 -0
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentVersion.js +21 -10
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +157 -19
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.fixtures.json +100 -108
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.test.js +140 -16
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/publishedContentViewDetails.fixtures.json +367 -0
- data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +59 -6
- data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +43 -0
- data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +44 -13
- data/webpack/scenes/ContentViews/Details/Filters/Add/CVFilterAddModal.js +161 -0
- data/webpack/scenes/ContentViews/Details/Filters/Add/__tests__/cvFilterAdd.test.js +54 -0
- data/webpack/scenes/ContentViews/Details/Filters/Add/__tests__/cvFilterCreateResult.fixtures.json +124 -0
- data/webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js +8 -6
- data/webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js +7 -6
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetails.js +4 -3
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js +71 -12
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js +77 -0
- data/webpack/scenes/ContentViews/Details/Histories/ContentViewHistories.js +13 -12
- data/webpack/scenes/ContentViews/Details/Histories/__tests__/contentViewHistory.test.js +2 -2
- data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +17 -14
- data/webpack/scenes/ContentViews/Details/Repositories/LastSync.js +3 -3
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewAddRemove.test.js +2 -2
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.test.js +6 -2
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js +61 -20
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewTaskInProgressResponse.fixtures.json +71 -0
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewTaskResponse.fixtures.json +75 -0
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js +86 -1
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersionsWithTask.fixtures.json +713 -0
- data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +3 -0
- data/webpack/scenes/ContentViews/Publish/CVPublishFinish.js +184 -0
- data/webpack/scenes/ContentViews/Publish/CVPublishForm.js +104 -0
- data/webpack/scenes/ContentViews/Publish/CVPublishReview.js +71 -0
- data/webpack/scenes/ContentViews/Publish/ContentViewPublishSelectors.js +17 -0
- data/webpack/scenes/ContentViews/Publish/PublishContentViewWizard.js +145 -0
- data/webpack/scenes/ContentViews/Publish/__tests__/environmentPaths.fixtures.json +352 -0
- data/webpack/scenes/ContentViews/Publish/__tests__/publishContentView.test.js +184 -0
- data/webpack/scenes/ContentViews/Publish/__tests__/publishResponse.fixture.json +69 -0
- data/webpack/scenes/ContentViews/Publish/cvPublishForm.scss +3 -0
- data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +75 -48
- data/webpack/scenes/ContentViews/Table/tableDataGenerator.js +15 -2
- data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +6 -10
- data/webpack/scenes/ContentViews/components/EnvironmentLabels.js +22 -10
- data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPathActions.js +12 -0
- data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPathConstants.js +2 -0
- data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPathSelectors.js +16 -0
- data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPaths.js +72 -0
- data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPaths.scss +8 -0
- data/webpack/scenes/ContentViews/components/TaskPresenter/TaskPresenter.js +85 -0
- data/webpack/scenes/SmartProxy/SmartProxyContentTable.js +9 -8
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +4 -25
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +0 -3
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +3 -3
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +4 -2
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +24 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/components/Table.js +4 -1
- data/webpack/scenes/Subscriptions/index.js +1 -4
- metadata +74 -39
- data/app/lib/actions/candlepin/environment/create.rb +0 -21
- data/app/lib/actions/foreman/environment/destroy.rb +0 -23
- data/app/lib/actions/katello/content_view/environment_create.rb +0 -21
- data/app/lib/actions/katello/repository/export.rb +0 -85
- data/app/lib/actions/katello/repository/purge_empty_content.rb +0 -16
- data/app/lib/actions/katello/repository/upload_errata.rb +0 -38
- data/app/lib/katello/util/proxy_uri.rb +0 -64
- data/app/models/katello/rhsm_fact_importer.rb +0 -20
- data/app/models/katello/rhsm_fact_name.rb +0 -17
- data/app/models/katello/rhsm_fact_parser.rb +0 -120
@@ -8,6 +8,8 @@ module Actions
|
|
8
8
|
|
9
9
|
def run
|
10
10
|
::Katello::Resources::Candlepin::Environment.destroy(input['cp_id'])
|
11
|
+
rescue ::Katello::Errors::CandlepinEnvironmentGone
|
12
|
+
Rails.logger.info("Candlepin environment cp_id=#{input['cp_id']} was not found, continuing")
|
11
13
|
end
|
12
14
|
end
|
13
15
|
end
|
@@ -47,14 +47,14 @@ module Actions
|
|
47
47
|
|
48
48
|
dispatch_message(history) unless input[:bulk]
|
49
49
|
|
50
|
-
schedule_timeout(timeout)
|
50
|
+
schedule_timeout(timeout, optional: true)
|
51
51
|
end
|
52
52
|
when Dynflow::Action::Skip
|
53
53
|
# Do not fail and goto a paused state, instead skip and send the state to warning so we do not block other host actions
|
54
54
|
when Dynflow::Action::Timeouts::Timeout
|
55
55
|
process_timeout
|
56
56
|
when 'accepted'
|
57
|
-
schedule_timeout(finish_timeout)
|
57
|
+
schedule_timeout(finish_timeout, optional: true)
|
58
58
|
suspend
|
59
59
|
else
|
60
60
|
fail_on_errors
|
@@ -15,8 +15,9 @@ module Actions
|
|
15
15
|
repos.in_groups_of(Setting[:foreman_proxy_content_batch_size], false) do |repo_batch|
|
16
16
|
concurrence do
|
17
17
|
repo_batch.each do |repo|
|
18
|
-
plan_pulp_action(
|
19
|
-
|
18
|
+
plan_pulp_action(
|
19
|
+
[Actions::Pulp::Orchestration::Repository::SmartProxySync,
|
20
|
+
Actions::Pulp3::CapsuleContent::Sync],
|
20
21
|
repo, smart_proxy,
|
21
22
|
skip_metadata_check: skip_metadata_check)
|
22
23
|
end
|
@@ -77,7 +77,7 @@ module Actions
|
|
77
77
|
plan_action(Candlepin::Environment::SetContent, content_view, library, content_view.content_view_environment(library)) unless options[:skip_promotion]
|
78
78
|
plan_action(Katello::Foreman::ContentUpdate, library, content_view) unless options[:skip_promotion]
|
79
79
|
plan_action(ContentView::ErrataMail, content_view, library) unless options[:skip_promotion]
|
80
|
-
|
80
|
+
plan_action(ContentView::Promote, version, find_environments(options[:environment_ids]), options[:is_force_promote]) if options[:environment_ids]&.any?
|
81
81
|
plan_self(history_id: history.id, content_view_id: content_view.id,
|
82
82
|
auto_publish_composite_ids: auto_publish_composite_ids(content_view),
|
83
83
|
content_view_version_name: version.name,
|
@@ -186,6 +186,11 @@ module Actions
|
|
186
186
|
end
|
187
187
|
end
|
188
188
|
|
189
|
+
def find_environments(environment_ids)
|
190
|
+
return nil unless environment_ids&.any?
|
191
|
+
::Katello::KTEnvironment.where(:id => environment_ids)
|
192
|
+
end
|
193
|
+
|
189
194
|
def handle_import(version, path:, metadata:)
|
190
195
|
sequence do
|
191
196
|
plan_action(::Actions::Pulp3::Orchestration::ContentViewVersion::Import, version, path: path, metadata: metadata)
|
@@ -10,7 +10,7 @@ module Actions
|
|
10
10
|
source_repositories.each do |repositories|
|
11
11
|
new_repository = repositories.first.build_clone(content_view: version.content_view,
|
12
12
|
version: version)
|
13
|
-
plan_action(Repository::Create, new_repository,
|
13
|
+
plan_action(Repository::Create, new_repository, true)
|
14
14
|
repository_mapping[repositories] = new_repository
|
15
15
|
end
|
16
16
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
module Actions
|
2
2
|
module Katello
|
3
3
|
module ContentViewVersion
|
4
|
-
# rubocop:disable Metrics/ClassLength
|
5
4
|
class IncrementalUpdate < Actions::EntryAction
|
6
5
|
include ::Katello::ContentViewHelper
|
7
6
|
attr_accessor :new_content_view_version
|
@@ -325,52 +324,6 @@ module Actions
|
|
325
324
|
plan_action(Katello::ContentView::Promote, new_version, environments, true, nil, true)
|
326
325
|
end
|
327
326
|
|
328
|
-
def copy_deb_content(new_repo, dep_solve, deb_ids)
|
329
|
-
copy_outputs = []
|
330
|
-
if new_repo.content_type == ::Katello::Repository::DEB_TYPE
|
331
|
-
unless deb_ids.blank?
|
332
|
-
copy_outputs << plan_action(Pulp::Repository::CopyUnits, new_repo.library_instance, new_repo,
|
333
|
-
::Katello::Deb.with_identifiers(deb_ids),
|
334
|
-
incremental_update: dep_solve).output
|
335
|
-
end
|
336
|
-
end
|
337
|
-
copy_outputs
|
338
|
-
end
|
339
|
-
|
340
|
-
def copy_yum_content(new_repo, dep_solve, package_ids, errata_ids)
|
341
|
-
return [] unless new_repo.content_type == ::Katello::Repository::YUM_TYPE
|
342
|
-
|
343
|
-
copy_outputs = []
|
344
|
-
|
345
|
-
unless errata_ids.blank?
|
346
|
-
content_present_in_this_repo = new_repo
|
347
|
-
.library_instance
|
348
|
-
.errata
|
349
|
-
.with_identifiers(errata_ids)
|
350
|
-
.exists?
|
351
|
-
if content_present_in_this_repo
|
352
|
-
copy_outputs << plan_action(Pulp::Repository::CopyUnits, new_repo.library_instance, new_repo,
|
353
|
-
::Katello::Erratum.with_identifiers(errata_ids),
|
354
|
-
incremental_update: dep_solve).output
|
355
|
-
end
|
356
|
-
end
|
357
|
-
|
358
|
-
unless package_ids.blank?
|
359
|
-
content_present_in_this_repo = new_repo
|
360
|
-
.library_instance
|
361
|
-
.rpms
|
362
|
-
.with_identifiers(package_ids)
|
363
|
-
.exists?
|
364
|
-
if content_present_in_this_repo
|
365
|
-
copy_outputs << plan_action(Pulp::Repository::CopyUnits, new_repo.library_instance, new_repo,
|
366
|
-
::Katello::Rpm.with_identifiers(package_ids),
|
367
|
-
incremental_update: dep_solve).output
|
368
|
-
end
|
369
|
-
end
|
370
|
-
|
371
|
-
copy_outputs
|
372
|
-
end
|
373
|
-
|
374
327
|
def plan_copy(action_class, source_repo, target_repo, clauses = nil, override_config = nil)
|
375
328
|
plan_action(action_class,
|
376
329
|
:source_pulp_id => source_repo.pulp_id,
|
@@ -19,7 +19,7 @@ module Actions
|
|
19
19
|
|
20
20
|
def run
|
21
21
|
models = []
|
22
|
-
::Katello::RepositoryTypeManager.
|
22
|
+
::Katello::RepositoryTypeManager.enabled_repository_types.each_value do |repo_type|
|
23
23
|
indexable_types = repo_type.content_types_to_index
|
24
24
|
models += indexable_types&.map(&:model_class)
|
25
25
|
models.select! { |model| model.many_repository_associations }
|
@@ -2,20 +2,18 @@ module Actions
|
|
2
2
|
module Katello
|
3
3
|
module Repository
|
4
4
|
class CloneContents < Actions::Base
|
5
|
-
include Actions::Katello::PulpSelector
|
6
5
|
include Actions::Katello::CheckMatchingContent
|
7
6
|
|
8
7
|
def plan(source_repositories, new_repository, options)
|
9
8
|
filters = options.fetch(:filters, nil)
|
10
9
|
rpm_filenames = options.fetch(:rpm_filenames, nil)
|
11
10
|
generate_metadata = options.fetch(:generate_metadata, true)
|
12
|
-
purge_empty_contents = options.fetch(:purge_empty_contents, false)
|
13
11
|
copy_contents = options.fetch(:copy_contents, true)
|
14
12
|
solve_dependencies = options.fetch(:solve_dependencies, false)
|
15
13
|
|
16
14
|
sequence do
|
17
15
|
if copy_contents
|
18
|
-
|
16
|
+
plan_action(Pulp3::Orchestration::Repository::CopyAllUnits,
|
19
17
|
new_repository,
|
20
18
|
SmartProxy.pulp_primary,
|
21
19
|
source_repositories,
|
@@ -29,10 +27,6 @@ module Actions
|
|
29
27
|
index_options[:source_repository_id] = source_repositories.first.id if source_repositories.count == 1 && filters.empty? && rpm_filenames.nil?
|
30
28
|
index_options[:matching_content] = matching_content
|
31
29
|
plan_action(Katello::Repository::IndexContent, index_options)
|
32
|
-
|
33
|
-
if purge_empty_contents && new_repository.backend_service(SmartProxy.pulp_primary).should_purge_empty_contents?
|
34
|
-
plan_action(Katello::Repository::PurgeEmptyContent, id: new_repository.id)
|
35
|
-
end
|
36
30
|
end
|
37
31
|
end
|
38
32
|
|
@@ -4,18 +4,12 @@ module Actions
|
|
4
4
|
# Clones the contnet of the repository into the environment
|
5
5
|
# effectively promotion the repository to the environment
|
6
6
|
class CloneToEnvironment < Actions::Base
|
7
|
-
include Actions::Katello::PulpSelector
|
8
7
|
def plan(repository, environment)
|
9
8
|
clone = find_or_build_environment_clone(repository, environment)
|
10
9
|
|
11
10
|
sequence do
|
12
11
|
if clone.new_record?
|
13
|
-
plan_action(Repository::Create, clone,
|
14
|
-
else
|
15
|
-
#only clear if it should be empty, but its not
|
16
|
-
plan_optional_pulp_action([Actions::Pulp::Repository::Clear], clone, SmartProxy.pulp_primary)
|
17
|
-
# Do we need to refresh distributors here?
|
18
|
-
plan_optional_pulp_action([Actions::Pulp::Orchestration::Repository::RefreshIfNeeded], clone, SmartProxy.pulp_primary)
|
12
|
+
plan_action(Repository::Create, clone, true)
|
19
13
|
end
|
20
14
|
|
21
15
|
plan_action(::Actions::Katello::Repository::CloneContents, [repository], clone, :copy_contents => !clone.yum?)
|
@@ -2,9 +2,7 @@ module Actions
|
|
2
2
|
module Katello
|
3
3
|
module Repository
|
4
4
|
class Create < Actions::EntryAction
|
5
|
-
def plan(repository,
|
6
|
-
clone = args[:clone] || false
|
7
|
-
force_repo_create = args[:force_repo_create] || false
|
5
|
+
def plan(repository, clone = false)
|
8
6
|
repository.save!
|
9
7
|
root = repository.root
|
10
8
|
|
@@ -13,7 +11,7 @@ module Actions
|
|
13
11
|
org = repository.organization
|
14
12
|
sequence do
|
15
13
|
create_action = plan_action(Pulp3::Orchestration::Repository::Create,
|
16
|
-
repository, SmartProxy.pulp_primary
|
14
|
+
repository, SmartProxy.pulp_primary)
|
17
15
|
|
18
16
|
return if create_action.error
|
19
17
|
|
@@ -24,10 +22,8 @@ module Actions
|
|
24
22
|
if repository.product.redhat?
|
25
23
|
plan_action(Actions::Candlepin::Environment::AddContentToEnvironment, :view_env_cp_id => view_env.cp_id, :content_id => repository.content_id)
|
26
24
|
else
|
27
|
-
|
28
|
-
|
29
|
-
plan_action(Actions::Candlepin::Environment::AddContentToEnvironment, :view_env_cp_id => view_env.cp_id, :content_id => content_create.input[:content_id])
|
30
|
-
end
|
25
|
+
content_create = plan_action(Katello::Product::ContentCreate, root)
|
26
|
+
plan_action(Actions::Candlepin::Environment::AddContentToEnvironment, :view_env_cp_id => view_env.cp_id, :content_id => content_create.input[:content_id])
|
31
27
|
end
|
32
28
|
end
|
33
29
|
|
@@ -10,7 +10,7 @@ module Actions
|
|
10
10
|
repository.relative_path = repository.custom_repo_path
|
11
11
|
repository.save!
|
12
12
|
action_subject(repository)
|
13
|
-
plan_action(::Actions::Katello::Repository::Create, repository)
|
13
|
+
plan_action(::Actions::Katello::Repository::Create, repository, false)
|
14
14
|
end
|
15
15
|
|
16
16
|
def humanized_name
|
@@ -2,7 +2,6 @@ module Actions
|
|
2
2
|
module Katello
|
3
3
|
module Repository
|
4
4
|
class Destroy < Actions::EntryAction
|
5
|
-
include Actions::Katello::PulpSelector
|
6
5
|
middleware.use ::Actions::Middleware::RemoteAction
|
7
6
|
|
8
7
|
# options:
|
@@ -20,8 +19,7 @@ module Actions
|
|
20
19
|
fail repository.errors.messages.values.join("\n")
|
21
20
|
end
|
22
21
|
|
23
|
-
|
24
|
-
Actions::Pulp3::Orchestration::Repository::Delete],
|
22
|
+
plan_action(Actions::Pulp3::Orchestration::Repository::Delete,
|
25
23
|
repository,
|
26
24
|
SmartProxy.pulp_primary)
|
27
25
|
|
@@ -13,6 +13,7 @@ module Actions
|
|
13
13
|
unit_keys = repo_service.unit_keys(uploads)
|
14
14
|
generate_metadata = options.fetch(:generate_metadata, true)
|
15
15
|
sync_capsule = options.fetch(:sync_capsule, true)
|
16
|
+
generate_applicability = options.fetch(:generate_applicability, repository.yum?)
|
16
17
|
|
17
18
|
options[:content_type] ||= ::Katello::RepositoryTypeManager.find(repository.content_type).default_managed_content_type.label
|
18
19
|
unit_type_id = SmartProxy.pulp_primary.content_service(options[:content_type])::CONTENT_TYPE
|
@@ -29,8 +30,7 @@ module Actions
|
|
29
30
|
unit_metadata: unit_metadata
|
30
31
|
}
|
31
32
|
|
32
|
-
import_upload =
|
33
|
-
Actions::Pulp3::Orchestration::Repository::ImportUpload],
|
33
|
+
import_upload = plan_action(Actions::Pulp3::Orchestration::Repository::ImportUpload,
|
34
34
|
repository, SmartProxy.pulp_primary, import_upload_args)
|
35
35
|
plan_action(FinishUpload, repository, :import_upload_task => import_upload.output,
|
36
36
|
generate_metadata: false, content_type: options[:content_type])
|
@@ -38,6 +38,7 @@ module Actions
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
plan_action(Katello::Repository::MetadataGenerate, repository) if generate_metadata
|
41
|
+
plan_action(Actions::Katello::Applicability::Repository::Regenerate, :repo_ids => [repository.id]) if generate_applicability
|
41
42
|
plan_self(repository_id: repository.id, sync_capsule: sync_capsule, upload_results: upload_results)
|
42
43
|
end
|
43
44
|
end
|
@@ -7,7 +7,7 @@ module Actions
|
|
7
7
|
def plan(repository)
|
8
8
|
action_subject repository
|
9
9
|
repository.save!
|
10
|
-
plan_action(::Actions::
|
10
|
+
plan_action(::Actions::Pulp3::Orchestration::Repository::RefreshIfNeeded, repository)
|
11
11
|
plan_self(:repository_id => repository.id)
|
12
12
|
end
|
13
13
|
|
@@ -2,22 +2,16 @@ module Actions
|
|
2
2
|
module Katello
|
3
3
|
module Repository
|
4
4
|
class MetadataGenerate < Actions::Base
|
5
|
-
include Actions::Katello::PulpSelector
|
6
|
-
|
7
5
|
def plan(repository, options = {})
|
8
|
-
dependency = options.fetch(:dependency, nil)
|
9
|
-
force = options.fetch(:force, false)
|
10
6
|
source_repository = options.fetch(:source_repository, nil)
|
11
7
|
source_repository ||= repository.target_repository if repository.link?
|
12
8
|
smart_proxy = options.fetch(:smart_proxy, SmartProxy.pulp_primary)
|
13
9
|
matching_content = options.fetch(:matching_content, false)
|
14
10
|
|
15
|
-
|
11
|
+
plan_action(Pulp3::Orchestration::Repository::GenerateMetadata,
|
16
12
|
repository, smart_proxy,
|
17
|
-
:force => force,
|
18
13
|
:source_repository => source_repository,
|
19
|
-
:matching_content => matching_content
|
20
|
-
:dependency => dependency)
|
14
|
+
:matching_content => matching_content)
|
21
15
|
end
|
22
16
|
end
|
23
17
|
end
|
@@ -2,13 +2,10 @@ module Actions
|
|
2
2
|
module Katello
|
3
3
|
module Repository
|
4
4
|
class RefreshRepository < Actions::Base
|
5
|
-
include Actions::Katello::PulpSelector
|
6
|
-
|
7
5
|
def plan(repo, options = {})
|
8
6
|
User.as_anonymous_admin do
|
9
7
|
repo = ::Katello::Repository.find(repo.id)
|
10
|
-
|
11
|
-
Actions::Pulp::Orchestration::Repository::RefreshIfNeeded],
|
8
|
+
plan_action(Actions::Pulp3::Orchestration::Repository::RefreshIfNeeded,
|
12
9
|
repo, SmartProxy.default_capsule!, :dependency => options[:dependency])
|
13
10
|
plan_self(:name => repo.name, :dependency => options[:dependency])
|
14
11
|
end
|
@@ -3,7 +3,6 @@ module Actions
|
|
3
3
|
module Repository
|
4
4
|
class RemoveContent < Actions::EntryAction
|
5
5
|
include Dynflow::Action::WithSubPlans
|
6
|
-
include Actions::Katello::PulpSelector
|
7
6
|
|
8
7
|
def plan(repository, content_units, options = {})
|
9
8
|
sync_capsule = options.fetch(:sync_capsule, true)
|
@@ -18,19 +17,22 @@ module Actions
|
|
18
17
|
|
19
18
|
content_unit_ids = content_units.map(&:id)
|
20
19
|
content_unit_type = options[:content_type] || content_units.first.class::CONTENT_TYPE
|
20
|
+
::Katello::RepositoryTypeManager.check_content_matches_repo_type!(repository, content_unit_type)
|
21
|
+
|
22
|
+
generate_applicability = options.fetch(:generate_applicability, repository.yum?)
|
21
23
|
|
22
24
|
sequence do
|
23
25
|
remove_content_args = {
|
24
26
|
:contents => content_unit_ids,
|
25
27
|
:content_unit_type => content_unit_type}
|
26
28
|
repository.clear_smart_proxy_sync_histories
|
27
|
-
pulp_action =
|
28
|
-
|
29
|
-
Pulp3::Orchestration::Repository::RemoveUnits],
|
29
|
+
pulp_action = plan_action(
|
30
|
+
Pulp3::Orchestration::Repository::RemoveUnits,
|
30
31
|
repository, SmartProxy.pulp_primary, remove_content_args)
|
31
32
|
return if pulp_action.error
|
32
33
|
plan_self(:content_unit_class => content_units.first.class.name, :content_unit_ids => content_unit_ids)
|
33
34
|
plan_action(CapsuleSync, repository) if sync_capsule
|
35
|
+
plan_action(Actions::Katello::Applicability::Repository::Regenerate, :repo_ids => [repository.id]) if generate_applicability
|
34
36
|
end
|
35
37
|
end
|
36
38
|
|
@@ -5,7 +5,6 @@ module Actions
|
|
5
5
|
class Sync < Actions::EntryAction
|
6
6
|
extend ApipieDSL::Class
|
7
7
|
include Helpers::Presenter
|
8
|
-
include Actions::Katello::PulpSelector
|
9
8
|
include ::Actions::ObservableAction
|
10
9
|
middleware.use Actions::Middleware::ExecuteIfContentsChanged
|
11
10
|
|
@@ -20,12 +19,10 @@ module Actions
|
|
20
19
|
# rubocop:disable Metrics/MethodLength
|
21
20
|
# rubocop:disable Metrics/CyclomaticComplexity
|
22
21
|
# rubocop:disable Metrics/PerceivedComplexity
|
23
|
-
# rubocop:disable Metrics/AbcSize
|
24
22
|
def plan(repo, options = {})
|
25
23
|
action_subject(repo)
|
26
24
|
|
27
25
|
source_url = options.fetch(:source_url, nil)
|
28
|
-
incremental = options.fetch(:incremental, false)
|
29
26
|
validate_contents = options.fetch(:validate_contents, false)
|
30
27
|
skip_metadata_check = options.fetch(:skip_metadata_check, false) || (validate_contents && repo.yum?)
|
31
28
|
generate_applicability = options.fetch(:generate_applicability, repo.yum?)
|
@@ -37,25 +34,17 @@ module Actions
|
|
37
34
|
pulp_sync_options = {}
|
38
35
|
pulp_sync_options[:download_policy] = ::Runcible::Models::YumImporter::DOWNLOAD_ON_DEMAND if validate_contents && repo.yum?
|
39
36
|
|
40
|
-
#pulp2 options
|
41
|
-
pulp_sync_options[:force_full] = true if skip_metadata_check && repo.yum?
|
42
|
-
pulp_sync_options[:repair_sync] = true if validate_contents && repo.deb?
|
43
|
-
pulp_sync_options[:remove_missing] = false if incremental
|
44
|
-
pulp_sync_options[:source_url] = source_url
|
45
|
-
|
46
37
|
#pulp3 options
|
47
38
|
pulp_sync_options[:optimize] = false if skip_metadata_check && repo.yum?
|
48
39
|
|
49
40
|
sequence do
|
50
|
-
if
|
41
|
+
if validate_contents
|
51
42
|
plan_action(Katello::Repository::VerifyChecksum, repo)
|
52
43
|
else
|
53
|
-
plan_action(
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
SmartProxy.pulp_primary,
|
58
|
-
pulp_sync_options)
|
44
|
+
sync_action = plan_action(Actions::Pulp3::Orchestration::Repository::Sync,
|
45
|
+
repo,
|
46
|
+
SmartProxy.pulp_primary,
|
47
|
+
pulp_sync_options)
|
59
48
|
output = sync_action.output
|
60
49
|
|
61
50
|
contents_changed = skip_metadata_check || output[:contents_changed]
|
@@ -65,7 +54,6 @@ module Actions
|
|
65
54
|
plan_action(Katello::Repository::FetchPxeFiles, :id => repo.id)
|
66
55
|
plan_action(Katello::Repository::CorrectChecksum, repo)
|
67
56
|
concurrence do
|
68
|
-
plan_action(Pulp::Repository::Download, :pulp_id => repo.pulp_id, :options => {:verify_all_units => true}) if validate_contents && repo.yum?
|
69
57
|
plan_action(Katello::Repository::MetadataGenerate, repo, :force => true) if skip_metadata_check && repo.yum?
|
70
58
|
plan_action(Katello::Repository::ErrataMail, repo, nil, contents_changed)
|
71
59
|
plan_action(Actions::Katello::Applicability::Repository::Regenerate, :repo_ids => [repo.id]) if generate_applicability
|
@@ -99,19 +87,11 @@ module Actions
|
|
99
87
|
end
|
100
88
|
|
101
89
|
def presenter
|
102
|
-
found = all_planned_actions(Pulp::Repository::Sync)
|
103
90
|
found = all_planned_actions(Pulp3::Repository::Sync) if found.empty?
|
104
91
|
found = all_planned_actions(Pulp3::Repository::Repair) if found.empty?
|
105
92
|
Helpers::Presenter::Delegated.new(self, found)
|
106
93
|
end
|
107
94
|
|
108
|
-
def pulp_task_id
|
109
|
-
pulp_action = planned_actions(Pulp::Repository::Sync).first
|
110
|
-
if (pulp_task = Array(pulp_action.external_task).first)
|
111
|
-
pulp_task.fetch(:task_id)
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
95
|
def rescue_strategy
|
116
96
|
Dynflow::Action::Rescue::Skip
|
117
97
|
end
|
@@ -36,8 +36,7 @@ module Actions
|
|
36
36
|
end
|
37
37
|
if root.pulp_update_needed?
|
38
38
|
sequence do
|
39
|
-
|
40
|
-
::Actions::Pulp3::Orchestration::Repository::Update],
|
39
|
+
plan_action(::Actions::Pulp3::Orchestration::Repository::Update,
|
41
40
|
repository,
|
42
41
|
SmartProxy.pulp_primary)
|
43
42
|
plan_self(:repository_id => root.library_instance.id)
|
@@ -2,12 +2,9 @@ module Actions
|
|
2
2
|
module Katello
|
3
3
|
module Repository
|
4
4
|
class UpdateHttpProxyDetails < Actions::EntryAction
|
5
|
-
include Actions::Katello::PulpSelector
|
6
|
-
|
7
5
|
def plan(repository)
|
8
|
-
|
9
|
-
|
10
|
-
Actions::Pulp3::Repository::UpdateRemote],
|
6
|
+
plan_action(
|
7
|
+
Actions::Pulp3::Repository::UpdateRemote,
|
11
8
|
repository,
|
12
9
|
SmartProxy.pulp_primary)
|
13
10
|
end
|
@@ -6,7 +6,7 @@ module Actions
|
|
6
6
|
action_subject repo
|
7
7
|
repo.root.update!(:url => upstream_url(repo)) if repo.library_instance?
|
8
8
|
repo.update!(relative_path: relative_path(repo))
|
9
|
-
plan_action(::Actions::
|
9
|
+
plan_action(::Actions::Pulp3::Orchestration::Repository::RefreshIfNeeded, repo)
|
10
10
|
plan_self(:repository_id => repo.id)
|
11
11
|
end
|
12
12
|
|
@@ -7,20 +7,24 @@ module Actions
|
|
7
7
|
module Repository
|
8
8
|
class UploadFiles < Actions::EntryAction
|
9
9
|
include Actions::Katello::PulpSelector
|
10
|
-
def plan(repository, files, content_type = nil)
|
10
|
+
def plan(repository, files, content_type = nil, options = {})
|
11
11
|
action_subject(repository)
|
12
12
|
repository.clear_smart_proxy_sync_histories
|
13
13
|
tmp_files = prepare_tmp_files(files)
|
14
14
|
|
15
15
|
content_type ||= ::Katello::RepositoryTypeManager.find(repository.content_type).default_managed_content_type.label
|
16
|
+
::Katello::RepositoryTypeManager.check_content_matches_repo_type!(repository, content_type)
|
17
|
+
|
16
18
|
unit_type_id = SmartProxy.pulp_primary.content_service(content_type)::CONTENT_TYPE
|
17
19
|
upload_actions = []
|
20
|
+
|
21
|
+
generate_applicability = options.fetch(:generate_applicability, repository.yum?)
|
22
|
+
|
18
23
|
sequence do
|
19
24
|
concurrence do
|
20
25
|
tmp_files.each do |file|
|
21
26
|
sequence do
|
22
|
-
upload_action =
|
23
|
-
Pulp3::Orchestration::Repository::UploadContent],
|
27
|
+
upload_action = plan_action(Pulp3::Orchestration::Repository::UploadContent,
|
24
28
|
repository, SmartProxy.pulp_primary!, file, unit_type_id)
|
25
29
|
|
26
30
|
upload_actions << upload_action.output
|
@@ -30,6 +34,7 @@ module Actions
|
|
30
34
|
|
31
35
|
plan_action(FinishUpload, repository, content_type: content_type, upload_actions: upload_actions)
|
32
36
|
plan_self(tmp_files: tmp_files)
|
37
|
+
plan_action(Actions::Katello::Applicability::Repository::Regenerate, :repo_ids => [repository.id]) if generate_applicability
|
33
38
|
end
|
34
39
|
ensure
|
35
40
|
# Delete tmp files when some exception occurred. Would be
|
@@ -2,21 +2,12 @@ module Actions
|
|
2
2
|
module Katello
|
3
3
|
module Repository
|
4
4
|
class UploadPackageGroup < Actions::EntryAction
|
5
|
-
def plan(repository,
|
5
|
+
def plan(repository, _params)
|
6
6
|
action_subject(repository)
|
7
|
-
unit_key = {"repo_id": repository.pulp_id, "id": params[:name].parameterize.underscore}
|
8
7
|
|
9
8
|
sequence do
|
10
|
-
upload_request = plan_action(Pulp::Repository::CreateUploadRequest)
|
11
|
-
pkg_group_upload = plan_action(Pulp::Repository::ImportUpload,
|
12
|
-
pulp_id: repository.pulp_id,
|
13
|
-
unit_type_id: 'package_group',
|
14
|
-
unit_key: unit_key,
|
15
|
-
upload_id: upload_request.output[:upload_id],
|
16
|
-
unit_metadata: params)
|
17
|
-
|
18
9
|
plan_action(IndexPackageGroups, repository)
|
19
|
-
plan_action(FinishUpload, repository, :
|
10
|
+
plan_action(FinishUpload, repository, :generate_metadata => true)
|
20
11
|
end
|
21
12
|
end
|
22
13
|
|
@@ -15,7 +15,7 @@ module Actions
|
|
15
15
|
fail ::Katello::Errors::ConflictException, _("The repository is already enabled")
|
16
16
|
end
|
17
17
|
repository = mapper.build_repository
|
18
|
-
plan_action(Repository::Create, repository,
|
18
|
+
plan_action(Repository::Create, repository, false)
|
19
19
|
action_subject(repository)
|
20
20
|
plan_self
|
21
21
|
end
|
@@ -3,9 +3,9 @@ module Actions
|
|
3
3
|
module Orchestration
|
4
4
|
module Repository
|
5
5
|
class Create < Pulp3::Abstract
|
6
|
-
def plan(repository, smart_proxy
|
6
|
+
def plan(repository, smart_proxy)
|
7
7
|
sequence do
|
8
|
-
create_action = plan_action(Actions::Pulp3::Repository::Create, repository, smart_proxy
|
8
|
+
create_action = plan_action(Actions::Pulp3::Repository::Create, repository, smart_proxy)
|
9
9
|
plan_action(Actions::Pulp3::Repository::SaveVersion, repository, repository_details: create_action.output[:response])
|
10
10
|
|
11
11
|
if repository.content_view.default? || !smart_proxy.pulp_primary?
|
@@ -2,14 +2,13 @@ module Actions
|
|
2
2
|
module Pulp3
|
3
3
|
module Repository
|
4
4
|
class Create < Pulp3::Abstract
|
5
|
-
def plan(repository, smart_proxy
|
6
|
-
plan_self(:repository_id => repository.id, :smart_proxy_id => smart_proxy.id
|
5
|
+
def plan(repository, smart_proxy)
|
6
|
+
plan_self(:repository_id => repository.id, :smart_proxy_id => smart_proxy.id)
|
7
7
|
end
|
8
8
|
|
9
9
|
def run
|
10
10
|
repo = ::Katello::Repository.find(input[:repository_id])
|
11
|
-
|
12
|
-
output[:response] = repo.backend_service(smart_proxy).with_mirror_adapter.create(force)
|
11
|
+
output[:response] = repo.backend_service(smart_proxy).with_mirror_adapter.create
|
13
12
|
end
|
14
13
|
end
|
15
14
|
end
|
@@ -3,12 +3,7 @@ module Actions
|
|
3
3
|
module Repository
|
4
4
|
class CreateRemote < Pulp3::Abstract
|
5
5
|
def plan(repository, smart_proxy)
|
6
|
-
|
7
|
-
end
|
8
|
-
|
9
|
-
def run
|
10
|
-
repo = ::Katello::Repository.find(input[:repository_id])
|
11
|
-
output[:response] = repo.backend_service(smart_proxy).create_remote
|
6
|
+
repository.backend_service(smart_proxy).create_remote if repository.root.url?
|
12
7
|
end
|
13
8
|
|
14
9
|
def rescue_strategy
|