katello 3.17.0 → 3.17.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45f65da0c274cbc6976755a23d58f5eb77979dceea6cdcb118c1d6445f20b8ad
4
- data.tar.gz: c5c8d2e9e58744b2389f9910daadc9656040d37364edfb12f48f5f1f06bf1743
3
+ metadata.gz: d4911d03477352b7d0d1f70c1fe0aabf89a4203f925d11b06b09fb753cca4119
4
+ data.tar.gz: 0442bdaf70ac3842ccae4d639111cdbefabb4d3c6601292c789fd7184e4273d0
5
5
  SHA512:
6
- metadata.gz: 5ac6853c42e650e0a410e0f60b5c5a5f58d6d046142fb846fd39a37124a1a43222d0d22377881cf111c3a7984454ddc937f0fc0eeef6b5fb08fc3ac61630b80e
7
- data.tar.gz: 0c87277e1d4a316b374c2f30b86154a607e4619ee5069c1157f0fe3aa07126e6645591e7eba301eca661b230892f66c7d0bc21c3446ea4fb262b1622c8c4865e
6
+ metadata.gz: 93f259c486b6f6d766389c062a894ca2a77e46cebe0fa9d4b6cb00d3722cefbeffefc46d0836c4bfcb08979206517d1e586e10ae5de0b22049798f060626b32f
7
+ data.tar.gz: 61b4ea0699d961668d15ff3235d67e4bb8bb30e987166a8a8cf6a00444a827b19d63665842fccf3f65539e28ddf46c277b4b0c070321b6cfe4254921b483e629
@@ -9,8 +9,12 @@ module Actions
9
9
 
10
10
  def run
11
11
  input[:host_ids].each do |host_id|
12
- content_facet = ::Host.find(host_id).content_facet
13
- content_facet.calculate_and_import_applicability
12
+ content_facet = ::Katello::Host::ContentFacet.find_by_host_id(host_id)
13
+ if content_facet.present?
14
+ content_facet.calculate_and_import_applicability
15
+ else
16
+ Rails.logger.warn(_("Content Facet for host with id %s is non-existent. Skipping applicability calculation.") % host_id)
17
+ end
14
18
  end
15
19
  end
16
20
 
@@ -13,6 +13,8 @@ module Actions
13
13
  @hypervisors = input[:hypervisors]
14
14
  return unless @hypervisors
15
15
 
16
+ @duplicate_uuid_hypervisors = {}
17
+
16
18
  User.as_anonymous_admin do
17
19
  ActiveRecord::Base.transaction do
18
20
  load_resources
@@ -30,8 +32,16 @@ module Actions
30
32
  update_facts(uuid, host)
31
33
  end
32
34
  end
35
+
36
+ @duplicate_uuid_hypervisors.each do |hypervisor, existing_host|
37
+ fail _("Host creation was skipped for %s because it shares a BIOS UUID with %s. " \
38
+ "To report this hypervisor, override its dmi.system.uuid fact or set 'candlepin.use_system_uuid_for_matching' " \
39
+ "to 'true' in the Candlepin configuration." % [hypervisor[:name], existing_host.name])
40
+ end
33
41
  end
34
42
 
43
+ private
44
+
35
45
  def load_hosts_guests
36
46
  @hosts.each do |uuid, host|
37
47
  host.subscription_facet ||= host.build_subscription_facet(uuid: uuid)
@@ -81,6 +91,14 @@ module Actions
81
91
  @hypervisors.each do |hypervisor|
82
92
  next if @hosts.key?(hypervisor[:uuid])
83
93
 
94
+ created_host = new_hypervisors[hypervisor[:uuid]]
95
+ if created_host
96
+ # we've already created a host record for this duplicate hypervisor
97
+ # track it so we can message later, and continue processing the remaining hypervisors
98
+ @duplicate_uuid_hypervisors[hypervisor] = created_host
99
+ next
100
+ end
101
+
84
102
  duplicate_name, org = duplicate_name(hypervisor, @candlepin_attributes[hypervisor[:uuid]])
85
103
  new_hypervisors[hypervisor[:uuid]] = create_host_for_hypervisor(duplicate_name, org)
86
104
  end
@@ -14,7 +14,7 @@ module Actions
14
14
  content_view.repository_references.each do |repository_reference|
15
15
  repo = repository_reference.root_repository.library_instance
16
16
  #force pulp3 in case we've done migrations, but haven't switched over yet
17
- tasks << repo.backend_service(smart_proxy, true).delete(repository_reference.repository_href)
17
+ tasks << repo.backend_service(smart_proxy, true).delete_repository(repository_reference)
18
18
  end
19
19
  content_view.repository_references.destroy_all
20
20
 
@@ -8,7 +8,7 @@ module Actions
8
8
 
9
9
  def invoke_external_task
10
10
  repo = ::Katello::Repository.find(input[:repository_id])
11
- output[:response] = repo.backend_service(smart_proxy).delete
11
+ output[:response] = repo.backend_service(smart_proxy).delete_repository
12
12
  end
13
13
  end
14
14
  end
@@ -1,5 +1,4 @@
1
1
  require "pulpcore_client"
2
-
3
2
  module Katello
4
3
  module Pulp3
5
4
  class Repository
@@ -188,8 +187,9 @@ module Katello
188
187
  api.repositories_api.read(repository_reference.try(:repository_href))
189
188
  end
190
189
 
191
- def delete(href = repository_reference.try(:repository_href))
192
- repository_reference.try(:destroy)
190
+ def delete_repository(repo_reference = repository_reference)
191
+ href = repo_reference.try(:repository_href)
192
+ repo_reference.try(:destroy)
193
193
  ignore_404_exception { api.repositories_api.delete(href) } if href
194
194
  end
195
195
 
@@ -159,8 +159,7 @@ module Katello
159
159
 
160
160
  data_dup.config[i][:content] = leftover_units.pop(copy_amount)
161
161
  unit_copy_counter += copy_amount
162
- # Do copy call if limit is reached or if we're under the limit but on the last repo config.
163
- if unit_copy_counter >= UNIT_LIMIT || (i == data_dup.config.size - 1 && leftover_units.empty?)
162
+ if unit_copy_counter != 0
164
163
  tasks << api.copy_api.copy_content(data_dup)
165
164
  unit_copy_counter = 0
166
165
  end
@@ -1,3 +1,3 @@
1
1
  module Katello
2
- VERSION = "3.17.0".freeze
2
+ VERSION = "3.17.1".freeze
3
3
  end
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: 3.17.0
4
+ version: 3.17.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - N/A
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-06 00:00:00.000000000 Z
11
+ date: 2020-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails