katello 4.1.0.rc1.1 → 4.1.0.rc2

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.

Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/v2/content_export_incrementals_controller.rb +6 -6
  3. data/app/controllers/katello/api/v2/content_exports_controller.rb +6 -6
  4. data/app/controllers/katello/concerns/registration_commands_controller_extensions.rb +1 -1
  5. data/app/lib/actions/katello/content_view/publish.rb +8 -8
  6. data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +2 -1
  7. data/app/lib/katello/concerns/base_template_scope_extensions.rb +34 -14
  8. data/app/lib/katello/http_resource.rb +1 -11
  9. data/app/models/katello/concerns/hostgroup_extensions.rb +1 -1
  10. data/app/models/katello/concerns/http_proxy_extensions.rb +1 -2
  11. data/app/models/katello/concerns/setting_extensions.rb +1 -1
  12. data/app/models/katello/glue/candlepin/candlepin_object.rb +29 -11
  13. data/app/models/katello/glue/candlepin/pool.rb +15 -11
  14. data/app/models/katello/pool.rb +1 -1
  15. data/app/services/katello/pulp3/content_view_version/export.rb +11 -2
  16. data/app/services/katello/pulp3/repository.rb +7 -2
  17. data/app/services/katello/pulp3/repository/apt.rb +1 -2
  18. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-details-info.controller.js +1 -6
  19. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-details.controller.js +2 -1
  20. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details.html +1 -1
  21. data/lib/katello/tasks/clean_backend_objects.rake +0 -25
  22. data/lib/katello/version.rb +1 -1
  23. data/webpack/components/RoutedTabs/RoutedTabs.js +1 -1
  24. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8fa898f182416d7da9cfa56ef84ea10f11e4a18981202e4ba0ad65367408a4ca
4
- data.tar.gz: e917344f18c0c835e31acc4463bfff10808a41e66fad2c3f9d833c55c234abae
3
+ metadata.gz: 99a0b0413b05278dfda949b6b01e9a2d8bac8c244f655cce8dfb9988dd313c11
4
+ data.tar.gz: e89dd3e7972f12b5c9f49938fd3a1a7ad84c43db85a28633cd88e9ae10871479
5
5
  SHA512:
6
- metadata.gz: 98470123a70cff266bec4e69e281bba4b492192ff815d57f92f1a1decadbbff15aeabbe5b02abd97c7a60a2fc20f9b853addfec46075dcdbdd1dd3893ae03380
7
- data.tar.gz: c9a0bc998ef5413fb348f983b132d385dbdd9d1039098dbee25adc71456b34fd9ec31b45e26c93ade8f9b02672bc0be75a6d08772ccb6da1716a6b6da02d2833
6
+ metadata.gz: 4d8f557a3027d6fa57addc08cf3cd690610e1d8a6635bbcb9aff7335f56975ec22232de2b774ee9bb4cc946a81596411d1081bb40e17f9b7f950b11b4f52dfb9
7
+ data.tar.gz: 3d706c5f2647a275b4d38886d4edeb81870ac1f72ff8cfddf4ab15c568990ea0a71bbb69d675e0bb2bcbbe9a339627340e52fb5d478024c8185e740193e82740
@@ -8,8 +8,8 @@ module Katello
8
8
  api :POST, "/content_export_incrementals/version", N_("Performs an incremental-export of a content view version.")
9
9
  param :id, :number, :desc => N_("Content view version identifier"), :required => true
10
10
  param :destination_server, String, :desc => N_("Destination Server name"), :required => false
11
- param :chunk_size_mb, :number, :desc => N_("Split the exported content into archives "\
12
- "no greater than the specified size in megabytes."), :required => false
11
+ param :chunk_size_gb, :number, :desc => N_("Split the exported content into archives "\
12
+ "no greater than the specified size in gigabytes."), :required => false
13
13
  param :from_history_id, :number, :desc => N_("Export history identifier used for incremental export. "\
14
14
  "If not provided the most recent export history will be used."), :required => false
