katello 4.12.1 → 4.13.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/assets/javascripts/katello/locale/bn/katello.js +3365 -3350
- data/app/assets/javascripts/katello/locale/bn_IN/katello.js +3136 -3121
- data/app/assets/javascripts/katello/locale/ca/katello.js +3588 -3576
- data/app/assets/javascripts/katello/locale/cs/katello.js +3499 -3487
- data/app/assets/javascripts/katello/locale/cs_CZ/katello.js +4186 -4186
- data/app/assets/javascripts/katello/locale/de/katello.js +5553 -5562
- data/app/assets/javascripts/katello/locale/de_AT/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/de_DE/katello.js +3066 -3051
- data/app/assets/javascripts/katello/locale/el/katello.js +3376 -3370
- data/app/assets/javascripts/katello/locale/en/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/en_GB/katello.js +3076 -3073
- data/app/assets/javascripts/katello/locale/en_US/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/es/katello.js +5366 -5372
- data/app/assets/javascripts/katello/locale/et_EE/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/fr/katello.js +5975 -5984
- data/app/assets/javascripts/katello/locale/gl/katello.js +3125 -3113
- data/app/assets/javascripts/katello/locale/gu/katello.js +3119 -3104
- data/app/assets/javascripts/katello/locale/he_IL/katello.js +3020 -3005
- data/app/assets/javascripts/katello/locale/hi/katello.js +3137 -3122
- data/app/assets/javascripts/katello/locale/id/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/it/katello.js +4469 -4466
- data/app/assets/javascripts/katello/locale/ja/katello.js +5969 -5978
- data/app/assets/javascripts/katello/locale/ka/katello.js +5649 -5652
- data/app/assets/javascripts/katello/locale/kn/katello.js +3136 -3121
- data/app/assets/javascripts/katello/locale/ko/katello.js +4717 -4720
- data/app/assets/javascripts/katello/locale/locale/katello.js +1050 -1084
- data/app/assets/javascripts/katello/locale/ml_IN/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/mr/katello.js +3136 -3121
- data/app/assets/javascripts/katello/locale/nl_NL/katello.js +3116 -3101
- data/app/assets/javascripts/katello/locale/or/katello.js +3137 -3122
- data/app/assets/javascripts/katello/locale/pa/katello.js +3136 -3121
- data/app/assets/javascripts/katello/locale/pl/katello.js +3210 -3195
- data/app/assets/javascripts/katello/locale/pl_PL/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/pt/katello.js +3009 -2994
- data/app/assets/javascripts/katello/locale/pt_BR/katello.js +5362 -5368
- data/app/assets/javascripts/katello/locale/ro/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/ro_RO/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/ru/katello.js +4638 -4641
- data/app/assets/javascripts/katello/locale/sl/katello.js +3051 -3036
- data/app/assets/javascripts/katello/locale/sv_SE/katello.js +3156 -3144
- data/app/assets/javascripts/katello/locale/ta/katello.js +3365 -3350
- data/app/assets/javascripts/katello/locale/ta_IN/katello.js +3121 -3106
- data/app/assets/javascripts/katello/locale/te/katello.js +3136 -3121
- data/app/assets/javascripts/katello/locale/tr/katello.js +3025 -3010
- data/app/assets/javascripts/katello/locale/vi/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/vi_VN/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/zh/katello.js +3008 -2993
- data/app/assets/javascripts/katello/locale/zh_CN/katello.js +5968 -5977
- data/app/assets/javascripts/katello/locale/zh_TW/katello.js +4694 -4697
- data/app/controllers/katello/api/registry/registry_proxies_controller.rb +370 -132
- data/app/controllers/katello/api/rhsm/candlepin_dynflow_proxy_controller.rb +12 -20
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +10 -4
- data/app/controllers/katello/api/v2/capsule_content_controller.rb +24 -0
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +9 -2
- data/app/controllers/katello/api/v2/debs_controller.rb +1 -1
- data/app/controllers/katello/api/v2/errata_controller.rb +1 -1
- data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +12 -4
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +3 -3
- data/app/controllers/katello/api/v2/organizations_controller.rb +0 -11
- data/app/controllers/katello/api/v2/packages_controller.rb +1 -1
- data/app/controllers/katello/api/v2/repositories_controller.rb +19 -13
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +2 -1
- data/app/controllers/katello/api/v2/simple_content_access_controller.rb +9 -22
- data/app/controllers/katello/concerns/api/v2/authorization.rb +1 -1
- data/app/helpers/katello/subscription_mailer_helper.rb +1 -1
- data/app/jobs/create_manifest_expire_soon_warning_notifications.rb +11 -0
- data/app/lib/actions/candlepin/owner/regenerate_upstream_identity_cert.rb +21 -0
- data/app/lib/actions/katello/capsule_content/sync.rb +1 -1
- data/app/lib/actions/katello/capsule_content/sync_capsule.rb +7 -2
- data/app/lib/actions/katello/capsule_content/verify_checksum.rb +75 -0
- data/app/lib/actions/katello/content_view/promote.rb +1 -1
- data/app/lib/actions/katello/content_view/publish.rb +1 -1
- data/app/lib/actions/katello/content_view_version/verify_checksum.rb +29 -0
- data/app/lib/actions/katello/host/hypervisors_update.rb +1 -0
- data/app/lib/actions/katello/host/update_content_view.rb +2 -2
- data/app/lib/actions/katello/organization/manifest_delete.rb +6 -1
- data/app/lib/actions/katello/organization/manifest_import.rb +5 -0
- data/app/lib/actions/katello/organization/manifest_refresh.rb +3 -0
- data/app/lib/actions/katello/repository/create.rb +17 -11
- data/app/lib/actions/katello/repository/create_root.rb +4 -2
- data/app/lib/actions/katello/repository/metadata_generate.rb +7 -1
- data/app/lib/actions/katello/repository/remove_content.rb +1 -0
- data/app/lib/actions/katello/repository/sync.rb +2 -1
- data/app/lib/actions/katello/repository/upload_files.rb +1 -0
- data/app/lib/actions/katello/upstream_subscriptions/bind_entitlement.rb +1 -1
- data/app/lib/actions/pulp3/capsule_content/verify_checksum.rb +27 -0
- data/app/lib/actions/pulp3/orchestration/content_view_version/export_repository.rb +7 -9
- data/app/lib/actions/pulp3/orchestration/content_view_version/syncable_export.rb +5 -4
- data/app/lib/actions/pulp3/orchestration/orphan_cleanup/remove_orphans.rb +1 -0
- data/app/lib/actions/pulp3/orphan_cleanup/purge_completed_tasks.rb +15 -0
- data/app/lib/katello/concerns/base_template_scope_extensions.rb +7 -2
- data/app/lib/katello/http_resource.rb +6 -1
- data/app/lib/katello/resources/candlepin/consumer.rb +1 -1
- data/app/lib/katello/resources/candlepin/upstream_consumer.rb +18 -6
- data/app/lib/katello/resources/candlepin/upstream_job.rb +1 -1
- data/app/lib/katello/resources/registry.rb +25 -0
- data/app/mailers/katello/subscription_mailer.rb +3 -6
- data/app/models/katello/concerns/organization_extensions.rb +42 -3
- data/app/models/katello/content_view.rb +30 -0
- data/app/models/katello/content_view_environment_content_facet.rb +4 -2
- data/app/models/katello/glue/provider.rb +19 -12
- data/app/models/katello/glue/pulp/repos.rb +11 -3
- data/app/models/katello/host/content_facet.rb +1 -1
- data/app/models/katello/host/subscription_facet.rb +1 -1
- data/app/models/katello/ping.rb +1 -1
- data/app/models/katello/repository.rb +32 -1
- data/app/models/katello/root_repository.rb +4 -6
- data/app/models/katello/trace_status.rb +1 -1
- data/app/services/katello/content_unit_indexer.rb +9 -0
- data/app/services/katello/pulp3/alternate_content_source.rb +4 -6
- data/app/services/katello/pulp3/api/core.rb +21 -0
- data/app/services/katello/pulp3/api/docker.rb +4 -0
- data/app/services/katello/pulp3/api/yum.rb +11 -0
- data/app/services/katello/pulp3/docker_manifest.rb +5 -1
- data/app/services/katello/pulp3/repository/generic.rb +1 -1
- data/app/services/katello/pulp3/repository/yum.rb +1 -6
- data/app/services/katello/pulp3/repository.rb +26 -6
- data/app/services/katello/pulp3/repository_mirror.rb +13 -12
- data/app/services/katello/pulp3/service_common.rb +2 -10
- data/app/services/katello/pulp3/smart_proxy_repository.rb +0 -2
- data/app/services/katello/ui_notifications/subscriptions/manifest_expire_soon_warning.rb +75 -0
- data/app/views/foreman/job_templates/update_package_-_katello_ansible_default.erb +5 -1
- data/app/views/foreman/job_templates/update_packages_by_search_query_-_katello_ansible_default.erb +2 -2
- data/app/views/foreman/job_templates/upload_profile.erb +16 -0
- data/app/views/foreman/smart_proxies/_content_tab.html.erb +3 -1
- data/app/views/katello/api/v2/content_view_filter_rules/show.json.rabl +9 -0
- data/app/views/katello/api/v2/docker_manifests/show.json.rabl +1 -0
- data/app/views/katello/api/v2/organizations/show.json.rabl +9 -1
- data/app/views/overrides/activation_keys/_host_environment_select.html.erb +1 -1
- data/app/views/overrides/activation_keys/_host_media_type_select.html.erb +15 -5
- data/config/routes/api/registry.rb +4 -8
- data/config/routes/api/v2.rb +2 -0
- data/db/migrate/20240423112842_add_fields_to_katello_docker_manifest.rb +8 -0
- data/db/migrate/20240502192021_change_katello_repository_rpms_id_seq_to_big_int.rb +9 -0
- data/db/migrate/20240520142245_add_container_push_props_to_repo.rb +7 -0
- data/db/migrate/20240531193030_remove_sha1_repository_checksum_type.rb +10 -0
- data/db/seeds.d/109-katello-notification-blueprints.rb +6 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-repository-sets.controller.js +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/views/new-content-credential.html +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-repository-sets.controller.js +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +0 -15
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/checksum.service.js +6 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +8 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +12 -13
- data/lib/katello/permission_creator.rb +3 -3
- data/lib/katello/permissions/registry_permissions.rb +4 -7
- data/lib/katello/plugin.rb +21 -8
- data/lib/katello/repository_types/ostree.rb +7 -0
- data/lib/katello/scheduled_jobs.rb +7 -1
- data/lib/katello/tasks/clean_backend_objects.rake +1 -1
- data/lib/katello/tasks/repository.rake +22 -0
- data/lib/katello/version.rb +1 -1
- data/locale/action_names.rb +4 -3
- data/locale/bn/katello.po +166 -151
- data/locale/bn_IN/katello.po +166 -151
- data/locale/ca/katello.po +166 -151
- data/locale/cs/katello.po +166 -151
- data/locale/cs_CZ/LC_MESSAGES/katello.mo +0 -0
- data/locale/cs_CZ/katello.po +172 -157
- data/locale/de/LC_MESSAGES/katello.mo +0 -0
- data/locale/de/katello.po +178 -163
- data/locale/de_AT/katello.po +166 -151
- data/locale/de_DE/katello.po +166 -151
- data/locale/el/katello.po +166 -151
- data/locale/en/katello.po +166 -151
- data/locale/en_GB/katello.po +166 -151
- data/locale/en_US/katello.po +166 -151
- data/locale/es/LC_MESSAGES/katello.mo +0 -0
- data/locale/es/katello.po +178 -163
- data/locale/et_EE/katello.po +166 -151
- data/locale/fr/LC_MESSAGES/katello.mo +0 -0
- data/locale/fr/katello.po +179 -164
- data/locale/gl/katello.po +166 -151
- data/locale/gu/katello.po +166 -151
- data/locale/he_IL/katello.po +166 -151
- data/locale/hi/katello.po +166 -151
- data/locale/id/katello.po +166 -151
- data/locale/it/LC_MESSAGES/katello.mo +0 -0
- data/locale/it/katello.po +169 -154
- data/locale/ja/LC_MESSAGES/katello.mo +0 -0
- data/locale/ja/katello.po +179 -164
- data/locale/ka/LC_MESSAGES/katello.mo +0 -0
- data/locale/ka/katello.po +177 -162
- data/locale/katello.pot +1119 -1062
- data/locale/kn/katello.po +166 -151
- data/locale/ko/LC_MESSAGES/katello.mo +0 -0
- data/locale/ko/katello.po +174 -159
- data/locale/ml_IN/katello.po +166 -151
- data/locale/mr/katello.po +166 -151
- data/locale/nl_NL/katello.po +166 -151
- data/locale/or/katello.po +166 -151
- data/locale/pa/katello.po +166 -151
- data/locale/pl/katello.po +166 -151
- data/locale/pl_PL/katello.po +166 -151
- data/locale/pt/katello.po +166 -151
- data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
- data/locale/pt_BR/katello.po +178 -163
- data/locale/ro/katello.po +166 -151
- data/locale/ro_RO/katello.po +166 -151
- data/locale/ru/LC_MESSAGES/katello.mo +0 -0
- data/locale/ru/katello.po +171 -156
- data/locale/sl/katello.po +166 -151
- data/locale/sv_SE/katello.po +166 -151
- data/locale/ta/katello.po +166 -151
- data/locale/ta_IN/katello.po +166 -151
- data/locale/te/katello.po +166 -151
- data/locale/tr/katello.po +166 -151
- data/locale/vi/katello.po +166 -151
- data/locale/vi_VN/katello.po +166 -151
- data/locale/zh/katello.po +166 -151
- data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh_CN/katello.po +179 -164
- data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh_TW/katello.po +171 -156
- data/package.json +0 -1
- data/webpack/ForemanColumnExtensions/index.js +129 -0
- data/webpack/components/Content/ContentTable.js +0 -1
- data/webpack/components/Content/__tests__/__snapshots__/ContentTable.test.js.snap +0 -1
- data/webpack/components/Table/TableWrapper.js +14 -0
- data/webpack/components/extensions/HostDetails/ActionsBar/index.js +1 -1
- data/webpack/components/extensions/Hosts/ActionsBar/index.js +20 -1
- data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCVModal/BulkChangeHostCVModal.js +220 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCVModal/actions.js +23 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCVModal/index.js +25 -0
- data/webpack/components/extensions/Hosts/BulkActions/__tests__/bulkChangeHostCVModal.test.js +133 -0
- data/webpack/global_index.js +9 -0
- data/webpack/scenes/Hosts/ChangeContentSource/actions.js +3 -1
- data/webpack/scenes/Hosts/ChangeContentSource/components/ContentSourceForm.js +62 -24
- data/webpack/scenes/Hosts/ChangeContentSource/index.js +24 -16
- data/webpack/scenes/ModuleStreams/ModuleStreamsPage.js +33 -39
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamPage.test.js +4 -2
- data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamsTable.test.js.snap +0 -1
- data/webpack/scenes/RedHatRepositories/__tests__/__snapshots__/RedHatRepositoriesPage.test.js.snap +1 -0
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +66 -5
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +16 -13
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +14 -8
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +1 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +1 -1
- metadata +60 -42
- data/app/lib/actions/katello/host/upload_package_profile.rb +0 -45
- data/app/lib/actions/katello/host/upload_profiles.rb +0 -47
- data/webpack/utils/__tests__/useParamsWithHash.test.js +0 -22
- data/webpack/utils/paramsFromHash.js +0 -16
- data/webpack/utils/useUrlParams.js +0 -14
@@ -112,6 +112,30 @@ module Katello
|
|
112
112
|
respond_for_async :resource => task
|
113
113
|
end
|
114
114
|
|
115
|
+
api :POST, '/capsules/:id/content/verify_checksum', N_('Check for missing or corrupted artifacts, and attempt to redownload them.')
|
116
|
+
param :id, :number, :required => true, :desc => N_('Id of the smart proxy')
|
117
|
+
param :environment_id, Integer, :desc => N_('Id of the environment to limit verifying checksum on')
|
118
|
+
param :content_view_id, Integer, :desc => N_('Id of the content view to limit verifying checksum on')
|
119
|
+
param :repository_id, Integer, :desc => N_('Id of the repository to limit verifying checksum on')
|
120
|
+
def verify_checksum
|
121
|
+
find_capsule(false)
|
122
|
+
find_environment if params[:environment_id]
|
123
|
+
find_content_view if params[:content_view_id]
|
124
|
+
find_repository if params[:repository_id]
|
125
|
+
|
126
|
+
repair_options = {
|
127
|
+
:environment_id => @environment.try(:id),
|
128
|
+
:content_view_id => @content_view.try(:id),
|
129
|
+
:repository_id => @repository.try(:id)
|
130
|
+
}
|
131
|
+
repair_options[:environment_ids] = @capsule.lifecycle_environments&.pluck(:id) unless (@environment || @content_view || @repository)
|
132
|
+
|
133
|
+
task = async_task(::Actions::Katello::CapsuleContent::VerifyChecksum,
|
134
|
+
@capsule,
|
135
|
+
repair_options)
|
136
|
+
respond_for_async :resource => task
|
137
|
+
end
|
138
|
+
|
115
139
|
protected
|
116
140
|
|
117
141
|
def respond_for_lifecycle_environments_index(environments)
|
@@ -3,8 +3,8 @@ module Katello
|
|
3
3
|
include ::Api::V2::BulkHostsExtension
|
4
4
|
include Katello::Concerns::FilteredAutoCompleteSearch
|
5
5
|
|
6
|
-
before_action :find_authorized_katello_resource, :only => [:show, :update, :promote, :destroy, :republish_repositories]
|
7
|
-
before_action :find_content_view_from_version, :only => [:show, :update, :promote, :destroy, :republish_repositories]
|
6
|
+
before_action :find_authorized_katello_resource, :only => [:show, :update, :promote, :destroy, :republish_repositories, :verify_checksum]
|
7
|
+
before_action :find_content_view_from_version, :only => [:show, :update, :promote, :destroy, :republish_repositories, :verify_checksum]
|
8
8
|
before_action :find_optional_readable_content_view, :only => [:index]
|
9
9
|
|
10
10
|
before_action :find_environment, :only => [:index]
|
@@ -141,6 +141,13 @@ Alternatively, use the 'force' parameter to regenerate metadata locally. New ver
|
|
141
141
|
respond_for_async :resource => task
|
142
142
|
end
|
143
143
|
|
144
|
+
api :POST, "/content_view_versions/:id/verify_checksum", N_("Verify checksum of repository contents in the content view version")
|
145
|
+
param :id, :number, :required => true, :desc => N_("Content view version identifier")
|
146
|
+
def verify_checksum
|
147
|
+
task = async_task(::Actions::Katello::ContentViewVersion::VerifyChecksum, @content_view_version)
|
148
|
+
respond_for_async :resource => task
|
149
|
+
end
|
150
|
+
|
144
151
|
private
|
145
152
|
|
146
153
|
def calculate_hosts_for_incremental(bulk_params, use_composites)
|
@@ -37,7 +37,7 @@ module Katello
|
|
37
37
|
api :GET, "/repositories/:repository_id/debs", N_("List deb packages")
|
38
38
|
param :organization_id, :number, :desc => N_("Organization identifier")
|
39
39
|
param :content_view_version_id, :number, :desc => N_("Content View Version identifier")
|
40
|
-
param :content_view_filter_id, :number, :desc => N_("Content View Filter identifier")
|
40
|
+
param :content_view_filter_id, :number, :desc => N_("Content View Filter identifier. Use to filter by ID")
|
41
41
|
param :repository_id, :number, :desc => N_("Repository identifier")
|
42
42
|
param :environment_id, :number, :desc => N_("Environment identifier")
|
43
43
|
param :ids, Array, :desc => N_("Deb package identifiers to filter content by")
|
@@ -9,7 +9,7 @@ module Katello
|
|
9
9
|
api :GET, "/errata", N_("List errata")
|
10
10
|
param :organization_id, :number, :desc => N_("Organization identifier")
|
11
11
|
param :content_view_version_id, :number, :desc => N_("Content View Version identifier")
|
12
|
-
param :content_view_filter_id, :number, :desc => N_("Content View Filter identifier")
|
12
|
+
param :content_view_filter_id, :number, :desc => N_("Content View Filter identifier. Use to filter by ID")
|
13
13
|
param :repository_id, :number, :desc => N_("Repository identifier")
|
14
14
|
param :environment_id, :number, :desc => N_("Environment identifier")
|
15
15
|
param :cve, String, :desc => N_("CVE identifier")
|
@@ -33,9 +33,14 @@ module Katello
|
|
33
33
|
api_base_url "/api"
|
34
34
|
end
|
35
35
|
|
36
|
-
|
36
|
+
def deprecate_entitlement_mode_endpoint
|
37
|
+
::Foreman::Deprecation.api_deprecation_warning(N_("This endpoint is deprecated and will be removed in an upcoming release. Simple Content Access is the only supported content access mode."))
|
38
|
+
end
|
39
|
+
|
40
|
+
api :GET, "/hosts/:host_id/subscriptions", N_("List a host's subscriptions"), deprecated: true
|
37
41
|
param :host_id, Integer, :desc => N_("Id of the host"), :required => true
|
38
42
|
def index
|
43
|
+
deprecate_entitlement_mode_endpoint
|
39
44
|
@collection = index_response
|
40
45
|
respond_for_index :collection => @collection
|
41
46
|
end
|
@@ -47,9 +52,10 @@ module Katello
|
|
47
52
|
full_result_response(presenter.subscriptions)
|
48
53
|
end
|
49
54
|
|
50
|
-
api :PUT, "/hosts/:host_id/subscriptions/auto_attach", N_("Trigger an auto-attach of subscriptions")
|
55
|
+
api :PUT, "/hosts/:host_id/subscriptions/auto_attach", N_("Trigger an auto-attach of subscriptions"), deprecated: true
|
51
56
|
param :host_id, Integer, :desc => N_("Id of the host"), :required => true
|
52
57
|
def auto_attach
|
58
|
+
deprecate_entitlement_mode_endpoint
|
53
59
|
if @host.organization.simple_content_access?
|
54
60
|
fail ::Katello::HttpErrors::BadRequest, _("This host's organization is in Simple Content Access mode. Auto-attach is disabled")
|
55
61
|
end
|
@@ -111,13 +117,14 @@ module Katello
|
|
111
117
|
rhsm_params
|
112
118
|
end
|
113
119
|
|
114
|
-
api :PUT, "/hosts/:host_id/subscriptions/remove_subscriptions"
|
120
|
+
api :PUT, "/hosts/:host_id/subscriptions/remove_subscriptions", N_("Remove subscriptions from a host"), deprecated: true
|
115
121
|
param :host_id, Integer, :desc => N_("Id of the host"), :required => true
|
116
122
|
param :subscriptions, Array, :desc => N_("Array of subscriptions to remove") do
|
117
123
|
param :id, String, :desc => N_("Subscription Pool id"), :required => true
|
118
124
|
param :quantity, Integer, :desc => N_("If specified, remove the first instance of a subscription with matching id and quantity"), :required => false
|
119
125
|
end
|
120
126
|
def remove_subscriptions
|
127
|
+
deprecate_entitlement_mode_endpoint
|
121
128
|
#combine the quantities for duplicate pools into PoolWithQuantities objects
|
122
129
|
pool_id_quantities = params.require(:subscriptions).inject({}) do |new_hash, subscription|
|
123
130
|
new_hash[subscription['id']] ||= PoolWithQuantities.new(Pool.with_identifier(subscription['id']))
|
@@ -129,13 +136,14 @@ module Katello
|
|
129
136
|
respond_for_index(:collection => index_response(reload_host: true), :template => "index")
|
130
137
|
end
|
131
138
|
|
132
|
-
api :PUT, "/hosts/:host_id/subscriptions/add_subscriptions", N_("Add a subscription to a host")
|
139
|
+
api :PUT, "/hosts/:host_id/subscriptions/add_subscriptions", N_("Add a subscription to a host"), deprecated: true
|
133
140
|
param :host_id, Integer, :desc => N_("Id of the host"), :required => true
|
134
141
|
param :subscriptions, Array, :desc => N_("Array of subscriptions to add"), :required => true do
|
135
142
|
param :id, String, :desc => N_("Subscription Pool id"), :required => true
|
136
143
|
param :quantity, :number, :desc => N_("Quantity of this subscriptions to add"), :required => true
|
137
144
|
end
|
138
145
|
def add_subscriptions
|
146
|
+
deprecate_entitlement_mode_endpoint
|
139
147
|
if @host.organization.simple_content_access?
|
140
148
|
fail ::Katello::HttpErrors::BadRequest, _("This host's organization is in Simple Content Access mode. Attaching subscriptions is disabled.")
|
141
149
|
end
|
@@ -106,7 +106,7 @@ module Katello
|
|
106
106
|
respond_for_async :resource => task
|
107
107
|
end
|
108
108
|
|
109
|
-
api :PUT, "/hosts/bulk/remove_subscriptions", N_("Remove subscriptions from one or more hosts")
|
109
|
+
api :PUT, "/hosts/bulk/remove_subscriptions", N_("Remove subscriptions from one or more hosts"), deprecated: true
|
110
110
|
param_group :bulk_params
|
111
111
|
param :subscriptions, Array, :desc => N_("Array of subscriptions to remove") do
|
112
112
|
param :id, String, :desc => N_("Subscription Pool id"), :required => true
|
@@ -123,7 +123,7 @@ module Katello
|
|
123
123
|
respond_for_async :resource => task
|
124
124
|
end
|
125
125
|
|
126
|
-
api :PUT, "/hosts/bulk/add_subscriptions", N_("Add subscriptions to one or more hosts")
|
126
|
+
api :PUT, "/hosts/bulk/add_subscriptions", N_("Add subscriptions to one or more hosts"), deprecated: true
|
127
127
|
param_group :bulk_params
|
128
128
|
param :subscriptions, Array, :desc => N_("Array of subscriptions to add"), :required => true do
|
129
129
|
param :id, String, :desc => N_("Subscription Pool id"), :required => true
|
@@ -142,7 +142,7 @@ module Katello
|
|
142
142
|
respond_for_async :resource => task
|
143
143
|
end
|
144
144
|
|
145
|
-
api :PUT, "/hosts/bulk/auto_attach", N_("Trigger an auto-attach of subscriptions on one or more hosts")
|
145
|
+
api :PUT, "/hosts/bulk/auto_attach", N_("Trigger an auto-attach of subscriptions on one or more hosts"), deprecated: true
|
146
146
|
param_group :bulk_params
|
147
147
|
def auto_attach
|
148
148
|
task = async_task(::Actions::BulkAction, ::Actions::Katello::Host::AutoAttachSubscriptions, @hosts)
|
@@ -56,22 +56,11 @@ module Katello
|
|
56
56
|
api :PUT, '/organizations/:id', N_('Update organization')
|
57
57
|
param :id, :number, :desc => N_("organization ID"), :required => true
|
58
58
|
param :redhat_repository_url, String, :desc => N_("Red Hat CDN URL"), deprecated: true
|
59
|
-
param :simple_content_access, :bool, :desc => N_('Whether Simple Content Access should be enabled for the organization.'), :required => false, :default => true, deprecated: true
|
60
59
|
param_group :resource
|
61
60
|
def update
|
62
61
|
if params[:redhat_repository_url]
|
63
62
|
sync_task(::Actions::Katello::CdnConfiguration::Update, @organization.cdn_configuration, url: params[:redhat_repository_url])
|
64
63
|
end
|
65
|
-
unless params[:simple_content_access].nil?
|
66
|
-
sca_param = ::Foreman::Cast.to_bool(params[:simple_content_access])
|
67
|
-
if sca_param && !@taxonomy.simple_content_access?(cached: false)
|
68
|
-
# user has requested SCA enable
|
69
|
-
sync_task(::Actions::Katello::Organization::SimpleContentAccess::Enable, params[:id])
|
70
|
-
elsif !sca_param && @taxonomy.simple_content_access?(cached: false)
|
71
|
-
# user has requested SCA disable
|
72
|
-
sync_task(::Actions::Katello::Organization::SimpleContentAccess::Disable, params[:id])
|
73
|
-
end
|
74
|
-
end
|
75
64
|
super
|
76
65
|
end
|
77
66
|
|
@@ -32,7 +32,7 @@ module Katello
|
|
32
32
|
api :GET, "/repositories/:repository_id/:resource_id", N_("List :resource_id")
|
33
33
|
param :organization_id, :number, :desc => N_("Organization identifier")
|
34
34
|
param :content_view_version_id, :number, :desc => N_("Content View Version identifier")
|
35
|
-
param :content_view_filter_id, :number, :desc => N_("Content View Filter identifier")
|
35
|
+
param :content_view_filter_id, :number, :desc => N_("Content View Filter identifier. Use to filter by ID")
|
36
36
|
param :repository_id, :number, :desc => N_("Repository identifier")
|
37
37
|
param :environment_id, :number, :desc => N_("Environment identifier")
|
38
38
|
param :ids, Array, :desc => N_("Package identifiers to filter content by")
|
@@ -48,7 +48,7 @@ Pass [] to make repo available for clients regardless of OS version. Maximum len
|
|
48
48
|
param :ssl_client_cert_id, :number, :desc => N_("Identifier of the content credential containing the SSL Client Cert"), :allow_nil => true
|
49
49
|
param :ssl_client_key_id, :number, :desc => N_("Identifier of the content credential containing the SSL Client Key"), :allow_nil => true
|
50
50
|
param :unprotected, :bool, :desc => N_("true if this repository can be published via HTTP")
|
51
|
-
param :checksum_type, String, :desc => N_("Checksum
|
51
|
+
param :checksum_type, String, :desc => N_("Checksum used for published repository contents. Supported types: %s") % Katello::RootRepository::CHECKSUM_TYPES.join(', ')
|
52
52
|
param :docker_upstream_name, String, :desc => N_("Name of the upstream docker repository")
|
53
53
|
param :include_tags, Array, :desc => N_("Comma-separated list of tags to sync for a container image repository")
|
54
54
|
param :exclude_tags, Array, :desc => N_("Comma-separated list of tags to exclude when syncing a container image repository. Default: any tag ending in \"-source\"")
|
@@ -58,7 +58,7 @@ Pass [] to make repo available for clients regardless of OS version. Maximum len
|
|
58
58
|
param :verify_ssl_on_sync, :bool, :desc => N_("if true, Katello will verify the upstream url's SSL certifcates are signed by a trusted CA")
|
59
59
|
param :upstream_username, String, :desc => N_("Username of the upstream repository user used for authentication")
|
60
60
|
param :upstream_password, String, :desc => N_("Password of the upstream repository user used for authentication")
|
61
|
-
param :upstream_authentication_token, String, :desc => N_("
|
61
|
+
param :upstream_authentication_token, String, :desc => N_("Upstream authentication token string for yum repositories.")
|
62
62
|
param :deb_releases, String, :desc => N_("whitespace-separated list of releases to be synced from deb-archive")
|
63
63
|
param :deb_components, String, :desc => N_("whitespace-separated list of repo components to be synced from deb-archive")
|
64
64
|
param :deb_architectures, String, :desc => N_("whitespace-separated list of architectures to be synced from deb-archive")
|
@@ -576,13 +576,15 @@ Alternatively, use the 'force' parameter to regenerate metadata locally. On the
|
|
576
576
|
end
|
577
577
|
|
578
578
|
# rubocop:disable Metrics/CyclomaticComplexity
|
579
|
+
# rubocop:disable Metrics/PerceivedComplexity
|
579
580
|
def repository_params
|
580
581
|
keys = [:download_policy, :mirroring_policy, :sync_policy, :arch, :verify_ssl_on_sync, :upstream_password,
|
581
|
-
:upstream_username, :download_concurrency, :
|
582
|
+
:upstream_username, :download_concurrency, :metadata_expire,
|
582
583
|
{:os_versions => []}, :deb_releases, :deb_components, :deb_architectures, :description,
|
583
584
|
:http_proxy_policy, :http_proxy_id, :retain_package_versions_count, {:ignorable_content => []}
|
584
585
|
]
|
585
586
|
keys += [{:include_tags => []}, {:exclude_tags => []}, :docker_upstream_name] if params[:action] == 'create' || @repository&.docker?
|
587
|
+
keys += [:upstream_authentication_token] if params[:action] == 'create' || @repository&.yum?
|
586
588
|
keys += [:ansible_collection_requirements, :ansible_collection_auth_url, :ansible_collection_auth_token] if params[:action] == 'create' || @repository&.ansible_collection?
|
587
589
|
keys += [:label, :content_type] if params[:action] == "create"
|
588
590
|
|
@@ -614,27 +616,31 @@ Alternatively, use the 'force' parameter to regenerate metadata locally. On the
|
|
614
616
|
credential_value
|
615
617
|
end
|
616
618
|
|
617
|
-
# rubocop:disable Metrics/
|
619
|
+
# rubocop:disable Metrics/MethodLength
|
618
620
|
def construct_repo_from_params(repo_params) # rubocop:disable Metrics/AbcSize
|
619
621
|
root = @product.add_repo(repo_params.slice(:label, :name, :description, :url, :content_type, :arch, :unprotected,
|
620
622
|
:gpg_key, :ssl_ca_cert, :ssl_client_cert, :ssl_client_key,
|
621
623
|
:checksum_type, :download_policy, :http_proxy_policy,
|
622
624
|
:metadata_expire).to_h.with_indifferent_access)
|
623
|
-
root.docker_upstream_name = repo_params[:docker_upstream_name] if repo_params[:docker_upstream_name]
|
624
|
-
if root.docker?
|
625
|
-
root.include_tags = repo_params.fetch(:include_tags, [])
|
626
|
-
end
|
627
|
-
root.exclude_tags = repo_params.fetch(:exclude_tags, ['*-source']) if root.docker?
|
628
625
|
root.verify_ssl_on_sync = ::Foreman::Cast.to_bool(repo_params[:verify_ssl_on_sync]) if repo_params.key?(:verify_ssl_on_sync)
|
629
626
|
root.mirroring_policy = repo_params[:mirroring_policy] || Katello::RootRepository::MIRRORING_POLICY_CONTENT
|
630
627
|
root.upstream_username = repo_params[:upstream_username] if repo_params.key?(:upstream_username)
|
631
628
|
root.upstream_password = repo_params[:upstream_password] if repo_params.key?(:upstream_password)
|
632
|
-
root.upstream_authentication_token = repo_params[:upstream_authentication_token] if repo_params.key?(:upstream_authentication_token)
|
633
|
-
root.ignorable_content = repo_params[:ignorable_content] if root.yum? && repo_params.key?(:ignorable_content)
|
634
629
|
root.http_proxy_policy = repo_params[:http_proxy_policy] if repo_params.key?(:http_proxy_policy)
|
635
630
|
root.http_proxy_id = repo_params[:http_proxy_id] if repo_params.key?(:http_proxy_id)
|
636
|
-
|
637
|
-
|
631
|
+
|
632
|
+
if root.yum?
|
633
|
+
root.upstream_authentication_token = repo_params[:upstream_authentication_token] if repo_params.key?(:upstream_authentication_token)
|
634
|
+
root.retain_package_versions_count = repo_params[:retain_package_versions_count] if repo_params.key?(:retain_package_versions_count)
|
635
|
+
root.ignorable_content = repo_params[:ignorable_content] if repo_params.key?(:ignorable_content)
|
636
|
+
root.os_versions = repo_params.fetch(:os_versions, [])
|
637
|
+
end
|
638
|
+
|
639
|
+
if root.docker?
|
640
|
+
root.docker_upstream_name = repo_params[:docker_upstream_name] if repo_params[:docker_upstream_name]
|
641
|
+
root.include_tags = repo_params.fetch(:include_tags, [])
|
642
|
+
root.exclude_tags = repo_params.fetch(:exclude_tags, ['*-source'])
|
643
|
+
end
|
638
644
|
|
639
645
|
if root.generic?
|
640
646
|
generic_remote_options = generic_remote_options_hash(repo_params)
|
@@ -29,7 +29,7 @@ module Katello
|
|
29
29
|
param :with_custom, :bool, :required => false, :desc => N_("If true, return custom repository sets along with redhat repos. Will be ignored if repository_type is supplied.")
|
30
30
|
param :activation_key_id, :number, :desc => N_("activation key identifier"), :required => false
|
31
31
|
param :host_id, :number, :desc => N_("Id of the host"), :required => false
|
32
|
-
param :content_access_mode_all, :bool, :desc => N_("Get all content available, not just that provided by subscriptions.")
|
32
|
+
param :content_access_mode_all, :bool, :desc => N_("Get all content available, not just that provided by subscriptions."), deprecated: true, default: true
|
33
33
|
param :content_access_mode_env, :bool, :desc => N_("Limit content to just that available in the host's or activation key's content view version and lifecycle environment.")
|
34
34
|
param :status, [:enabled, :disabled, :overridden],
|
35
35
|
:desc => N_("Limit content to enabled / disabled / overridden"),
|
@@ -225,6 +225,7 @@ module Katello
|
|
225
225
|
|
226
226
|
def setup_params
|
227
227
|
return unless params[:id]
|
228
|
+
params[:content_access_mode_all] = true
|
228
229
|
if params[:entity] == :activation_key
|
229
230
|
params[:activation_key_id] ||= params[:id]
|
230
231
|
else
|
@@ -1,42 +1,29 @@
|
|
1
1
|
module Katello
|
2
2
|
class Api::V2::SimpleContentAccessController < Api::V2::ApiController
|
3
|
-
before_action :find_organization
|
4
|
-
|
5
3
|
resource_description do
|
6
4
|
description "Red Hat subscriptions management platform."
|
7
5
|
api_version 'v2'
|
8
6
|
end
|
9
7
|
|
10
|
-
|
11
|
-
|
8
|
+
def render_sca_410_error
|
9
|
+
render_error 'custom_error', status: :gone,
|
10
|
+
locals: { message: N_('Simple Content Access is the only supported content access mode') }
|
11
|
+
end
|
12
|
+
|
12
13
|
def eligible
|
13
|
-
|
14
|
-
eligible = @organization.simple_content_access_eligible?
|
15
|
-
render json: { simple_content_access_eligible: eligible }
|
14
|
+
render_sca_410_error
|
16
15
|
end
|
17
16
|
|
18
|
-
api :GET, "/organizations/:organization_id/simple_content_access/status",
|
19
|
-
N_("Check if the specified organization has Simple Content Access enabled. %s") % sca_only_deprecation_text, deprecated: true
|
20
|
-
param :organization_id, :number, :desc => N_("Organization ID"), :required => true
|
21
17
|
def status
|
22
|
-
|
23
|
-
render json: { simple_content_access: status }
|
18
|
+
render_sca_410_error
|
24
19
|
end
|
25
20
|
|
26
|
-
api :PUT, "/organizations/:organization_id/simple_content_access/enable",
|
27
|
-
N_("Enable simple content access for a manifest"), deprecated: true
|
28
|
-
param :organization_id, :number, :desc => N_("Organization ID"), :required => true
|
29
21
|
def enable
|
30
|
-
|
31
|
-
respond_for_async :resource => task
|
22
|
+
render_sca_410_error
|
32
23
|
end
|
33
24
|
|
34
|
-
api :PUT, "/organizations/:organization_id/simple_content_access/disable",
|
35
|
-
N_("Disable simple content access for a manifest. %s") % sca_only_deprecation_text, deprecated: true
|
36
|
-
param :organization_id, :number, :desc => N_("Organization ID"), :required => true
|
37
25
|
def disable
|
38
|
-
|
39
|
-
respond_for_async :resource => task
|
26
|
+
render_sca_410_error
|
40
27
|
end
|
41
28
|
end
|
42
29
|
end
|
@@ -49,7 +49,7 @@ module Katello
|
|
49
49
|
|
50
50
|
# promote_or_remove_content_views_to_environments has a special relationship to promote_or_remove_content_views
|
51
51
|
if path_to_authenticate["controller"] == "katello/api/v2/content_view_versions" &&
|
52
|
-
path_to_authenticate["action"].in?(["promote", "remove_from_environment", "remove", "republish_repositories"])
|
52
|
+
path_to_authenticate["action"].in?(["promote", "remove_from_environment", "remove", "republish_repositories", "verify_checksum"])
|
53
53
|
missing_perms << ::Permission.find_by(name: "promote_or_remove_content_views_to_environments")
|
54
54
|
end
|
55
55
|
missing_perms
|
@@ -13,7 +13,7 @@ module Katello
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def start_report_task(days_from_now)
|
16
|
-
@report_template = ReportTemplate.find_by(name: "Subscription -
|
16
|
+
@report_template = ReportTemplate.find_by(name: "Subscription - General Report")
|
17
17
|
template_input_id = @report_template.template_inputs.find_by_name("Days from Now").id.to_s
|
18
18
|
params = { format: 'csv', template_id: @report_template.id, input_values: { template_input_id => { value: days_from_now} } }
|
19
19
|
composer = ReportComposer.new(params)
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class CreateManifestExpireSoonWarningNotifications < ApplicationJob
|
2
|
+
def perform
|
3
|
+
Katello::UINotifications::Subscriptions::ManifestExpireSoonWarning.deliver!
|
4
|
+
ensure
|
5
|
+
self.class.set(:wait => 24.hours).perform_later
|
6
|
+
end
|
7
|
+
|
8
|
+
def humanized_name
|
9
|
+
_('Subscription Manifest expiration date check')
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Actions
|
2
|
+
module Candlepin
|
3
|
+
module Owner
|
4
|
+
class RegenerateUpstreamIdentityCert < Candlepin::Abstract
|
5
|
+
input_format do
|
6
|
+
param :organization_id
|
7
|
+
param :upstream
|
8
|
+
end
|
9
|
+
|
10
|
+
def run
|
11
|
+
organization = ::Organization.find(input[:organization_id])
|
12
|
+
output[:response] = organization.redhat_provider.owner_upstream_regenerate_identity_cert(input[:upstream])
|
13
|
+
end
|
14
|
+
|
15
|
+
def rescue_strategy
|
16
|
+
Dynflow::Action::Rescue::Skip
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -52,7 +52,7 @@ module Actions
|
|
52
52
|
notification = MailNotification[:proxy_sync_failure]
|
53
53
|
proxy = SmartProxy.find(input.fetch(:smart_proxy, {})[:id])
|
54
54
|
subjects = subjects(input[:options]).merge(smart_proxy: proxy)
|
55
|
-
notification.users.
|
55
|
+
notification.users.with_enabled_email.each do |user|
|
56
56
|
notification.deliver(subjects.merge(user: user, task: task))
|
57
57
|
end
|
58
58
|
end
|
@@ -69,8 +69,13 @@ module Actions
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def update_content_counts(_execution_plan)
|
72
|
-
|
73
|
-
|
72
|
+
if Setting[:automatic_content_count_updates]
|
73
|
+
smart_proxy = ::SmartProxy.unscoped.find(input[:smart_proxy_id])
|
74
|
+
::ForemanTasks.async_task(::Actions::Katello::CapsuleContent::UpdateContentCounts, smart_proxy)
|
75
|
+
else
|
76
|
+
Rails.logger.info "Skipping content counts update as automatic content count updates are disabled. To enable automatic content count updates, set the 'automatic_content_count_updates' setting to true.
|
77
|
+
To update content counts manually, run the 'Update Content Counts' action."
|
78
|
+
end
|
74
79
|
end
|
75
80
|
|
76
81
|
def resource_locks
|
@@ -0,0 +1,75 @@
|
|
1
|
+
module Actions
|
2
|
+
module Katello
|
3
|
+
module CapsuleContent
|
4
|
+
class VerifyChecksum < ::Actions::EntryAction
|
5
|
+
def humanized_name
|
6
|
+
_("Verify checksum for content on smart proxy")
|
7
|
+
end
|
8
|
+
|
9
|
+
def plan(smart_proxy, options = {})
|
10
|
+
input[:options] = options
|
11
|
+
action_subject(smart_proxy)
|
12
|
+
fail _("Action not allowed for the default smart proxy.") if smart_proxy.pulp_primary?
|
13
|
+
subjects = subjects(options)
|
14
|
+
repair_options = options.merge(subjects)
|
15
|
+
environment = repair_options[:environment]
|
16
|
+
content_view = repair_options[:content_view]
|
17
|
+
check_cv_capsule_environments!(smart_proxy, content_view, environment)
|
18
|
+
repository = repair_options[:repository]
|
19
|
+
repos = repos_to_repair(smart_proxy, environment, content_view, repository)
|
20
|
+
repos.in_groups_of(Setting[:foreman_proxy_content_batch_size], false) do |repo_batch|
|
21
|
+
concurrence do
|
22
|
+
repo_batch.each do |repo|
|
23
|
+
if smart_proxy.pulp3_support?(repo)
|
24
|
+
plan_action(Actions::Pulp3::CapsuleContent::VerifyChecksum,
|
25
|
+
repo,
|
26
|
+
smart_proxy)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def repos_to_repair(smart_proxy, environment, content_view, repository)
|
34
|
+
smart_proxy_helper = ::Katello::SmartProxyHelper.new(smart_proxy)
|
35
|
+
smart_proxy_helper.lifecycle_environment_check(environment, repository)
|
36
|
+
if repository
|
37
|
+
[repository]
|
38
|
+
else
|
39
|
+
repositories = smart_proxy_helper.repositories_available_to_capsule(environment, content_view).by_rpm_count
|
40
|
+
repositories
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def check_cv_capsule_environments!(smart_proxy, content_view, environment)
|
45
|
+
cv_environments = content_view&.versions&.collect(&:environments)&.flatten
|
46
|
+
if cv_environments.present?
|
47
|
+
if environment.present? && !(cv_environments.pluck(:id).include? environment.id)
|
48
|
+
fail _("Content view '%{content_view}' is not attached to the environment.") % {content_view: content_view.name}
|
49
|
+
end
|
50
|
+
if (smart_proxy.lifecycle_environments.pluck(:id) & cv_environments.pluck(:id)).empty?
|
51
|
+
fail _("Content view '%{content_view}' is not attached to this capsule.") % {content_view: content_view.name}
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def subjects(options = {})
|
57
|
+
environment_id = options.fetch(:environment_id, nil)
|
58
|
+
environment = ::Katello::KTEnvironment.find(environment_id) if environment_id
|
59
|
+
|
60
|
+
repository_id = options.fetch(:repository_id, nil)
|
61
|
+
repository = ::Katello::Repository.find(repository_id) if repository_id
|
62
|
+
|
63
|
+
content_view_id = options.fetch(:content_view_id, nil)
|
64
|
+
content_view = ::Katello::ContentView.find(content_view_id) if content_view_id
|
65
|
+
|
66
|
+
{content_view: content_view, environment: environment, repository: repository}
|
67
|
+
end
|
68
|
+
|
69
|
+
def rescue_strategy
|
70
|
+
Dynflow::Action::Rescue::Skip
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -27,7 +27,7 @@ module Actions
|
|
27
27
|
def notify_on_failure(_plan)
|
28
28
|
notification = MailNotification[:content_view_promote_failure]
|
29
29
|
view = ::Katello::ContentView.find(input.fetch(:content_view, {})[:id])
|
30
|
-
notification.users.
|
30
|
+
notification.users.with_enabled_email.each do |user|
|
31
31
|
notification.deliver(user: user, content_view: view, task: task)
|
32
32
|
end
|
33
33
|
end
|
@@ -136,7 +136,7 @@ module Actions
|
|
136
136
|
def notify_on_failure(_plan)
|
137
137
|
notification = MailNotification[:content_view_publish_failure]
|
138
138
|
view = ::Katello::ContentView.find(input.fetch(:content_view, {})[:id])
|
139
|
-
notification.users.
|
139
|
+
notification.users.with_enabled_email.each do |user|
|
140
140
|
notification.deliver(user: user, content_view: view, task: task)
|
141
141
|
end
|
142
142
|
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Actions
|
2
|
+
module Katello
|
3
|
+
module ContentViewVersion
|
4
|
+
class VerifyChecksum < Actions::EntryAction
|
5
|
+
def plan(content_view_version)
|
6
|
+
action_subject(content_view_version.content_view)
|
7
|
+
plan_self(:version_id => content_view_version.id)
|
8
|
+
plan_action(::Actions::BulkAction, ::Actions::Katello::Repository::VerifyChecksum, content_view_version.repositories) if content_view_version.repositories.any?
|
9
|
+
end
|
10
|
+
|
11
|
+
def run
|
12
|
+
#dummy run phase to save input and support humanized_name
|
13
|
+
end
|
14
|
+
|
15
|
+
def humanized_name
|
16
|
+
if input && input[:version_id]
|
17
|
+
version = ::Katello::ContentViewVersion.find_by(:id => input[:version_id])
|
18
|
+
end
|
19
|
+
|
20
|
+
if version
|
21
|
+
_("Verify checksum of repositories in %{name} %{version}") % {:name => version.content_view.name, :version => version.version}
|
22
|
+
else
|
23
|
+
_("Verify checksum of version repositories")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -169,6 +169,7 @@ module Actions
|
|
169
169
|
if @candlepin_attributes.key?(uuid)
|
170
170
|
host.subscription_facet.candlepin_consumer.consumer_attributes = @candlepin_attributes[uuid]
|
171
171
|
host.subscription_facet.import_database_attributes
|
172
|
+
host.subscription_facet.last_checkin = Time.now
|
172
173
|
host.subscription_facet.save!
|
173
174
|
end
|
174
175
|
end
|
@@ -17,9 +17,9 @@ module Actions
|
|
17
17
|
|
18
18
|
def humanized_name
|
19
19
|
if input.try(:[], :hostname).nil?
|
20
|
-
_("Update for host")
|
20
|
+
_("Update content view environments for host")
|
21
21
|
else
|
22
|
-
_("Update for host %s") % input[:hostname]
|
22
|
+
_("Update content view environments for host %s") % input[:hostname]
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
@@ -16,10 +16,15 @@ module Actions
|
|
16
16
|
repositories.each do |repo|
|
17
17
|
plan_action(Katello::Repository::RefreshRepository, repo)
|
18
18
|
end
|
19
|
-
plan_self
|
19
|
+
plan_self(:organization_name => organization.name)
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
+
def run
|
24
|
+
organization = ::Organization.find_by(name: input[:organization_name])
|
25
|
+
organization&.manifest_expiration_date(cached: false) # update organization.manifest_imported? value
|
26
|
+
end
|
27
|
+
|
23
28
|
def failure_notification(plan)
|
24
29
|
::Katello::UINotifications::Subscriptions::ManifestDeleteError.deliver!(
|
25
30
|
:subject => subject_organization,
|
@@ -27,6 +27,11 @@ module Actions
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
+
def run
|
31
|
+
organization = ::Organization.find_by(name: input[:organization_name])
|
32
|
+
organization&.manifest_expiration_date(cached: false) # update the date
|
33
|
+
end
|
34
|
+
|
30
35
|
def failure_notification(plan)
|
31
36
|
::Katello::UINotifications::Subscriptions::ManifestImportError.deliver!(
|
32
37
|
:subject => subject_organization,
|
@@ -21,6 +21,9 @@ module Actions
|
|
21
21
|
upstream_update = plan_action(Candlepin::Owner::UpstreamUpdate,
|
22
22
|
{ :organization_id => organization.id,
|
23
23
|
:upstream => upstream })
|
24
|
+
plan_action(Candlepin::Owner::RegenerateUpstreamIdentityCert,
|
25
|
+
{ :organization_id => organization.id,
|
26
|
+
:upstream => upstream })
|
24
27
|
export_action = plan_action(Candlepin::Owner::StartUpstreamExport,
|
25
28
|
{ :organization_id => organization.id,
|
26
29
|
:upstream => upstream,
|