katello 4.7.0 → 4.7.2
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/v2/activation_keys_controller.rb +1 -0
- data/app/controllers/katello/api/v2/alternate_content_sources_controller.rb +4 -1
- data/app/controllers/katello/api/v2/simple_content_access_controller.rb +2 -2
- data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +0 -1
- data/app/lib/actions/katello/repository/update.rb +1 -0
- data/app/lib/katello/util/candlepin_repository_checker.rb +2 -0
- data/app/models/katello/concerns/host_managed_extensions.rb +4 -2
- data/app/models/katello/concerns/organization_extensions.rb +4 -4
- data/app/models/katello/concerns/smart_proxy_extensions.rb +1 -1
- data/app/models/katello/content.rb +1 -1
- data/app/models/katello/glue/candlepin/owner.rb +4 -0
- data/app/models/katello/glue/provider.rb +1 -1
- data/app/services/katello/product_content_importer.rb +61 -5
- data/app/services/katello/pulp3/ansible_collection.rb +9 -6
- data/app/services/katello/pulp3/repository.rb +2 -0
- data/app/services/katello/pulp3/smart_proxy_mirror_repository.rb +2 -2
- data/db/migrate/20230119003859_ensure_repo_username_password_nil_not_blank.rb +9 -0
- data/engines/bastion/app/views/bastion/layouts/assets.html.erb +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +2 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +7 -0
- data/lib/katello/engine.rb +1 -0
- data/lib/katello/version.rb +1 -1
- data/locale/action_names.rb +69 -69
- data/locale/bn/katello.po +23 -20
- data/locale/cs/katello.po +23 -20
- data/locale/de/katello.po +25 -22
- data/locale/en/katello.po +23 -20
- data/locale/es/katello.po +335 -332
- data/locale/fr/katello.po +704 -695
- data/locale/gu/katello.po +23 -20
- data/locale/hi/katello.po +23 -20
- data/locale/it/katello.po +23 -20
- data/locale/ja/katello.po +570 -561
- data/locale/ka/katello.po +2269 -2260
- data/locale/katello.pot +287 -279
- data/locale/kn/katello.po +23 -20
- data/locale/ko/katello.po +57 -53
- data/locale/mr/katello.po +23 -20
- data/locale/or/katello.po +23 -20
- data/locale/pa/katello.po +23 -20
- data/locale/pt/katello.po +23 -20
- data/locale/pt_BR/katello.po +441 -438
- data/locale/ru/katello.po +23 -20
- data/locale/ta/katello.po +23 -20
- data/locale/te/katello.po +23 -20
- data/locale/zh_CN/katello.po +694 -687
- data/locale/zh_TW/katello.po +23 -20
- data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/ChangeHostCVModal.js +5 -11
- data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/__tests__/changeHostCVModal.test.js +2 -2
- data/webpack/components/extensions/HostDetails/DetailsTabCards/RegistrationCard.js +1 -1
- data/webpack/components/extensions/HostDetails/DetailsTabCards/SystemPropertiesCardExtensions.js +58 -1
- data/webpack/components/extensions/HostDetails/Tabs/ModuleStreamsTab/ModuleStreamsTab.js +5 -1
- data/webpack/global_index.js +2 -0
- data/webpack/scenes/ContentViews/Delete/Steps/CVDeletionReassignActivationKeysForm.js +10 -10
- data/webpack/scenes/ContentViews/Delete/Steps/CVDeletionReassignHostsForm.js +10 -10
- data/webpack/scenes/ContentViews/Delete/__tests__/contentViewDelete.test.js +5 -5
- data/webpack/scenes/ContentViews/Details/Versions/BulkDelete/Steps/ReassignActivationKeys.js +9 -10
- data/webpack/scenes/ContentViews/Details/Versions/BulkDelete/Steps/ReassignHosts.js +13 -10
- data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVReassignActivationKeysForm.js +18 -18
- data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVReassignHostsForm.js +10 -6
- data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvVersionRemove.test.js +6 -6
- data/webpack/scenes/ContentViews/components/ContentViewSelect/ContentViewSelect.js +40 -0
- data/webpack/scenes/Hosts/ChangeContentSource/actions.js +0 -1
- data/webpack/scenes/Hosts/ChangeContentSource/components/ContentSourceForm.js +16 -2
- data/webpack/scenes/Hosts/ChangeContentSource/components/ContentSourceTemplate.js +13 -17
- data/webpack/scenes/Hosts/ChangeContentSource/index.js +79 -39
- data/webpack/scenes/Hosts/ChangeContentSource/styles.scss +6 -2
- metadata +4 -3
- data/app/services/katello/candlepin/upstream_consumer.rb +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: caf8ccd185806f397ab47aff3a18c1419e93ae534a597bdf08467f865690c2d4
|
4
|
+
data.tar.gz: c19cceba74ca69d6b839f9c0b6f1de58853c8d3b36103f0c002a17873c9d8da3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1df0d7b2063005b81247f8a0038893753927855909583f19a10510c50c8c68cd22aba87d1b2629d74875b764fef70322b4d978c0b8fe4d4299d55601217e86b
|
7
|
+
data.tar.gz: bd9f1f8a869ef9a1307dcaf306b649a128f1833b03f8af9f722b40c4c82c59a2165669c06d534fe34077af8b684297a6891c46d62cab8ebf8b836a7534c7b514
|
@@ -341,6 +341,7 @@ module Katello
|
|
341
341
|
end
|
342
342
|
|
343
343
|
def validate_release_version
|
344
|
+
@organization ||= find_organization
|
344
345
|
if params[:release_version].present? && !@organization.library.available_releases.include?(params[:release_version])
|
345
346
|
fail HttpErrors::BadRequest, _("Invalid release version: [%s]") % params[:release_version]
|
346
347
|
end
|
@@ -27,6 +27,7 @@ module Katello
|
|
27
27
|
end
|
28
28
|
|
29
29
|
api :GET, "/alternate_content_sources", N_("List alternate content sources.")
|
30
|
+
param :name, String, :desc => N_("Name of the alternate content source"), :required => false
|
30
31
|
param_group :search, Api::V2::ApiController
|
31
32
|
add_scoped_search_description_for(AlternateContentSource)
|
32
33
|
def index
|
@@ -52,7 +53,9 @@ module Katello
|
|
52
53
|
end
|
53
54
|
|
54
55
|
def index_relation
|
55
|
-
AlternateContentSource.readable.distinct
|
56
|
+
query = AlternateContentSource.readable.distinct
|
57
|
+
query = query.where(name: params[:name]) if params[:name]
|
58
|
+
query
|
56
59
|
end
|
57
60
|
|
58
61
|
api :GET, '/alternate_content_sources/:id', N_('Show an alternate content source.')
|
@@ -1,7 +1,6 @@
|
|
1
1
|
module Katello
|
2
2
|
class Api::V2::SimpleContentAccessController < Api::V2::ApiController
|
3
3
|
before_action :find_organization
|
4
|
-
before_action :check_upstream_connection
|
5
4
|
|
6
5
|
resource_description do
|
7
6
|
description "Red Hat subscriptions management platform."
|
@@ -11,7 +10,8 @@ module Katello
|
|
11
10
|
api :GET, "/organizations/:organization_id/simple_content_access/eligible",
|
12
11
|
N_("Check if the specified organization is eligible for Simple Content Access")
|
13
12
|
def eligible
|
14
|
-
eligible
|
13
|
+
::Foreman::Deprecation.api_deprecation_warning("This endpoint is deprecated and will be removed in a future release. All organizations are now eligible for Simple Content Access.")
|
14
|
+
eligible = @organization.simple_content_access_eligible?
|
15
15
|
render json: { simple_content_access_eligible: eligible }
|
16
16
|
end
|
17
17
|
|
@@ -9,6 +9,7 @@ module Actions
|
|
9
9
|
action_subject root.library_instance
|
10
10
|
|
11
11
|
repo_params[:url] = nil if repo_params[:url] == ''
|
12
|
+
repo_params[:checksum_type] = nil if repo_params[:download_policy] == ::Katello::RootRepository::DOWNLOAD_ON_DEMAND
|
12
13
|
update_cv_cert_protected = repo_params.key?(:unprotected) && (repo_params[:unprotected] != repository.unprotected)
|
13
14
|
create_acs = create_acs?(repository.url, repo_params[:url])
|
14
15
|
delete_acs = delete_acs?(repository.url, repo_params[:url])
|
@@ -33,6 +33,8 @@ module Katello
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def self.repository_exist_in_backend?(repository)
|
36
|
+
return false if repository.root.content_id.blank?
|
37
|
+
|
36
38
|
::Katello::Resources::Candlepin::Content.get(repository.organization.label, repository.root.content_id)
|
37
39
|
true
|
38
40
|
rescue RestClient::NotFound
|
@@ -124,8 +124,10 @@ module Katello
|
|
124
124
|
end
|
125
125
|
|
126
126
|
def refresh_content_host_status
|
127
|
-
|
128
|
-
status
|
127
|
+
if content_facet&.present?
|
128
|
+
self.host_statuses.where(type: ::Katello::HostStatusManager::STATUSES.map(&:name)).each do |status|
|
129
|
+
status.refresh!
|
130
|
+
end
|
129
131
|
end
|
130
132
|
refresh_global_status
|
131
133
|
end
|
@@ -90,6 +90,10 @@ module Katello
|
|
90
90
|
self.providers.anonymous.first
|
91
91
|
end
|
92
92
|
|
93
|
+
def simple_content_access_eligible?
|
94
|
+
self.content_access_mode_list.include?('org_environment')
|
95
|
+
end
|
96
|
+
|
93
97
|
def manifest_imported?(cached: false)
|
94
98
|
Rails.cache.fetch("#{self.label}_manifest_imported?", expires_in: 1.minute, force: !cached) do
|
95
99
|
owner_details['upstreamConsumer'].present?
|
@@ -238,10 +242,6 @@ module Katello
|
|
238
242
|
# doesn't provide much benefit for the frustration it creates.
|
239
243
|
self.save(validate: false)
|
240
244
|
end
|
241
|
-
|
242
|
-
def upstream_consumer
|
243
|
-
Katello::Candlepin::UpstreamConsumer.new(self)
|
244
|
-
end
|
245
245
|
end
|
246
246
|
end
|
247
247
|
end
|
@@ -187,7 +187,7 @@ module Katello
|
|
187
187
|
config.host = uri.host
|
188
188
|
config.scheme = uri.scheme
|
189
189
|
pulp3_ssl_configuration(config)
|
190
|
-
config.debugging =
|
190
|
+
config.debugging = ::Foreman::Logging.logger('katello/pulp_rest').debug?
|
191
191
|
config.timeout = SETTINGS[:katello][:rest_client_timeout]
|
192
192
|
config.logger = ::Foreman::Logging.logger('katello/pulp_rest')
|
193
193
|
config.username = self.setting(PULP3_FEATURE, 'username')
|
@@ -41,7 +41,7 @@ module Katello
|
|
41
41
|
cp_products = ::Katello::Resources::Candlepin::Product.all(org.label, [:id, :productContent])
|
42
42
|
product_hash = cp_products.group_by { |prod| prod['id'] }
|
43
43
|
|
44
|
-
prod_content_importer = Katello::ProductContentImporter.new
|
44
|
+
prod_content_importer = Katello::ProductContentImporter.new(product_hash)
|
45
45
|
org.products.each do |product|
|
46
46
|
product_json = product_hash[product.cp_id]&.first
|
47
47
|
|
@@ -45,6 +45,10 @@ module Katello
|
|
45
45
|
self.owner_details['contentAccessMode']
|
46
46
|
end
|
47
47
|
|
48
|
+
def content_access_mode_list
|
49
|
+
self.owner_details['contentAccessModeList'].split(',')
|
50
|
+
end
|
51
|
+
|
48
52
|
def simple_content_access?(cached: true)
|
49
53
|
Rails.cache.fetch("#{self.label}_simple_content_access?", expires_in: 1.minute, force: !cached) do
|
50
54
|
content_access_mode == "org_environment"
|
@@ -122,7 +122,7 @@ module Katello
|
|
122
122
|
cp_products = ::Katello::Resources::Candlepin::Product.all(organization.label, [:id, :name, :multiplier, :productContent])
|
123
123
|
cp_products = cp_products.select { |prod| Glue::Candlepin::Product.engineering_product_id?(prod['id']) }
|
124
124
|
|
125
|
-
prod_content_importer = Katello::ProductContentImporter.new
|
125
|
+
prod_content_importer = Katello::ProductContentImporter.new(cp_products)
|
126
126
|
|
127
127
|
Katello::Logging.time("Imported #{cp_products.size} products") do
|
128
128
|
cp_products.each do |product_json|
|
@@ -22,32 +22,75 @@ module Katello
|
|
22
22
|
# }
|
23
23
|
attr_reader :content_url_updated
|
24
24
|
|
25
|
-
def initialize
|
25
|
+
def initialize(cp_products = [])
|
26
26
|
@contents_to_create = []
|
27
27
|
@product_contents_to_create = []
|
28
28
|
@product_mapping = {}
|
29
29
|
@content_url_updated = []
|
30
|
+
@cp_products = cp_products
|
30
31
|
end
|
31
32
|
|
32
33
|
def add_product_content(product, product_content_json)
|
33
34
|
@product_mapping[product] = product_content_json.map(&:with_indifferent_access)
|
34
35
|
end
|
35
36
|
|
37
|
+
def find_product_for_content(content_id)
|
38
|
+
prod = @cp_products.find do |prod_json|
|
39
|
+
prod_json['productContent'].any? do |product_content_json|
|
40
|
+
product_content_json["content"]["id"] == content_id
|
41
|
+
end
|
42
|
+
end
|
43
|
+
::Katello::Product.find_by(cp_id: prod["id"]) if prod
|
44
|
+
end
|
45
|
+
|
46
|
+
def fetch_product_contents_to_move(product, prod_contents_json)
|
47
|
+
content_ids = prod_contents_json.map { |pc| pc[:content][:id] }
|
48
|
+
# Identify if there are any product_content that should not be
|
49
|
+
# part of this product.
|
50
|
+
product_contents_to_delete_or_move = product.
|
51
|
+
product_contents.
|
52
|
+
joins(:content).
|
53
|
+
where.not(content: { cp_content_id: content_ids })
|
54
|
+
# Identify if product content actually moved between 2 different products
|
55
|
+
product_contents_to_delete_or_move.select do |pc|
|
56
|
+
content_exists?(product.organization, pc.content)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def handle_product_moves(product, prod_contents_json)
|
61
|
+
product_contents_to_move = fetch_product_contents_to_move(product, prod_contents_json)
|
62
|
+
moved_product_contents = []
|
63
|
+
product_contents_to_move.each do |pc|
|
64
|
+
content = pc.content
|
65
|
+
root_repo = product.root_repositories.find_by(content_id: content.cp_content_id)
|
66
|
+
actual_product = find_product_for_content(content.cp_content_id)
|
67
|
+
if actual_product.present? && root_repo.present? && root_repo.product != actual_product
|
68
|
+
root_repo.update!(product_id: actual_product.id)
|
69
|
+
pc.update!(product_id: actual_product.id)
|
70
|
+
moved_product_contents << pc
|
71
|
+
else
|
72
|
+
pc.destroy!
|
73
|
+
end
|
74
|
+
end
|
75
|
+
product.reload unless product_contents_to_move.blank?
|
76
|
+
|
77
|
+
moved_product_contents
|
78
|
+
end
|
79
|
+
|
36
80
|
def import
|
37
81
|
return if @product_mapping.blank?
|
38
|
-
|
82
|
+
moved_product_contents = []
|
39
83
|
@product_mapping.each do |product, prod_contents_json|
|
84
|
+
moved_product_contents += handle_product_moves(product, prod_contents_json)
|
40
85
|
existing_product_contents = product.product_contents.to_a
|
41
|
-
|
42
86
|
prod_contents_json.each do |prod_content_json|
|
43
87
|
content = create_or_update_content(product, prod_content_json)
|
44
88
|
existing_content_map[content.cp_content_id] = content if content.new_record?
|
45
89
|
create_or_update_product_content(product, existing_product_contents, content, prod_content_json[:enabled])
|
46
90
|
end
|
47
91
|
end
|
48
|
-
|
49
92
|
::Katello::Content.import(@contents_to_create, recursive: true)
|
50
|
-
::Katello::ProductContent.import(
|
93
|
+
::Katello::ProductContent.import(fetch_product_contents_to_create(moved_product_contents))
|
51
94
|
end
|
52
95
|
|
53
96
|
private def existing_content_map
|
@@ -60,6 +103,19 @@ module Katello
|
|
60
103
|
@existing_content_map
|
61
104
|
end
|
62
105
|
|
106
|
+
private def content_exists?(org, content)
|
107
|
+
Resources::Candlepin::Content.get(org.label, content.cp_content_id)
|
108
|
+
true
|
109
|
+
rescue RestClient::NotFound
|
110
|
+
false
|
111
|
+
end
|
112
|
+
|
113
|
+
private def fetch_product_contents_to_create(moved_product_contents)
|
114
|
+
@product_contents_to_create.select do |pc|
|
115
|
+
moved_product_contents.none? { |mpc| mpc.content_id == pc.content_id && mpc.product_id == pc.product_id }
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
63
119
|
private def create_or_update_content(product, prod_content_json)
|
64
120
|
content = existing_content_map[prod_content_json[:content][:id].to_s]
|
65
121
|
if content
|
@@ -30,22 +30,25 @@ module Katello
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def self.insert_child_associations(units, pulp_id_to_id)
|
33
|
-
|
34
|
-
tag_rows = tag_names.map { |name| {name: name } }
|
35
|
-
Katello::AnsibleTag.insert_all(tag_rows, unique_by: [:name]) if tag_rows.any?
|
36
|
-
|
33
|
+
insert_tags units
|
37
34
|
collection_tag_rows = []
|
38
35
|
units.each do |unit|
|
39
36
|
katello_id = pulp_id_to_id[unit['pulp_href']]
|
40
37
|
#delete old tags
|
41
|
-
unit_tags = unit['tags']
|
38
|
+
unit_tags = unit['tags']&.map { |tag| tag[:name] }
|
42
39
|
Katello::AnsibleCollectionTag.where(:ansible_collection_id => katello_id).where.not(:ansible_tag_id => Katello::AnsibleTag.where(:name => unit_tags)).delete_all
|
43
|
-
collection_tag_rows += Katello::AnsibleTag.where(:name => unit_tags)
|
40
|
+
collection_tag_rows += Katello::AnsibleTag.where(:name => unit_tags)&.pluck(:id)&.map { |tag_id| {ansible_collection_id: katello_id, ansible_tag_id: tag_id} }
|
44
41
|
end
|
45
42
|
|
46
43
|
collection_tag_rows.flatten!
|
47
44
|
Katello::AnsibleCollectionTag.insert_all(collection_tag_rows, unique_by: [:ansible_collection_id, :ansible_tag_id]) unless collection_tag_rows.empty?
|
48
45
|
end
|
46
|
+
|
47
|
+
def self.insert_tags(units)
|
48
|
+
tag_names = units.map { |unit| unit['tags']&.map { |tag| tag[:name] } }&.flatten
|
49
|
+
tag_rows = tag_names&.compact&.map { |name| {name: name } }
|
50
|
+
Katello::AnsibleTag.insert_all(tag_rows, unique_by: [:name]) if tag_rows.any?
|
51
|
+
end
|
49
52
|
end
|
50
53
|
end
|
51
54
|
end
|
@@ -385,6 +385,8 @@ module Katello
|
|
385
385
|
remote_options[:download_concurrency] = root.download_concurrency unless root.download_concurrency.blank?
|
386
386
|
remote_options.merge!(username: root&.upstream_username,
|
387
387
|
password: root&.upstream_password)
|
388
|
+
remote_options[:username] = nil if remote_options[:username] == ''
|
389
|
+
remote_options[:password] = nil if remote_options[:password] == ''
|
388
390
|
remote_options.merge!(ssl_remote_options)
|
389
391
|
end
|
390
392
|
|
@@ -26,7 +26,7 @@ module Katello
|
|
26
26
|
api = repo_type.pulp3_api(smart_proxy)
|
27
27
|
version_hrefs = api.repository_versions
|
28
28
|
orphan_version_hrefs = api.list_all.collect do |pulp_repo|
|
29
|
-
mirror_repo_versions = api.versions_list_for_repository(pulp_repo.pulp_href, ordering:
|
29
|
+
mirror_repo_versions = api.versions_list_for_repository(pulp_repo.pulp_href, ordering: ['-pulp_created'])
|
30
30
|
version_hrefs = mirror_repo_versions.select { |repo_version| repo_version.number != 0 }.collect { |version| version.pulp_href }
|
31
31
|
|
32
32
|
version_hrefs - [pulp_repo.latest_version_href]
|
@@ -104,7 +104,7 @@ module Katello
|
|
104
104
|
|
105
105
|
remotes.each do |remote|
|
106
106
|
if !repo_names.include?(remote.name) && !acs_remotes.include?(remote.pulp_href)
|
107
|
-
tasks << api.delete_remote(
|
107
|
+
tasks << api.delete_remote(remote.pulp_href)
|
108
108
|
end
|
109
109
|
end
|
110
110
|
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
class EnsureRepoUsernamePasswordNilNotBlank < ActiveRecord::Migration[6.1]
|
2
|
+
def change
|
3
|
+
::Katello::Repository.library.each do |repo|
|
4
|
+
if repo.upstream_username == '' && repo.upstream_password == ''
|
5
|
+
repo.update(upstream_username: nil, upstream_password: nil)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -21,17 +21,17 @@
|
|
21
21
|
angular.module('Bastion').value('simpleContentAccessEnabled', <%= Organization.current.simple_content_access? if Organization.current %>);
|
22
22
|
angular.module('Bastion').value('isManifestImported', <%= !!Organization.current&.manifest_imported?(cached: true) %>)
|
23
23
|
angular.module('Bastion').value('foreman', tfm);
|
24
|
-
angular.module('Bastion').value('repositoryTypes', angular.fromJson(
|
25
|
-
angular.module('Bastion').value('deleteHostOnUnregister', angular.fromJson(
|
26
|
-
angular.module('Bastion').value('globalContentProxy', angular.fromJson(
|
24
|
+
angular.module('Bastion').value('repositoryTypes', angular.fromJson(`<%= Katello::RepositoryTypeManager.enabled_repository_types.values.to_json.html_safe %>`));
|
25
|
+
angular.module('Bastion').value('deleteHostOnUnregister', angular.fromJson(`<%= Setting[:unregister_delete_host] %>`));
|
26
|
+
angular.module('Bastion').value('globalContentProxy', angular.fromJson(`<%= Setting[:content_default_http_proxy].empty? ? nil.to_json : Setting[:content_default_http_proxy].to_json.html_safe %>`));
|
27
27
|
angular.module('Bastion').value('entriesPerPage', "<%= Setting[:entries_per_page] %>");
|
28
28
|
angular.module('Bastion').value('contentViewSolveDependencies', "<%= Setting[:content_view_solve_dependencies] %>");
|
29
|
-
angular.module('Bastion').constant('BastionConfig', angular.fromJson(
|
29
|
+
angular.module('Bastion').constant('BastionConfig', angular.fromJson(`<%= Bastion.config.to_json.html_safe %>`));
|
30
30
|
angular.module('Bastion.auth').value('CurrentUser', {
|
31
31
|
id: <%= User.current.id %>,
|
32
32
|
admin: <%= User.current.admin || User.current.usergroups.any? { |group| group.admin } %>
|
33
33
|
});
|
34
|
-
angular.module('Bastion.auth').value('Permissions', angular.fromJson(
|
34
|
+
angular.module('Bastion.auth').value('Permissions', angular.fromJson(`<%= User.current.cached_roles.collect { |role| role.permissions }.flatten.to_json.html_safe %>`));
|
35
35
|
angular.module('Bastion').value('newHostDetailsUI', "<%= Setting[:host_details_ui] %>");
|
36
36
|
</script>
|
37
37
|
<% Bastion.plugins.each do |name, plugin| %>
|
@@ -30,6 +30,7 @@ angular.module('Bastion.repositories').controller('RepositoryDetailsInfoControll
|
|
30
30
|
$scope.repository['ignore_srpms'] = $scope.repository['ignorable_content'] && $scope.repository['ignorable_content'].includes("srpm");
|
31
31
|
$scope.repository['ansible_collection_auth_exists'] = $scope.repository['ansible_collection_auth_url'] && $scope.repository['ansible_collection_auth_token'];
|
32
32
|
$scope.genericContentTypes = RepositoryTypesService.genericContentTypes($scope.repository['content_type']);
|
33
|
+
$scope.immediateDownloadPolicy = $scope.repository['download_policy'] === 'immediate';
|
33
34
|
});
|
34
35
|
|
35
36
|
$scope.gpgKeys = function () {
|
@@ -140,6 +141,7 @@ angular.module('Bastion.repositories').controller('RepositoryDetailsInfoControll
|
|
140
141
|
repository.os_versions = $scope.osVersionsParam();
|
141
142
|
repository.$update(function (response) {
|
142
143
|
deferred.resolve(response);
|
144
|
+
$scope.immediateDownloadPolicy = repository['download_policy'] === 'immediate';
|
143
145
|
$scope.repository.ignore_srpms = $scope.repository.ignorable_content && $scope.repository.ignorable_content.includes("srpm");
|
144
146
|
if (!_.isEmpty(response["include_tags"])) {
|
145
147
|
repository.commaIncludeTags = repository["include_tags"].join(", ");
|
@@ -315,6 +315,13 @@
|
|
315
315
|
options-format="id as name for (id, name) in options"
|
316
316
|
on-save="save(repository)">
|
317
317
|
</dd>
|
318
|
+
<dd>
|
319
|
+
<p bst-alert='info' ng-show="immediateDownloadPolicy && repository.download_policy == 'on_demand'">
|
320
|
+
<span translate>
|
321
|
+
Changing download policy to "On Demand" will also clear the checksum type if set. The repository will use the upstream checksum type to verify downloads.
|
322
|
+
</span>
|
323
|
+
</p>
|
324
|
+
</dd>
|
318
325
|
</span>
|
319
326
|
<span>
|
320
327
|
<dt translate>Mirroring Policy</dt>
|
data/lib/katello/engine.rb
CHANGED
@@ -214,6 +214,7 @@ module Katello
|
|
214
214
|
::Api::V2::HostsController.include Katello::Concerns::Api::V2::HostsControllerExtensions
|
215
215
|
::Api::V2::HostgroupsController.include Katello::Concerns::Api::V2::HostgroupsControllerExtensions
|
216
216
|
::Api::V2::SmartProxiesController.include Katello::Concerns::Api::V2::SmartProxiesControllerExtensions
|
217
|
+
::Api::V2::RegistrationController.include ::Foreman::Controller::SmartProxyAuth
|
217
218
|
::Api::V2::RegistrationController.prepend Katello::Concerns::Api::V2::RegistrationControllerExtensions
|
218
219
|
::Api::V2::RegistrationCommandsController.include Katello::Concerns::Api::V2::RegistrationCommandsControllerExtensions
|
219
220
|
|
data/lib/katello/version.rb
CHANGED
data/locale/action_names.rb
CHANGED
@@ -1,84 +1,84 @@
|
|
1
1
|
# Autogenerated!
|
2
|
-
_("Action with sub plans")
|
3
|
-
_("Import facts")
|
4
|
-
_("Import Puppet classes")
|
5
2
|
_("Abstract async task")
|
6
|
-
_("
|
7
|
-
_("
|
8
|
-
_("Delete Activation Key")
|
9
|
-
_("Remote action:")
|
10
|
-
_("Update")
|
3
|
+
_("Abstract")
|
4
|
+
_("Action with sub plans")
|
11
5
|
_("Agent action")
|
12
|
-
_("
|
13
|
-
_("
|
14
|
-
_("Create Alternate Content Source")
|
6
|
+
_("Attach subscriptions")
|
7
|
+
_("Auto attach subscriptions")
|
15
8
|
_("Bulk generate applicability for hosts")
|
16
|
-
_("
|
17
|
-
_("Update Alternate Content Source")
|
18
|
-
_("Generate host applicability")
|
19
|
-
_("Update CDN Configuration")
|
20
|
-
_("Synchronize smart proxy")
|
21
|
-
_("Sync capsule")
|
22
|
-
_("Syncable export")
|
23
|
-
_("Import")
|
24
|
-
_("Export Repository")
|
25
|
-
_("Export Library")
|
26
|
-
_("Export")
|
9
|
+
_("Combined Profile Update")
|
27
10
|
_("Copy version units to library")
|
28
|
-
_("Create
|
29
|
-
_("Create Syncable Export History")
|
11
|
+
_("Create Alternate Content Source")
|
30
12
|
_("Create Export History")
|
31
|
-
_("
|
32
|
-
_("Disable")
|
33
|
-
_("Run Sync Plan:")
|
34
|
-
_("Enable")
|
35
|
-
_("Verify checksum")
|
13
|
+
_("Create Import History")
|
36
14
|
_("Create Package Group")
|
37
|
-
_("
|
38
|
-
_("
|
39
|
-
_("
|
40
|
-
_("
|
41
|
-
_("Synchronize")
|
42
|
-
_("Remove Content")
|
43
|
-
_("Instance update")
|
44
|
-
_("Index package groups")
|
45
|
-
_("Index module streams")
|
46
|
-
_("Index errata")
|
47
|
-
_("Index content")
|
48
|
-
_("Filtered index content")
|
49
|
-
_("Fetch pxe files")
|
50
|
-
_("Errata mail")
|
51
|
-
_("Discover")
|
15
|
+
_("Create Syncable Export History")
|
16
|
+
_("Create")
|
17
|
+
_("Delete Activation Key")
|
18
|
+
_("Delete Lifecycle Environment")
|
52
19
|
_("Delete Package Group")
|
53
|
-
_("Delete")
|
54
|
-
_("Attach subscriptions")
|
55
|
-
_("Publish Lifecycle Environment Repositories")
|
56
|
-
_("Update http proxy")
|
57
|
-
_("Reindex subscriptions")
|
58
20
|
_("Delete Product")
|
59
|
-
_("
|
21
|
+
_("Delete")
|
22
|
+
_("Destroy Alternate Content Source")
|
23
|
+
_("Destroy Content Host")
|
60
24
|
_("Destroy")
|
61
|
-
_("
|
62
|
-
_("
|
63
|
-
_("
|
64
|
-
_("
|
65
|
-
_("
|
66
|
-
_("
|
25
|
+
_("Disable")
|
26
|
+
_("Discover")
|
27
|
+
_("Enable")
|
28
|
+
_("Errata mail")
|
29
|
+
_("Export Library")
|
30
|
+
_("Export Repository")
|
31
|
+
_("Export")
|
32
|
+
_("Fetch pxe files")
|
33
|
+
_("Filtered index content")
|
34
|
+
_("Generate host applicability")
|
35
|
+
_("Generate repository applicability")
|
67
36
|
_("Hypervisors update")
|
68
37
|
_("Hypervisors")
|
69
|
-
_("Install Applicable Errata")
|
70
|
-
_("Destroy Content Host")
|
71
|
-
_("Auto attach subscriptions")
|
72
|
-
_("Delete Lifecycle Environment")
|
73
|
-
_("Republish Version Repositories")
|
74
|
-
_("Incremental Update")
|
75
|
-
_("Import Repository")
|
76
|
-
_("Import Default Content View")
|
77
38
|
_("Import Content View Version")
|
39
|
+
_("Import Default Content View")
|
40
|
+
_("Import Puppet classes")
|
41
|
+
_("Import Repository")
|
42
|
+
_("Import facts")
|
43
|
+
_("Import")
|
44
|
+
_("Incremental Update of Content View Version(s) ")
|
45
|
+
_("Incremental Update")
|
46
|
+
_("Index content")
|
47
|
+
_("Index errata")
|
48
|
+
_("Index module streams")
|
49
|
+
_("Index package groups")
|
50
|
+
_("Install Applicable Errata")
|
51
|
+
_("Instance update")
|
52
|
+
_("Package Profile Update")
|
53
|
+
_("Product Create")
|
54
|
+
_("Promote")
|
55
|
+
_("Promotion to Environment")
|
56
|
+
_("Publish Lifecycle Environment Repositories")
|
57
|
+
_("Publish")
|
58
|
+
_("Refresh Alternate Content Source")
|
59
|
+
_("Reindex subscriptions")
|
60
|
+
_("Remote action:")
|
61
|
+
_("Remove Content")
|
78
62
|
_("Remove Version")
|
79
|
-
_("Remove from Environment")
|
80
63
|
_("Remove Versions and Associations")
|
81
|
-
_("
|
82
|
-
_("
|
83
|
-
_("
|
84
|
-
_("
|
64
|
+
_("Remove from Environment")
|
65
|
+
_("Remove subscriptions")
|
66
|
+
_("Republish Version Repositories")
|
67
|
+
_("Run Sync Plan:")
|
68
|
+
_("Sync capsule")
|
69
|
+
_("Syncable export")
|
70
|
+
_("Synchronize smart proxy")
|
71
|
+
_("Synchronize")
|
72
|
+
_("Update Alternate Content Source")
|
73
|
+
_("Update CDN Configuration")
|
74
|
+
_("Update Content Overrides")
|
75
|
+
_("Update content urls")
|
76
|
+
_("Update for host")
|
77
|
+
_("Update http proxy details")
|
78
|
+
_("Update http proxy")
|
79
|
+
_("Update redhat repository")
|
80
|
+
_("Update release version for host")
|
81
|
+
_("Update")
|
82
|
+
_("Updating System Purpose for host")
|
83
|
+
_("Upload into")
|
84
|
+
_("Verify checksum")
|