15
15
  param :fail_on_missing_content, :bool, :desc => N_("Fails if any of the repositories belonging to this version"\
@@ -18,7 +18,7 @@ module Katello
18
18
  tasks = async_task(Actions::Katello::ContentViewVersion::Export,
19
19
  content_view_version: @version,
20
20
  destination_server: params[:destination_server],
21
- chunk_size: params[:chunk_size_mb],
21
+ chunk_size: params[:chunk_size_gb],
22
22
  from_history: @history,
23
23
  fail_on_missing_content: ::Foreman::Cast.to_bool(params[:fail_on_missing_content]))
24
24
 
@@ -28,8 +28,8 @@ module Katello
28
28
  api :POST, "/content_export_incrementals/library", N_("Performs an incremental-export of the repositories in library.")
29
29
  param :organization_id, :number, :desc => N_("Organization identifier"), :required => true
30
30
  param :destination_server, String, :desc => N_("Destination Server name"), :required => false
31
- param :chunk_size_mb, :number, :desc => N_("Split the exported content into archives "\
32
- "no greater than the specified size in megabytes."), :required => false
31
+ param :chunk_size_gb, :number, :desc => N_("Split the exported content into archives "\
32
+ "no greater than the specified size in gigabytes."), :required => false
33
33
  param :from_history_id, :number, :desc => N_("Export history identifier used for incremental export. "\
34
34
  "If not provided the most recent export history will be used."), :required => false
35
35
  param :fail_on_missing_content, :bool, :desc => N_("Fails if any of the repositories belonging to this organization"\
@@ -38,7 +38,7 @@ module Katello
38
38
  tasks = async_task(::Actions::Pulp3::Orchestration::ContentViewVersion::ExportLibrary,
39
39
  @organization,
40
40
  destination_server: params[:destination_server],
41
- chunk_size: params[:chunk_size_mb],
41
+ chunk_size: params[:chunk_size_gb],
42
42
  from_history: @history,
43
43
  fail_on_missing_content: ::Foreman::Cast.to_bool(params[:fail_on_missing_content]))
44
44
  respond_for_async :resource => tasks
@@ -29,15 +29,15 @@ module Katello
29
29
  api :POST, "/content_exports/version", N_("Performs a full-export of a content view version.")
30
30
  param :id, :number, :desc => N_("Content view version identifier"), :required => true
31
31
  param :destination_server, String, :desc => N_("Destination Server name"), :required => false
32
- param :chunk_size_mb, :number, :desc => N_("Split the exported content into archives "\
33
- "no greater than the specified size in megabytes."), :required => false
32
+ param :chunk_size_gb, :number, :desc => N_("Split the exported content into archives "\
33
+ "no greater than the specified size in gigabytes."), :required => false
34
34
  param :fail_on_missing_content, :bool, :desc => N_("Fails if any of the repositories belonging to this version"\
35
35
  " are unexportable. False by default."), :required => false
36
36
  def version
37
37
  tasks = async_task(::Actions::Katello::ContentViewVersion::Export,
38
38
  content_view_version: @version,
39
39
  destination_server: params[:destination_server],
40
- chunk_size: params[:chunk_size_mb],
40
+ chunk_size: params[:chunk_size_gb],
41
41
  fail_on_missing_content: ::Foreman::Cast.to_bool(params[:fail_on_missing_content]))
42
42
  respond_for_async :resource => tasks
43
43
  end
@@ -45,15 +45,15 @@ module Katello
45
45
  api :POST, "/content_exports/library", N_("Performs a full-export of the repositories in library.")
46
46
  param :organization_id, :number, :desc => N_("Organization identifier"), :required => true
47
47
  param :destination_server, String, :desc => N_("Destination Server name"), :required => false
48
- param :chunk_size_mb, :number, :desc => N_("Split the exported content into archives "\
49
- "no greater than the specified size in megabytes."), :required => false
48
+ param :chunk_size_gb, :number, :desc => N_("Split the exported content into archives "\
49
+ "no greater than the specified size in gigabytes."), :required => false
50
50
  param :fail_on_missing_content, :bool, :desc => N_("Fails if any of the repositories belonging to this organization"\
51
51
  " are unexportable. False by default."), :required => false
52
52
  def library
53
53
  tasks = async_task(::Actions::Pulp3::Orchestration::ContentViewVersion::ExportLibrary,
54
54
  @organization,
55
55
  destination_server: params[:destination_server],
56
- chunk_size: params[:chunk_size_mb],
56
+ chunk_size: params[:chunk_size_gb],
57
57
  fail_on_missing_content: ::Foreman::Cast.to_bool(params[:fail_on_missing_content]))
58
58
  respond_for_async :resource => tasks
59
59
  end
@@ -13,7 +13,7 @@ module Katello
13
13
  .where(organization_id: registration_params[:organization_id])
14
14
  .order(:name)
15
15
 
16
- data = { activationKeys: aks, lifeCycleEnvironments: lces }
16
+ data = { activationKeys: aks, lifecycleEnvironments: lces }
17
17
 
18
18
  if registration_params[:hostgroup_id].present?
19
19
  host_group = ::Hostgroup.authorized(:view_hostgroups).find(registration_params[:hostgroup_id])
@@ -135,6 +135,14 @@ module Actions
135
135
  rescue ::Katello::Errors::CapsuleCannotBeReached # skip any capsules that cannot be connected to
136
136
  end
137
137
 
138
+ def content_view_version_id
139
+ input['content_view_version_id']
140
+ end
141
+
142
+ def content_view_version_name
143
+ input['content_view_version_name']
144
+ end
145
+
138
146
  private
139
147
 
140
148
  def include_other_components(override_components, content_view)
@@ -190,14 +198,6 @@ module Actions
190
198
  end
191
199
  end
192
200
 
193
- def content_view_version_id
194
- input['content_view_version_id']
195
- end
196
-
197
- def content_view_version_name
198
- input['content_view_version_name']
199
- end
200
-
201
201
  apipie :class, "A class representing #{self} object" do
202
202
  desc 'This object is available as **@object** variable in
203
203
  webhook templates when a corresponding event occures.
@@ -30,7 +30,8 @@ module Actions
30
30
  destination_server: destination_server,
31
31
  from_content_view_version: from_content_view_version)
32
32
  export_service.validate!(fail_on_missing_content: fail_on_missing_content,
33
- validate_incremental: validate_incremental)
33
+ validate_incremental: validate_incremental,
34
+ chunk_size: chunk_size)
34
35
 
