katello 3.17.0 → 3.18.0
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/registry/registry_proxies_controller.rb +38 -21
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +3 -1
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +10 -15
- data/app/controllers/katello/api/v2/capsule_content_controller.rb +2 -2
- data/app/controllers/katello/api/v2/content_credentials_controller.rb +1 -8
- data/app/controllers/katello/api/v2/content_export_incrementals_controller.rb +98 -0
- data/app/controllers/katello/api/v2/content_exports_controller.rb +84 -0
- data/app/controllers/katello/api/v2/content_imports_controller.rb +59 -0
- data/app/controllers/katello/api/v2/content_view_components_controller.rb +31 -14
- data/app/controllers/katello/api/v2/content_view_filters_controller.rb +17 -8
- data/app/controllers/katello/api/v2/content_view_repositories_controller.rb +1 -0
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +65 -71
- data/app/controllers/katello/api/v2/content_views_controller.rb +37 -26
- data/app/controllers/katello/api/v2/environments_controller.rb +8 -8
- data/app/controllers/katello/api/v2/gpg_keys_controller.rb +5 -5
- data/app/controllers/katello/api/v2/host_collections_controller.rb +19 -16
- data/app/controllers/katello/api/v2/host_debs_controller.rb +1 -0
- data/app/controllers/katello/api/v2/host_errata_controller.rb +2 -2
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +35 -6
- data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +1 -1
- data/app/controllers/katello/api/v2/products_controller.rb +9 -9
- data/app/controllers/katello/api/v2/repositories_bulk_actions_controller.rb +1 -1
- data/app/controllers/katello/api/v2/repositories_controller.rb +10 -5
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +24 -14
- data/app/controllers/katello/api/v2/subscriptions_controller.rb +1 -1
- data/app/controllers/katello/api/v2/sync_plans_controller.rb +8 -9
- data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +9 -2
- data/app/controllers/katello/concerns/api/v2/authorization.rb +19 -5
- data/app/controllers/katello/concerns/api/v2/bulk_hosts_extensions.rb +22 -18
- data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +21 -0
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +1 -1
- data/app/controllers/katello/concerns/organizations_controller_extensions.rb +2 -1
- data/app/controllers/katello/concerns/registration_controller_extensions.rb +16 -0
- data/app/helpers/katello/katello_urls_helper.rb +5 -2
- data/app/lib/actions/candlepin/product/content_create.rb +2 -0
- data/app/lib/actions/candlepin/product/content_update.rb +2 -0
- data/app/lib/actions/helpers/smart_proxy_sync_history_helper.rb +24 -0
- data/app/lib/actions/katello/applicability/hosts/bulk_generate.rb +6 -2
- data/app/lib/actions/katello/capsule_content/sync.rb +1 -1
- data/app/lib/actions/katello/capsule_content/sync_capsule.rb +16 -7
- data/app/lib/actions/katello/content_view/promote_to_environment.rb +1 -1
- data/app/lib/actions/katello/content_view/publish.rb +9 -9
- data/app/lib/actions/katello/content_view_version/import.rb +8 -13
- data/app/lib/actions/katello/content_view_version/import_library.rb +17 -0
- data/app/lib/actions/katello/content_view_version/incremental_update.rb +18 -3
- data/app/lib/actions/katello/host/hypervisors_update.rb +18 -0
- data/app/lib/actions/katello/host/update_system_purpose.rb +31 -0
- data/app/lib/actions/katello/host/upload_package_profile.rb +3 -1
- data/app/lib/actions/katello/host/upload_profiles.rb +8 -6
- data/app/lib/actions/katello/organization/manifest_delete.rb +0 -1
- data/app/lib/actions/katello/organization/manifest_import.rb +0 -1
- data/app/lib/actions/katello/organization/manifest_refresh.rb +0 -1
- data/app/lib/actions/katello/product/content_create.rb +7 -6
- data/app/lib/actions/katello/repository/filtered_index_content.rb +10 -1
- data/app/lib/actions/katello/repository/import_upload.rb +4 -1
- data/app/lib/actions/katello/repository/remove_content.rb +1 -1
- data/app/lib/actions/katello/repository/sync.rb +3 -1
- data/app/lib/actions/katello/repository/update.rb +5 -1
- data/app/lib/actions/katello/repository/upload_files.rb +1 -0
- data/app/lib/actions/middleware/record_smart_proxy_sync_history.rb +15 -0
- data/app/lib/actions/pulp/consumer/sync_capsule.rb +4 -2
- data/app/lib/actions/pulp/repository/distributor_publish.rb +1 -1
- data/app/lib/actions/pulp3/capsule_content/sync.rb +1 -0
- data/app/lib/actions/pulp3/content_migration.rb +10 -0
- data/app/lib/actions/pulp3/content_migration_presenter.rb +59 -0
- data/app/lib/actions/pulp3/content_view/delete_repository_references.rb +1 -1
- data/app/lib/actions/pulp3/content_view_version/create_importer.rb +7 -3
- data/app/lib/actions/pulp3/content_view_version/export.rb +7 -1
- data/app/lib/actions/pulp3/content_view_version/import.rb +7 -3
- data/app/lib/actions/pulp3/import_migration.rb +6 -1
- data/app/lib/actions/pulp3/orchestration/content_view_version/copy_version_units_to_library.rb +2 -1
- data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +38 -14
- data/app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb +60 -0
- data/app/lib/actions/pulp3/orchestration/content_view_version/import.rb +16 -10
- data/app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb +4 -1
- data/app/lib/actions/pulp3/orchestration/repository/import_upload.rb +16 -3
- data/app/lib/actions/pulp3/repository/commit_upload.rb +2 -1
- data/app/lib/actions/pulp3/repository/copy_content.rb +1 -1
- data/app/lib/actions/pulp3/repository/delete.rb +1 -1
- data/app/lib/actions/pulp3/repository/save_artifact.rb +1 -1
- data/app/lib/actions/pulp3/repository/save_version.rb +1 -1
- data/app/lib/actions/pulp3/repository/upload_tag.rb +18 -0
- data/app/lib/katello/resources/candlepin/consumer.rb +2 -2
- data/app/lib/katello/resources/candlepin/owner.rb +5 -0
- data/app/lib/katello/resources/candlepin/upstream_consumer.rb +6 -0
- data/app/lib/katello/resources/registry.rb +3 -3
- data/app/models/katello/authorization/activation_key.rb +4 -0
- data/app/models/katello/authorization/content_view.rb +13 -0
- data/app/models/katello/authorization/content_view_component.rb +15 -0
- data/app/models/katello/authorization/content_view_filter.rb +15 -0
- data/app/models/katello/authorization/content_view_version.rb +25 -2
- data/app/models/katello/authorization/content_view_version_export_history.rb +1 -1
- data/app/models/katello/authorization/gpg_key.rb +12 -4
- data/app/models/katello/authorization/lifecycle_environment.rb +8 -0
- data/app/models/katello/authorization/organization.rb +8 -0
- data/app/models/katello/authorization/sync_plan.rb +16 -0
- data/app/models/katello/concerns/operatingsystem_extensions.rb +2 -0
- data/app/models/katello/concerns/organization_extensions.rb +4 -5
- data/app/models/katello/concerns/smart_proxy_extensions.rb +6 -4
- data/app/models/katello/content_migration_progress.rb +4 -0
- data/app/models/katello/content_view.rb +30 -4
- data/app/models/katello/content_view_component.rb +2 -0
- data/app/models/katello/content_view_filter.rb +5 -0
- data/app/models/katello/content_view_history.rb +2 -1
- data/app/models/katello/content_view_package_filter.rb +1 -1
- data/app/models/katello/content_view_puppet_module.rb +8 -0
- data/app/models/katello/content_view_repository.rb +13 -1
- data/app/models/katello/content_view_version_export_history.rb +8 -1
- data/app/models/katello/glue/candlepin/pool.rb +9 -14
- data/app/models/katello/glue/pulp/repo.rb +8 -0
- data/app/models/katello/gpg_key.rb +1 -1
- data/app/models/katello/ping.rb +8 -3
- data/app/models/katello/repository.rb +33 -0
- data/app/models/katello/root_repository.rb +26 -1
- data/app/models/katello/smart_proxy_sync_history.rb +8 -0
- data/app/services/katello/candlepin/event_handler.rb +2 -0
- data/app/services/katello/candlepin/message_handler.rb +34 -0
- data/app/services/katello/candlepin/upstream_consumer.rb +28 -0
- data/app/services/katello/host_status_manager.rb +9 -0
- data/app/services/katello/pulp3/api/apt.rb +57 -0
- data/app/services/katello/pulp3/api/core.rb +8 -0
- data/app/services/katello/pulp3/api/docker.rb +4 -0
- data/app/services/katello/pulp3/content_view_version/export.rb +125 -8
- data/app/services/katello/pulp3/content_view_version/import.rb +39 -34
- data/app/services/katello/pulp3/content_view_version/import_export_common.rb +6 -16
- data/app/services/katello/pulp3/content_view_version/import_validator.rb +114 -0
- data/app/services/katello/pulp3/deb.rb +38 -0
- data/app/services/katello/pulp3/docker_manifest.rb +1 -0
- data/app/services/katello/pulp3/docker_tag.rb +1 -0
- data/app/services/katello/pulp3/migration.rb +51 -10
- data/app/services/katello/pulp3/pulp_content_unit.rb +5 -0
- data/app/services/katello/pulp3/repository.rb +10 -4
- data/app/services/katello/pulp3/repository/ansible_collection.rb +9 -0
- data/app/services/katello/pulp3/repository/apt.rb +63 -0
- data/app/services/katello/pulp3/repository/docker.rb +9 -0
- data/app/services/katello/pulp3/repository/yum.rb +14 -9
- data/app/services/katello/pulp3/repository_mirror.rb +9 -4
- data/app/services/katello/pulp3/task.rb +4 -0
- data/app/services/katello/pulp3/task_group.rb +4 -0
- data/app/services/katello/repository_type.rb +2 -1
- data/app/services/katello/smart_proxy_helper.rb +9 -0
- data/app/views/dashboard/_subscription_widget.html.erb +0 -5
- data/app/views/foreman/hosts/_registration.html.erb +12 -0
- data/app/views/katello/api/v2/content_view_version_export_histories/show.json.rabl +1 -1
- data/app/views/katello/api/v2/content_views/base.json.rabl +1 -0
- data/app/views/katello/api/v2/repositories/base.json.rabl +1 -1
- data/app/views/katello/layouts/react.html.erb +3 -2
- data/app/views/overrides/activation_keys/_host_tab_pane.html.erb +1 -5
- data/app/views/overrides/organizations/_index_row_override.html.erb +1 -1
- data/config/routes/api/v2.rb +24 -2
- data/config/routes/overrides.rb +1 -0
- data/db/migrate/20200929200357_create_katello_smart_proxy_sync_history.rb +13 -0
- data/db/migrate/20201008204114_add_os_versions_to_katello_root_repositories.rb +5 -0
- data/db/migrate/20201012172713_remove_gpg_key_perms.rb +23 -0
- data/db/migrate/20201012192035_add_metadata_to_katello_content_view_version_export_history.rb +5 -0
- data/db/migrate/20201021150008_add_import_only_to_katello_content_view.rb +5 -0
- data/db/migrate/20201119211133_pulp3_migration_progress.rb +9 -0
- data/db/seeds.d/111-upgrade_tasks.rb +2 -1
- data/engines/bastion/app/assets/javascripts/bastion/components/notification.service.js +1 -1
- data/engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js +8 -13
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-system-purpose-modal.controller.js +112 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-system-purpose-modal.html +78 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-modal-helper.service.js +11 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-debs-installed.controller.js +2 -42
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.controller.js +6 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +12 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details.html +7 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-info.html +7 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js +17 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/views/content-view-new.html +16 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/views/content-views.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-details.controller.js +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +6 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-bulk-action.factory.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +92 -19
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +17 -20
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +17 -24
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +1292 -1170
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/it.po +17 -20
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +858 -807
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +18 -19
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +17 -24
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ru.po +17 -18
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +986 -971
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +19 -20
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +9 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/products-bulk-advanced-sync-modal.controller.js +6 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +168 -155
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +17 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +125 -113
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +15 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js +46 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository-types.service.js +8 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-details.html +1 -1
- data/lib/katello/engine.rb +2 -0
- data/lib/katello/permission_creator.rb +98 -69
- data/lib/katello/permissions/host_permissions.rb +1 -0
- data/lib/katello/plugin.rb +10 -2
- data/lib/katello/repository_types/deb.rb +9 -1
- data/lib/katello/tasks/pulp3_migration.rake +17 -3
- data/lib/katello/tasks/pulp3_migration_abort.rake +22 -0
- data/lib/katello/tasks/pulp3_migration_stats.rake +41 -0
- data/lib/katello/tasks/receptor/extract_orgs.rake +1 -1
- data/lib/katello/tasks/reset.rake +2 -1
- data/lib/katello/tasks/upgrades/3.18/add_cvv_export_history_metadata.rb +18 -0
- data/lib/katello/version.rb +1 -1
- data/locale/action_names.rb +51 -44
- data/locale/bn/katello.po +279 -55
- data/locale/cs/katello.po +278 -51
- data/locale/de/katello.po +279 -52
- data/locale/en/katello.po +278 -49
- data/locale/es/katello.po +279 -51
- data/locale/fr/katello.po +279 -51
- data/locale/gu/katello.po +279 -55
- data/locale/hi/katello.po +279 -55
- data/locale/it/katello.po +279 -51
- data/locale/ja/katello.po +279 -52
- data/locale/katello.pot +1379 -971
- data/locale/kn/katello.po +279 -55
- data/locale/ko/katello.po +279 -51
- data/locale/mr/katello.po +279 -55
- data/locale/or/katello.po +279 -55
- data/locale/pa/katello.po +279 -55
- data/locale/pt/katello.po +278 -52
- data/locale/pt_BR/katello.po +279 -51
- data/locale/ru/katello.po +279 -51
- data/locale/ta/katello.po +279 -55
- data/locale/te/katello.po +279 -55
- data/locale/zh_CN/katello.po +279 -51
- data/locale/zh_TW/katello.po +279 -52
- data/webpack/components/ActionableDetail.js +2 -1
- data/webpack/components/Search/Search.js +1 -1
- data/webpack/components/Table/MainTable.js +6 -2
- data/webpack/components/Table/TableWrapper.js +46 -9
- data/webpack/scenes/ContentViews/ContentViewSelectors.js +7 -3
- data/webpack/scenes/ContentViews/ContentViewsConstants.js +8 -0
- data/webpack/scenes/ContentViews/ContentViewsPage.js +2 -9
- data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +25 -3
- data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +14 -4
- data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +2 -1
- data/webpack/scenes/ContentViews/Details/Repositories/ContentCounts.js +56 -0
- data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +169 -0
- data/webpack/scenes/ContentViews/Details/Repositories/LastSync.js +47 -0
- data/webpack/scenes/ContentViews/Details/Repositories/RepoAddedStatus.js +17 -0
- data/webpack/scenes/ContentViews/Details/Repositories/RepoIcon.js +23 -0
- data/webpack/scenes/ContentViews/Details/Repositories/SelectableDropdown.js +49 -0
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.fixtures.json +154 -0
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.test.js +131 -0
- data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +3 -0
- data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +4 -1
- data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +2 -2
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +29 -19
- data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +17 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestConstants.js +4 -0
- data/webpack/scenes/Subscriptions/Manifest/SimpleContentAccess.js +19 -2
- data/webpack/scenes/Subscriptions/Manifest/__tests__/SimpleContentAccess.test.js +9 -1
- data/webpack/scenes/Subscriptions/Manifest/index.js +2 -1
- data/webpack/scenes/Subscriptions/SubscriptionConstants.js +1 -1
- data/webpack/scenes/Subscriptions/SubscriptionReducer.js +3 -0
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +8 -2
- data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +3 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +3 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsSelectors.test.js +6 -0
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsSelectors.test.js.snap +6 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +1 -13
- data/webpack/test-utils/react-testing-lib-wrapper.js +3 -0
- metadata +74 -13
- data/webpack/__mocks__/foremanReact/components/common/Fill/GlobalFill.js +0 -3
@@ -0,0 +1,17 @@
|
|
1
|
+
module Actions
|
2
|
+
module Katello
|
3
|
+
module ContentViewVersion
|
4
|
+
class ImportLibrary < Actions::EntryAction
|
5
|
+
def plan(organization, path:, metadata:)
|
6
|
+
action_subject(organization)
|
7
|
+
library_view = ::Katello::Pulp3::ContentViewVersion::Import.find_or_create_library_import_view(organization)
|
8
|
+
plan_action(::Actions::Katello::ContentViewVersion::Import, library_view, path: path, metadata: metadata)
|
9
|
+
end
|
10
|
+
|
11
|
+
def humanized_name
|
12
|
+
_("Import Default Content View")
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -91,7 +91,8 @@ module Actions
|
|
91
91
|
sequence do
|
92
92
|
new_puppet_environment = plan_action(Katello::ContentViewPuppetEnvironment::Clone, old_version,
|
93
93
|
:new_version => new_content_view_version).new_puppet_environment
|
94
|
-
|
94
|
+
check_puppet_module_duplicates(content[:puppet_module_ids])
|
95
|
+
copy_action_outputs += copy_puppet_content(new_puppet_environment, content[:puppet_module_ids], old_version) unless content[:puppet_module_ids].blank?
|
95
96
|
end
|
96
97
|
end
|
97
98
|
|
@@ -368,14 +369,28 @@ module Actions
|
|
368
369
|
copy_outputs
|
369
370
|
end
|
370
371
|
|
372
|
+
def check_puppet_module_duplicates(puppet_module_ids)
|
373
|
+
puppet_module_dup_counts = ::Katello::PuppetModule.where(id: puppet_module_ids).
|
374
|
+
select(:name, :author).group(:name, :author).having("count(*) > 1").size
|
375
|
+
if puppet_module_dup_counts.present?
|
376
|
+
offending_puppet_modules = puppet_module_dup_counts.keys.collect do |dup|
|
377
|
+
"#{dup[0]}-#{dup[1]}"
|
378
|
+
end
|
379
|
+
fail _("Adding multiple versions of the same Puppet Module is not supported by incremental update. The following Puppet Modules have duplicate versions in the incremental update content list: %{dup_list}" % {:dup_list => offending_puppet_modules})
|
380
|
+
end
|
381
|
+
end
|
382
|
+
|
371
383
|
def remove_puppet_modules(repo, puppet_module_ids)
|
372
384
|
plan_action(Pulp::Repository::RemoveUnits, :content_view_puppet_environment_id => repo.id, :contents => puppet_module_ids, :content_unit_type => ::Katello::PuppetModule::CONTENT_TYPE)
|
373
385
|
end
|
374
386
|
|
375
|
-
def copy_puppet_content(new_repo, puppet_module_ids)
|
387
|
+
def copy_puppet_content(new_repo, puppet_module_ids, old_version)
|
376
388
|
copy_outputs = []
|
389
|
+
# Remove older versions
|
390
|
+
query = 'SELECT a.* FROM katello_puppet_modules a LEFT JOIN katello_puppet_modules b ON a.name = b.name AND a.author = b.author AND a.sortable_version < b.sortable_version WHERE b.sortable_version IS NOT NULL AND a.id IN (:old_version_puppet_module_ids)'
|
391
|
+
old_puppet_module_ids = ::Katello::PuppetModule.find_by_sql([query, :old_version_puppet_module_ids => old_version.puppet_modules.map(&:id)]).map(&:id)
|
377
392
|
unless puppet_module_ids.blank?
|
378
|
-
remove_puppet_modules(new_repo, puppet_module_ids)
|
393
|
+
remove_puppet_modules(new_repo, (old_puppet_module_ids + puppet_module_ids).uniq)
|
379
394
|
copy_outputs = puppet_module_ids.map { |module_id| copy_puppet_module(new_repo, module_id).output }
|
380
395
|
plan_action(Pulp::ContentViewPuppetEnvironment::IndexContent, id: new_repo.id)
|
381
396
|
end
|
@@ -13,6 +13,8 @@ module Actions
|
|
13
13
|
@hypervisors = input[:hypervisors]
|
14
14
|
return unless @hypervisors
|
15
15
|
|
16
|
+
@duplicate_uuid_hypervisors = {}
|
17
|
+
|
16
18
|
User.as_anonymous_admin do
|
17
19
|
ActiveRecord::Base.transaction do
|
18
20
|
load_resources
|
@@ -30,8 +32,16 @@ module Actions
|
|
30
32
|
update_facts(uuid, host)
|
31
33
|
end
|
32
34
|
end
|
35
|
+
|
36
|
+
@duplicate_uuid_hypervisors.each do |hypervisor, existing_host|
|
37
|
+
fail _("Host creation was skipped for %s because it shares a BIOS UUID with %s. " \
|
38
|
+
"To report this hypervisor, override its dmi.system.uuid fact or set 'candlepin.use_system_uuid_for_matching' " \
|
39
|
+
"to 'true' in the Candlepin configuration." % [hypervisor[:name], existing_host.name])
|
40
|
+
end
|
33
41
|
end
|
34
42
|
|
43
|
+
private
|
44
|
+
|
35
45
|
def load_hosts_guests
|
36
46
|
@hosts.each do |uuid, host|
|
37
47
|
host.subscription_facet ||= host.build_subscription_facet(uuid: uuid)
|
@@ -81,6 +91,14 @@ module Actions
|
|
81
91
|
@hypervisors.each do |hypervisor|
|
82
92
|
next if @hosts.key?(hypervisor[:uuid])
|
83
93
|
|
94
|
+
created_host = new_hypervisors[hypervisor[:uuid]]
|
95
|
+
if created_host
|
96
|
+
# we've already created a host record for this duplicate hypervisor
|
97
|
+
# track it so we can message later, and continue processing the remaining hypervisors
|
98
|
+
@duplicate_uuid_hypervisors[hypervisor] = created_host
|
99
|
+
next
|
100
|
+
end
|
101
|
+
|
84
102
|
duplicate_name, org = duplicate_name(hypervisor, @candlepin_attributes[hypervisor[:uuid]])
|
85
103
|
new_hypervisors[hypervisor[:uuid]] = create_host_for_hypervisor(duplicate_name, org)
|
86
104
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Actions
|
2
|
+
module Katello
|
3
|
+
module Host
|
4
|
+
class UpdateSystemPurpose < Actions::EntryAction
|
5
|
+
def plan(host, service_level, purpose_role, purpose_usage, purpose_addons)
|
6
|
+
fail _("Host %s has not been registered with subscription-manager.") % host.name unless host.subscription_facet
|
7
|
+
|
8
|
+
host.subscription_facet.service_level = service_level unless service_level.nil?
|
9
|
+
host.subscription_facet.purpose_role = purpose_role unless purpose_role.nil?
|
10
|
+
host.subscription_facet.purpose_usage = purpose_usage unless purpose_usage.nil?
|
11
|
+
|
12
|
+
if purpose_addons
|
13
|
+
purpose_addon_objects = purpose_addons.delete_if(&:blank?).uniq.map { |x| ::Katello::PurposeAddon.find_or_create_by(name: x) }
|
14
|
+
host.subscription_facet.purpose_addons = purpose_addon_objects
|
15
|
+
end
|
16
|
+
|
17
|
+
host.subscription_facet.save!
|
18
|
+
plan_self(:hostname => host.name)
|
19
|
+
end
|
20
|
+
|
21
|
+
def humanized_name
|
22
|
+
if input&.dig(:hostname)
|
23
|
+
_("Updating System Purpose for host %s") % input[:hostname]
|
24
|
+
else
|
25
|
+
_("Updating System Purpose for host")
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -39,7 +39,9 @@ module Actions
|
|
39
39
|
Rails.logger.warn("Host with ID %s has no content facet, continuing" % host_id)
|
40
40
|
else
|
41
41
|
begin
|
42
|
-
|
42
|
+
if SmartProxy.pulp_primary&.has_feature?(SmartProxy::PULP_FEATURE)
|
43
|
+
::Katello::Pulp::Consumer.new(host.content_facet.uuid).upload_package_profile(profile)
|
44
|
+
end
|
43
45
|
simple_packages = profile.map { |item| ::Katello::Pulp::SimplePackage.new(item) }
|
44
46
|
host.import_package_profile(simple_packages)
|
45
47
|
rescue RestClient::ResourceNotFound
|
@@ -60,12 +60,14 @@ module Actions
|
|
60
60
|
|
61
61
|
module_stream_profile = updated_profiles + unassociated_profiles
|
62
62
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
63
|
+
if SmartProxy.pulp_primary&.has_feature?(SmartProxy::PULP_FEATURE)
|
64
|
+
unless module_stream_profile.empty?
|
65
|
+
begin
|
66
|
+
::Katello::Pulp::Consumer.new(host.content_facet.uuid).
|
67
|
+
upload_module_stream_profile(module_stream_profile)
|
68
|
+
rescue RestClient::ResourceNotFound
|
69
|
+
Rails.logger.warn("Host with ID %s was not known to Pulp, continuing" % host.id)
|
70
|
+
end
|
69
71
|
end
|
70
72
|
end
|
71
73
|
end
|
@@ -45,7 +45,6 @@ module Actions
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def finalize
|
48
|
-
subject_organization.clear_syspurpose_status if subject_organization.simple_content_access?(cached: false)
|
49
48
|
subject_organization.clear_manifest_expired_notifications
|
50
49
|
subject_organization.audit_manifest_action(_('Manifest imported'))
|
51
50
|
end
|
@@ -61,7 +61,6 @@ module Actions
|
|
61
61
|
|
62
62
|
def finalize
|
63
63
|
org = ::Organization.find(input[:organization_id])
|
64
|
-
subject_organization.clear_syspurpose_status if subject_organization.simple_content_access?(cached: false)
|
65
64
|
org.clear_manifest_expired_notifications
|
66
65
|
subject_organization.audit_manifest_action(_('Manifest refreshed'))
|
67
66
|
end
|
@@ -8,12 +8,13 @@ module Actions
|
|
8
8
|
sequence do
|
9
9
|
if root.content_id.nil?
|
10
10
|
content_create = plan_action(Candlepin::Product::ContentCreate,
|
11
|
-
owner:
|
12
|
-
name:
|
13
|
-
type:
|
14
|
-
arches:
|
15
|
-
label:
|
16
|
-
|
11
|
+
owner: root.product.organization.label,
|
12
|
+
name: root.name,
|
13
|
+
type: root.content_type,
|
14
|
+
arches: root.format_arches,
|
15
|
+
label: root.custom_content_label,
|
16
|
+
os_versions: root.os_versions&.join(','),
|
17
|
+
content_url: root.custom_content_path)
|
17
18
|
content_id = content_create.output[:response][:id]
|
18
19
|
plan_action(Candlepin::Product::ContentAdd, owner: root.product.organization.label,
|
19
20
|
product_id: root.product.cp_id,
|
@@ -10,6 +10,7 @@ module Actions
|
|
10
10
|
param :upload_actions
|
11
11
|
end
|
12
12
|
|
13
|
+
# rubocop:disable Metrics/MethodLength
|
13
14
|
def run
|
14
15
|
repo = ::Katello::Repository.find(input[:id])
|
15
16
|
if repo.puppet?
|
@@ -21,7 +22,15 @@ module Actions
|
|
21
22
|
elsif repo.file?
|
22
23
|
::Katello::FileUnit.import_for_repository(repo)
|
23
24
|
elsif repo.deb?
|
24
|
-
|
25
|
+
if input[:import_upload_task] && input[:import_upload_task][:content_unit_href]
|
26
|
+
unit_ids = [input[:import_upload_task][:content_unit_href]]
|
27
|
+
elsif input[:upload_actions]&.any? { |action| action.try(:[], "content_unit_href") }
|
28
|
+
uploaded_content_unit_hrefs = []
|
29
|
+
input[:upload_actions].each { |action| uploaded_content_unit_hrefs << action.try(:[], "content_unit_href") }
|
30
|
+
unit_ids = uploaded_content_unit_hrefs.compact
|
31
|
+
else
|
32
|
+
unit_ids = search_units(repo)
|
33
|
+
end
|
25
34
|
::Katello::Deb.import_all(unit_ids, repo)
|
26
35
|
elsif repo.yum?
|
27
36
|
if input[:import_upload_task] && input[:import_upload_task][:content_unit_href]
|
@@ -4,8 +4,10 @@ module Actions
|
|
4
4
|
module Repository
|
5
5
|
class ImportUpload < Actions::EntryAction
|
6
6
|
include Actions::Katello::PulpSelector
|
7
|
+
# rubocop:disable Metrics/MethodLength
|
7
8
|
def plan(repository, uploads, options = {})
|
8
9
|
action_subject(repository)
|
10
|
+
repository.clear_smart_proxy_sync_histories
|
9
11
|
repo_service = repository.backend_service(::SmartProxy.pulp_primary)
|
10
12
|
|
11
13
|
upload_ids = uploads.pluck('id')
|
@@ -23,10 +25,11 @@ module Actions
|
|
23
25
|
import_upload_args = {
|
24
26
|
pulp_id: repository.pulp_id,
|
25
27
|
unit_type_id: unit_type_id,
|
26
|
-
unit_key: unit_key,
|
28
|
+
unit_key: unit_key.with_indifferent_access,
|
27
29
|
upload_id: upload_id,
|
28
30
|
unit_metadata: unit_metadata
|
29
31
|
}
|
32
|
+
|
30
33
|
import_upload = plan_pulp_action([Actions::Pulp::Repository::ImportUpload,
|
31
34
|
Actions::Pulp3::Orchestration::Repository::ImportUpload],
|
32
35
|
repository, SmartProxy.pulp_primary, import_upload_args)
|
@@ -23,7 +23,7 @@ module Actions
|
|
23
23
|
remove_content_args = {
|
24
24
|
:contents => content_unit_ids,
|
25
25
|
:content_unit_type => content_unit_type}
|
26
|
-
|
26
|
+
repository.clear_smart_proxy_sync_histories
|
27
27
|
pulp_action = plan_pulp_action(
|
28
28
|
[Pulp::Orchestration::Repository::RemoveUnits,
|
29
29
|
Pulp3::Orchestration::Repository::RemoveUnits],
|
@@ -79,7 +79,9 @@ module Actions
|
|
79
79
|
end
|
80
80
|
|
81
81
|
def run
|
82
|
-
|
82
|
+
repo = ::Katello::Repository.find(input[:id])
|
83
|
+
repo.clear_smart_proxy_sync_histories if input[:contents_changed]
|
84
|
+
ForemanTasks.async_task(Repository::CapsuleSync, repo) if Setting[:foreman_proxy_content_auto_sync]
|
83
85
|
rescue ::Katello::Errors::CapsuleCannotBeReached # skip any capsules that cannot be connected to
|
84
86
|
end
|
85
87
|
|
@@ -11,6 +11,7 @@ module Actions
|
|
11
11
|
|
12
12
|
repo_params[:url] = nil if repo_params[:url] == ''
|
13
13
|
update_cv_cert_protected = repo_params.key?(:unprotected) && (repo_params[:unprotected] != repository.unprotected)
|
14
|
+
|
14
15
|
root.update!(repo_params)
|
15
16
|
|
16
17
|
if root.download_policy == ::Runcible::Models::YumImporter::DOWNLOAD_BACKGROUND
|
@@ -32,7 +33,9 @@ module Actions
|
|
32
33
|
:gpg_key_url => repository.yum_gpg_key_url,
|
33
34
|
:label => content.label,
|
34
35
|
:type => root.content_type,
|
35
|
-
:arches => root.format_arches
|
36
|
+
:arches => root.format_arches,
|
37
|
+
:os_versions => root.os_versions&.join(',')
|
38
|
+
)
|
36
39
|
|
37
40
|
content.update!(name: root.name,
|
38
41
|
content_url: root.custom_content_path,
|
@@ -57,6 +60,7 @@ module Actions
|
|
57
60
|
def run
|
58
61
|
repository = ::Katello::Repository.find(input[:repository_id])
|
59
62
|
ForemanTasks.async_task(Katello::Repository::MetadataGenerate, repository)
|
63
|
+
repository.clear_smart_proxy_sync_histories
|
60
64
|
end
|
61
65
|
|
62
66
|
private
|
@@ -9,6 +9,7 @@ module Actions
|
|
9
9
|
include Actions::Katello::PulpSelector
|
10
10
|
def plan(repository, files, content_type = nil)
|
11
11
|
action_subject(repository)
|
12
|
+
repository.clear_smart_proxy_sync_histories
|
12
13
|
tmp_files = prepare_tmp_files(files)
|
13
14
|
|
14
15
|
content_type ||= ::Katello::RepositoryTypeManager.find(repository.content_type).default_managed_content_type.label
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Actions
|
2
|
+
module Middleware
|
3
|
+
class RecordSmartProxySyncHistory < Dynflow::Middleware
|
4
|
+
def run(*args)
|
5
|
+
if (action.input[:repository_id] && (action.input[:smart_proxy_id] || action.input[:capsule_id]) && !self.action.output[:smart_proxy_history_id])
|
6
|
+
repo = ::Katello::Repository.find(action.input[:repository_id])
|
7
|
+
smart_proxy_id = action.input[:smart_proxy_id] || action.input[:capsule_id]
|
8
|
+
smart_proxy = ::SmartProxy.find(smart_proxy_id)
|
9
|
+
self.action.output[:smart_proxy_history_id] = repo.create_smart_proxy_sync_history(smart_proxy)
|
10
|
+
end
|
11
|
+
pass(*args)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -2,14 +2,16 @@ module Actions
|
|
2
2
|
module Pulp
|
3
3
|
module Consumer
|
4
4
|
class SyncCapsule < ::Actions::Pulp::AbstractAsyncTask
|
5
|
+
include ::Actions::Helpers::SmartProxySyncHistoryHelper
|
5
6
|
input_format do
|
6
7
|
param :capsule_id, Integer
|
7
8
|
param :repo_pulp_id, String
|
9
|
+
param :repository_id, Integer
|
8
10
|
param :sync_options
|
9
11
|
end
|
10
12
|
|
11
13
|
def plan(repository, smart_proxy, options)
|
12
|
-
plan_self(:capsule_id => smart_proxy.id, :repo_pulp_id => repository.pulp_id, :sync_options => options)
|
14
|
+
plan_self(:capsule_id => smart_proxy.id, :repo_pulp_id => repository.pulp_id, :repository_id => repository.id, :sync_options => options)
|
13
15
|
end
|
14
16
|
|
15
17
|
def humanized_name
|
@@ -17,7 +19,7 @@ module Actions
|
|
17
19
|
end
|
18
20
|
|
19
21
|
def invoke_external_task
|
20
|
-
pulp_resources.repository.sync(input[:repo_pulp_id], override_config: input[:sync_options])
|
22
|
+
output[:pulp_tasks] = pulp_resources.repository.sync(input[:repo_pulp_id], override_config: input[:sync_options])
|
21
23
|
end
|
22
24
|
|
23
25
|
def run_progress
|
@@ -20,7 +20,7 @@ module Actions
|
|
20
20
|
else
|
21
21
|
repo = ::Katello::ContentViewPuppetEnvironment.find_by(:id => input[:content_view_puppet_environment_id]).nonpersisted_repository
|
22
22
|
end
|
23
|
-
|
23
|
+
repo.clear_smart_proxy_sync_histories if smart_proxy(input[:smart_proxy_id]).pulp_primary?
|
24
24
|
repo.backend_service(smart_proxy(input[:smart_proxy_id])).distributor_publish(input[:options])
|
25
25
|
end
|
26
26
|
|
@@ -2,6 +2,7 @@ module Actions
|
|
2
2
|
module Pulp3
|
3
3
|
module CapsuleContent
|
4
4
|
class Sync < Pulp3::AbstractAsyncTask
|
5
|
+
include ::Actions::Helpers::SmartProxySyncHistoryHelper
|
5
6
|
def plan(repository, smart_proxy, options = {})
|
6
7
|
sequence do
|
7
8
|
plan_self(:repository_id => repository.id, :smart_proxy_id => smart_proxy.id, :options => options)
|
@@ -1,6 +1,8 @@
|
|
1
1
|
module Actions
|
2
2
|
module Pulp3
|
3
3
|
class ContentMigration < Pulp3::AbstractAsyncTask
|
4
|
+
include Helpers::Presenter
|
5
|
+
|
4
6
|
def plan(smart_proxy, options)
|
5
7
|
sequence do
|
6
8
|
action = plan_self(smart_proxy_id: smart_proxy.id)
|
@@ -13,6 +15,14 @@ module Actions
|
|
13
15
|
migration_service.create_and_run_migrations
|
14
16
|
end
|
15
17
|
|
18
|
+
def humanized_name
|
19
|
+
_("Content Migration")
|
20
|
+
end
|
21
|
+
|
22
|
+
def presenter
|
23
|
+
Actions::Pulp3::ContentMigrationPresenter.new(self)
|
24
|
+
end
|
25
|
+
|
16
26
|
def rescue_strategy
|
17
27
|
Dynflow::Action::Rescue::Skip
|
18
28
|
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'katello/content_migration_progress'
|
2
|
+
|
3
|
+
module Actions
|
4
|
+
module Pulp3
|
5
|
+
class ContentMigrationPresenter < Helpers::Presenter::Base
|
6
|
+
def initialize(migration_action)
|
7
|
+
@migration_action = migration_action
|
8
|
+
end
|
9
|
+
|
10
|
+
def humanized_output
|
11
|
+
if !@migration_action.done?
|
12
|
+
ContentMigrationTaskPresenter.new(@migration_action).humanized_output
|
13
|
+
else
|
14
|
+
task = ForemanTasks::Task.find_by(:external_id => @migration_action.execution_plan_id)
|
15
|
+
::Katello::ContentMigrationProgress.find_by(:task_id => task.id)&.progress_message
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
class ContentMigrationTaskPresenter
|
20
|
+
def initialize(action)
|
21
|
+
@action = action
|
22
|
+
end
|
23
|
+
|
24
|
+
def task_progress_reports
|
25
|
+
if @action.pulp_tasks.empty?
|
26
|
+
[]
|
27
|
+
else
|
28
|
+
@action.pulp_tasks[0].progress_reports
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def task_group_progress_reports
|
33
|
+
if @action.task_groups.empty?
|
34
|
+
[]
|
35
|
+
else
|
36
|
+
@action.task_groups[0].group_progress_reports
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def humanized_output
|
41
|
+
report = task_progress_reports.find { |current| current['state'] == 'running' && current['total'] != 0 }
|
42
|
+
report ||= task_group_progress_reports.find { |current| current['total'] != 0 && current['done'] != current['total'] }
|
43
|
+
|
44
|
+
if !report.blank? && report['total'] != 0
|
45
|
+
"#{report['message']} #{report['done']}/#{report['total']}"
|
46
|
+
elsif report
|
47
|
+
report['message']
|
48
|
+
elsif task_progress_reports.empty?
|
49
|
+
"Content migration starting. "
|
50
|
+
else
|
51
|
+
"Initial Migration steps complete."
|
52
|
+
end
|
53
|
+
rescue
|
54
|
+
""
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|