35
36
  action_output = plan_action(::Actions::Pulp3::ContentViewVersion::CreateExporter,
36
37
  content_view_version_id: content_view_version.id,
@@ -209,9 +209,11 @@ module Katello
209
209
  search = [search_up_to, search_since, search_result].compact.join(' and ')
210
210
 
211
211
  if Katello.with_remote_execution?
212
- condition = ["state != 'stopped' AND (label = 'Actions::RemoteExecution::RunHostJob' AND templates.id = ?) OR label = 'Actions::Katello::Host::Erratum::Install'", RemoteExecutionFeature.feature('katello_errata_install').job_template_id]
212
+ condition = ["state = 'stopped' AND ((label = 'Actions::RemoteExecution::RunHostJob' AND templates.id = ?) " \
213
+ "OR label = 'Actions::Katello::Host::Erratum::Install' OR label = 'Actions::Katello::Host::Erratum::ApplicableErrataInstall')",
214
+ RemoteExecutionFeature.feature('katello_errata_install').job_template_id]
213
215
  else
214
- condition = "state != 'stopped' AND label = 'Actions::Katello::Host::Erratum::Install'"
216
+ condition = "state = 'stopped' AND (label = 'Actions::Katello::Host::Erratum::Install' OR label = 'Actions::Katello::Host::Erratum::ApplicableErrataInstall')"
215
217
  end
216
218
 
217
219
  tasks = load_resource(klass: ForemanTasks::Task,
@@ -219,19 +221,20 @@ module Katello
219
221
  permission: 'view_foreman_tasks',
220
222
  joins: 'LEFT OUTER JOIN template_invocations ON foreman_tasks_tasks.id = template_invocations.run_host_job_task_id LEFT OUTER JOIN templates ON template_invocations.template_id = templates.id',
221
223
  select: 'foreman_tasks_tasks.*,template_invocations.id AS template_invocation_id',
222
- search: search
223
- )
224
+ search: search)
224
225
  only_host_ids = ::Host.search_for(host_filter).pluck(:id) if host_filter
225
226
 
226
227
  # batch of 1_000 records
227
228
  tasks.each do |batch|
229
+ @_tasks_input = {}
228
230
  @_tasks_errata_cache = {}
229
231
  seen_errata_ids = []
230
232
  seen_host_ids = []
231
233
 
232
234
  batch.each do |task|
235
+ next if skip_task?(task)
233
236
  seen_errata_ids = (seen_errata_ids + parse_errata(task)).uniq
234
- seen_host_ids << task.input['host']['id'].to_i if include_last_reboot == 'yes'
237
+ seen_host_ids << get_task_input(task)['host']['id'].to_i if include_last_reboot == 'yes'
235
238
  end
236
239
  seen_host_ids &= only_host_ids if only_host_ids
237
240
 
@@ -240,6 +243,7 @@ module Katello
240
243
  preloaded_hosts = ::Host.where(:id => seen_host_ids).includes(:reported_data)
241
244
 
242
245
  batch.each do |task|
246
+ next if skip_task?(task)
243
247
  next if !only_host_ids.nil? && only_host_ids.include?(task.input['host']['id'].to_i)
244
248
  parse_errata(task).each do |erratum_id|
245
249
  current_erratum_errata_type = preloaded_errata.find { |k, _| k == erratum_id }.last
@@ -250,14 +254,15 @@ module Katello
250
254
 
251
255
  hash = {
252
256
  :date => task.ended_at,
253
- :hostname => task.input['host']['name'],
257
+ :hostname => get_task_input(task)['host']['name'],
254
258
  :erratum_id => erratum_id,
255
259
  :erratum_type => current_erratum_errata_type,
256
260
  :status => task.result
257
261
  }
258
262
 
259
263
  if include_last_reboot == 'yes'
260
- hash[:last_reboot_time] = preloaded_hosts.find { |k, _| k.id == task.input['host']['id'] }.uptime_seconds&.seconds&.ago
264
+ # It is possible that we can't find the host if it has been deleted.
265
+ hash[:last_reboot_time] = preloaded_hosts.find { |k, _| k.id == get_task_input(task)['host']['id'].to_i }&.uptime_seconds&.seconds&.ago
261
266
  end
262
267
 
263
268
  result << hash
@@ -289,14 +294,29 @@ module Katello
289
294
  host.subscription_facet
290
295
  end
291
296
 
297
+ def skip_task?(task)
298
+ # Skip task that doesn't apply errata
299
+ input = get_task_input(task)
300
+ input.blank? || input['host'].blank?
301
+ end
302
+
303
+ def get_task_input(task)
304
+ @_tasks_input[task.id] ||= if task.label == 'Actions::Katello::Host::Erratum::ApplicableErrataInstall'
305
+ task.execution_plan_action.all_planned_actions(Actions::Katello::Host::Erratum::Install).first.try(:input) || {}
306
+ else
307
+ task.input
308
+ end
309
+ end
310
+
292
311
  def parse_errata(task)
293
- @_tasks_errata_cache[task.id] ||= if task.input['errata'].present?
294
- # katello agent errata
295
- task.input['errata']
296
- else
297
- # rex errata
298
- TemplateInvocationInputValue.where(:template_invocation_id => task.template_invocation_id).limit(1).pluck(:value).first.split(',')
299
- end
312
+ task_input = get_task_input(task)
313
+ agent_input = task_input['errata'] || task_input['content']
314
+ # Pick katello agent errata if present
315
+ # Otherwise pick rex errata. There are multiple template inputs, such as errata, pre_script and post_script we only need the
316
+ # errata input here.
317
+ @_tasks_errata_cache[task.id] ||= agent_input.presence || TemplateInvocationInputValue.joins(:template_input)
318
+ .where("template_invocation_id = ? AND template_inputs.name = ?", task.template_invocation_id, 'errata')
319
+ .first.value.split(',')
300
320
  end
301
321
  end
302
322
  end
@@ -66,17 +66,7 @@ module Katello
66
66
 
67
67
  def print_debug_info(_a_path, headers = {}, payload = {})
68
68
  logger.debug "Headers: #{headers.to_json}"
69
- # calling to_json on file has side-effects breaking manifest import.
70
- # this fix prevents this problem
71
- payload_to_print = payload.reduce({}) do |h, (k, v)|
72
- h[k] = case v
73
- when File then "{{file}}"
74
- else v
75
- end
76
- end
77
- logger.debug "Body: #{filter_sensitive_data(payload_to_print.to_json)}"
78
- rescue
79
- logger.debug "Unable to print debug information"
69
+ logger.debug "Body: #{filter_sensitive_data(payload.to_json)}"
80
70
  end
81
71
 
82
72
  def get(a_path, headers = {})
@@ -121,7 +121,7 @@ module Katello
121
121
  facet_model = Facets.registered_facets[facet].hostgroup_configuration.model
122
122
  value = facet_model.where.not(attribute => nil).joins(:hostgroup).merge(
123
123
  ::Hostgroup.where(id: self.ancestor_ids).reorder(ancestry: :desc)
124
- ).limit(1).pluck(attribute)
124
+ ).limit(1).pluck(attribute).first
125
125
  end
126
126
  value
127
127
  end
@@ -58,8 +58,7 @@ module Katello
58
58
  def update_repository_proxy_details
59
59
  changes = self.previous_changes
60
60
  if changes.key?(:url) || changes.key?(:username) || changes.key?(:password)
61
-
62
- repos = repositories_with_proxy(id).uniq.collect(&:library_instance)
61
+ repos = ::Katello::Repository.where(root_id: repositories_with_proxy(id).pluck(:id)).where.not(remote_href: nil).where(library_instance_id: nil)
63
62
 
64
63
  unless repos.empty?
65
64
  ForemanTasks.async_task(
@@ -17,7 +17,7 @@ module Katello
17
17
 
18
18
  def update_global_proxies
19
19
  if saved_change_to_attribute?(:value) && name == 'content_default_http_proxy'
20
- repos = RootRepository.with_global_proxy.collect(&:library_instance).uniq
20
+ repos = ::Katello::Repository.joins(:root).merge(Katello::RootRepository.with_global_proxy).where.not(remote_href: nil).where(library_instance_id: nil)
21
21
 
22
22
  unless repos.empty?
23
23
  ForemanTasks.async_task(
@@ -3,18 +3,35 @@ module Katello
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  module ClassMethods
6
- def get_candlepin_ids(organization)
7
- self.get_for_owner(organization.label).map { |subscription| subscription["id"] }
6
+ def candlepin_records_by_id(organization)
7
+ records = get_for_owner(organization.label)
8
+ records_by_id = {}
9
+ records.each do |record|
10
+ records_by_id[record['id']] = record
11
+ end
12
+ records_by_id
8
13
  end
9
14
 
10
- def import_candlepin_ids(organization)
11
- candlepin_ids = self.get_candlepin_ids(organization)
12
- candlepin_ids.each do |cp_id|
13
- Katello::Util::Support.active_record_retry do
14
- self.where(:cp_id => cp_id, :organization_id => organization.id).first_or_create unless cp_id.nil?
15
- end
15
+ def import_candlepin_records(candlepin_objects, org)
16
+ candlepin_objects.each do |object|
17
+ import_candlepin_record(record: object, organization: org)
18
+ end
19
+ end
20
+
21
+ def import_candlepin_record(record:, organization:)
22
+ db_attrs = {
23
+ cp_id: record['id'],
24
+ organization: organization
25
+ }
26
+
27
+ yield(db_attrs) if block_given?
28
+
29
+ persisted = nil
30
+ Katello::Util::Support.active_record_retry do
31
+ persisted = self.where(db_attrs).first_or_create!
16
32
  end
17
- candlepin_ids
33
+
34
+ persisted
18
35
  end
19
36
 
20
37
  def with_identifier(ids)
@@ -32,11 +49,12 @@ module Katello
32
49
  organizations = organization ? [organization] : Organization.all
33
50
 
34
51
  organizations.each do |org|
35
- candlepin_ids = import_candlepin_ids(org)
52
+ candlepin_records = candlepin_records_by_id(org)
53
+ import_candlepin_records(candlepin_records.values, org)
36
54
 
37
55
  objects = self.in_organization(org)
38
56
  objects.each do |item|
39
- exists_in_candlepin = candlepin_ids.include?(item.cp_id)
57
+ exists_in_candlepin = candlepin_records.key?(item.cp_id)
40
58
 
41
59
  Katello::Logging.time("Imported #{self}", data: { cp_id: item.cp_id, destroyed: !exists_in_candlepin }) do
42
60
  if exists_in_candlepin
@@ -50,17 +50,21 @@ module Katello
50
50
  org = Organization.find_by(label: json['owner']['key'])
51
51
  fail("Organization with label #{json['owner']['key']} wasn't found while importing Candlepin pool") unless org
52
52
 
53
- subscription = determine_subscription(
54
- product_id: json['productId'],
55
- source_stack_id: json['sourceStackId'],
56
- organization: org
57
- )
58
-
59
- ::Katello::Util::Support.active_record_retry do
60
- pool = Katello::Pool.where(cp_id: cp_pool_id, organization: org, subscription: subscription).first_or_create!
61
- pool.backend_data = json
62
- pool.import_data(index_hosts)
63
- end
53
+ pool = import_candlepin_record(record: json, organization: org)
54
+ pool.backend_data = json
55
+ pool.import_data(index_hosts)
56
+ end
57
+ end
58
+
59
+ def import_candlepin_record(record:, organization:)
60
+ subscription = determine_subscription(
61
+ product_id: record['productId'],
62
+ source_stack_id: record['sourceStackId'],
63
+ organization: organization
64
+ )
65
+
66
+ super do |attrs|
67
+ attrs[:subscription] = subscription
64
68
  end
65
69
  end
66
70
 
@@ -24,8 +24,8 @@ module Katello
24
24
  scope :upstream, -> { where.not(upstream_pool_id: nil) }
25
25
  scope :redhat, -> { joins(:products).merge(Katello::Product.redhat).distinct }
26
26
 
27
- include Glue::Candlepin::Pool
28
27
  include Glue::Candlepin::CandlepinObject
28
+ include Glue::Candlepin::Pool
29
29
 
30
30
  scoped_search :on => :cp_id, :complete_value => true, :rename => :id, :only_explicit => true
31
31
  scoped_search :on => :upstream_pool_id, :complete_value => true, :only_explicit => true
@@ -53,7 +53,7 @@ module Katello
53
53
 
54
54
  def create_export(exporter_href, chunk_size: nil)
55
55
  options = { versions: version_hrefs }
56
- options[:chunk_size] = "#{chunk_size}MB" if chunk_size
56
+ options[:chunk_size] = "#{chunk_size}GB" if chunk_size
57
57
  if from_content_view_version
58
58
  from_exporter = Export.new(smart_proxy: smart_proxy, content_view_version: from_content_view_version)
59
59
  start_versions = from_exporter.version_hrefs
@@ -91,9 +91,18 @@ module Katello
91
91
  api.exporter_api.delete(exporter_href)
92
92
  end
93
93
 
94
- def validate!(fail_on_missing_content: true, validate_incremental: true)
94
+ def validate_chunk_size(size)
95
+ return if size.blank?
96
+
97
+ unless size.is_a?(Numeric) && size > 0 && size < 1e6
98
+ fail _("Specify an export chunk size less than 1_000_000 GB")
99
+ end
100
+ end
101
+
102
+ def validate!(fail_on_missing_content: true, validate_incremental: true, chunk_size: nil)
95
103
  validate_repositories_immediate! if fail_on_missing_content
96
104
  validate_incremental_export! if validate_incremental && !from_content_view_version.blank?
105
+ validate_chunk_size(chunk_size)
97
106
  end
98
107
 
99
108
  def validate_repositories_immediate!
@@ -136,7 +136,10 @@ module Katello
136
136
  def remote_needs_updates?
137
137
  if repo.remote_href
138
138
  remote = get_remote
139
- computed = compute_remote_options
139
+ # The proxy auth creds are not returned by the Pulp API.
140
+ # The creds don't need to be checked here because they
141
+ # won't be updated outside of UpdateRemote.
142
+ computed = compute_remote_options.slice!(:proxy_username, :proxy_password)
140
143
  computed.keys.any? { |key| remote.send(key) != computed[key] }
141
144
  elsif repo.url
142
145
  true
@@ -348,7 +351,9 @@ module Katello
348
351
  tls_validation: root.verify_ssl_on_sync,
349
352
  name: generate_backend_object_name,
350
353
  url: root.url,
351
- proxy_url: root.http_proxy&.full_url,
354
+ proxy_url: root.http_proxy&.url,
355
+ proxy_username: root.http_proxy&.username,
356
+ proxy_password: root.http_proxy&.password,
352
357
  total_timeout: Setting[:sync_connect_timeout]
353
358
  }
354
359
  remote_options[:url] = root.url unless root.url.blank?
@@ -27,8 +27,7 @@ module Katello
27
27
  popts = super(repository_version)
28
28
  popts.merge!(
29
29
  {
30
- # structured is not necessary for subscription-manager
31
- #structured: true, # publish real suites (e.g. 'stable')
30
+ structured: true, # publish real suites (e.g. 'stable')
32
31
  simple: true # publish all into 'default'-suite
33
32
  }
34
33
  )
@@ -25,10 +25,6 @@ angular.module('Bastion.activation-keys').controller('ActivationKeyDetailsInfoCo
25
25
 
26
26
  $scope.environments = Organization.readableEnvironments({id: CurrentOrganization});
27
27
 
28
- $scope.$on('activationKey.loaded', function () {
29
- $scope.originalEnvironment = $scope.activationKey.environment;
30
- });
31
-
32
28
  $scope.$watch('activationKey.environment', function (environment) {
33
29
  if ($scope.originalEnvironment) {
34
30
  if (environment) {
@@ -63,8 +59,7 @@ angular.module('Bastion.activation-keys').controller('ActivationKeyDetailsInfoCo
63
59
  $scope.editContentView = false;
64
60
  $scope.editEnvironment = false;
65
61
  $scope.save(activationKey).then(function (actKey) {
66
- $scope.originalEnvironment = actKey.environment;
67
- $scope.resetEnvironmentPathSelector(activationKey);
62
+ $scope.resetEnvironmentPathSelector(actKey);
68
63
  });
69
64
  $scope.disableEnvironmentSelection = false;
70
65
  };
@@ -52,8 +52,8 @@ angular.module('Bastion.activation-keys').controller('ActivationKeyDetailsContro
52
52
  };
53
53
 
54
54
  $scope.activationKey = ActivationKey.get({id: $scope.$stateParams.activationKeyId}, function (activationKey) {
55
- $scope.$broadcast('activationKey.loaded', activationKey);
56
55
  $scope.panel.loading = false;
56
+ $scope.originalEnvironment = activationKey.environment;
57
57
  }, function (response) {
58
58
  $scope.panel.loading = false;
59
59
  ApiErrorHandler.handleGETRequestErrors(response, $scope);
@@ -64,6 +64,7 @@ angular.module('Bastion.activation-keys').controller('ActivationKeyDetailsContro
64
64
 
65
65
  activationKey.$update(function (response) {
66
66
  deferred.resolve(response);
67
+ $scope.originalEnvironment = activationKey.environment;
67
68
  Notification.setSuccessMessage(translate('Activation Key updated'));
68
69
  }, function (response) {
69
70
  deferred.reject(response);
@@ -13,7 +13,7 @@
13
13
  </div>
14
14
 
15
15
  <nav data-block="item-actions">
16
- <button type="button" class="btn btn-primary" ng-hide="denied('publish_content_views', contentView) || contentView.import_only"
16
+ <button type="button" class="btn btn-primary" ng-hide="denied('publish_content_views', contentView) || contentView.import_only"
17
17
  ui-sref="content-view.publish">
18
18
  <span translate>Publish New Version</span>
19
19
  </button>
@@ -4,27 +4,18 @@ namespace :katello do
4
4
  class BackendCleaner
5
5
  def initialize
6
6
  @candlepin_uuids = []
7
- @pulp_uuids = []
8
7
  @katello_candlepin_uuids = []
9
- @katello_pulp_uuids = []
10
8
  end
11
9
 
12
10
  def populate!
13
11
  @candlepin_uuids = Katello::Resources::Candlepin::Consumer.all_uuids
14
12
  @katello_candlepin_uuids = Katello::Host::SubscriptionFacet.pluck(:uuid).compact
15
-
16
- @pulp_uuids = ::Katello.pulp_server.extensions.consumer.retrieve_all.map { |consumer| consumer['id'] }
17
- @katello_pulp_uuids = Katello::Host::ContentFacet.pluck(:uuid).compact
18
13
  end
19
14
 
20
15
  def hosts_with_no_subscriptions
21
16
  ::Host.where(:id => Katello::Host::SubscriptionFacet.where(:uuid => @katello_candlepin_uuids - @candlepin_uuids).select(:host_id))
22
17
  end
23
18
 
24
- def hosts_with_no_content
25
- ::Host.where(:id => Katello::Host::ContentFacet.where(:uuid => @katello_pulp_uuids - @pulp_uuids).select(:host_id))
26
- end
27
-
28
19
  def hosts_with_nil_facets
29
20
  nil_sub = Katello::Host::SubscriptionFacet.where(:uuid => nil).select(:host_id).to_sql
30
21
  ::Host.where(" id in (#{nil_sub})")
@@ -33,10 +24,6 @@ namespace :katello do
33
24
  def cp_orphaned_host_uuids
34
25
  @candlepin_uuids - @katello_candlepin_uuids
35
26
  end
36
-
37
- def pulp_orphaned_host_uuids
38
- @pulp_uuids - @katello_pulp_uuids
39
- end
40
27
  end
41
28
 
42
29
  def cleanup_hosts(cleaner)
@@ -49,11 +36,6 @@ namespace :katello do
49
36
  print "Host #{host.id} #{host.name} #{host.subscription_facet.try(:uuid)} is partially missing subscription information. Un-registering\n"
50
37
  execute("Failed to delete host") { Katello::RegistrationManager.unregister_host(host, host_unregister_options(host)) }
51
38
  end
52
-
53
- cleaner.hosts_with_no_content.each do |host|
54
- print "Host #{host.id} #{host.name} #{host.content_facet.try(:uuid)} is partially missing content information. Un-registering\n"
55
- execute("Failed to delete host") { Katello::RegistrationManager.unregister_host(host, host_unregister_options(host)) }
56
- end
57
39
  end
58
40
 
59
41
  def clean_backend_orphans(cleaner)
@@ -63,13 +45,6 @@ namespace :katello do
63
45
  cp_uuids.each do |consumer_id|
64
46
  execute("exception when destroying candlepin consumer #{consumer_id}") { Katello::Resources::Candlepin::Consumer.destroy(consumer_id) }
65
47
  end
66
-
67
- pulp_uuids = cleaner.pulp_orphaned_host_uuids
68
- print "#{pulp_uuids.count} orphaned consumer id(s) found in pulp.\n"
69
- print "Pulp orphaned consumers: #{pulp_uuids}\n"
70
- pulp_uuids.each do |consumer_id|
71
- execute("exception when destroying pulp consumer #{consumer_id}") { Katello.pulp_server.extensions.consumer.delete(consumer_id) }
72
- end
73
48
  end
74
49
 
75
50
  def host_unregister_options(host)
@@ -1,3 +1,3 @@
1
1
  module Katello
2
- VERSION = "4.1.0.rc1.1".freeze
2
+ VERSION = "4.1.0.rc2".freeze
3
3
  end
@@ -24,7 +24,7 @@ const RoutedTabs = ({
24
24
  if (matchedTab) {
25
25
  history.push(buildLink(matchedTab.key));
26
26
  } else {
27
- history.push(buildLink(tabs[defaultTabIndex].key)); // go to first tab if no tab selected
27
+ history.replace(buildLink(tabs[defaultTabIndex].key)); // go to first tab if no tab selected
28
28
  }
29
29
  };
30
30
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katello
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0.rc1.1
4
+ version: 4.1.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - N/A
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-17 00:00:00.000000000 Z
11
+ date: 2021-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -140,16 +140,16 @@ dependencies:
140
140
  name: qpid_proton
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ">="
143
+ - - "<"
144
144
  - !ruby/object:Gem::Version
145
- version: '0'
145
+ version: '0.34'
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ">="
150
+ - - "<"
151
151
  - !ruby/object:Gem::Version
152
- version: '0'
152
+ version: '0.34'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: stomp
155
155
  requirement: !ruby/object:Gem::Requirement