katello 2.4.0 → 2.4.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
  SHA1:
3
- metadata.gz: 8647c42c72655d45ce3cf7f9bda72dc62c401c48
4
- data.tar.gz: c6709516499c7a7c96844293f54c351c43ff4824
3
+ metadata.gz: 71f002d889e1ed307d9a97f9cc97266659b04591
4
+ data.tar.gz: 699bcc1ee8187e27816ef953d3b3a471e0820481
5
5
  SHA512:
6
- metadata.gz: 8936bc4233c21f4c3bbc180a2d97bda511cbd4fd217808a1f1fffe3b6fcba9ad63eab895168932a2520b91a56bce3d12e9e4809b8ba43e09f21ec00d1e6a4339
7
- data.tar.gz: 44fccd68dee21eb6cc317de904c674bf2dd7e766ea3e0bb16b24624e66c3f8eb71b111f206f3fc29dd49f9e2c21b67bb11f94ac04cb0533ef90a2b63f20712b6
6
+ metadata.gz: 8b2912f0372097ecb9364fbcdf0d4d7a8d62f46458a272b6bd0bc5f2ed849266283ef23b45f270e0ab568e60fe0cb3e159b21eb7cad604b09c9b740fa5f12f1f
7
+ data.tar.gz: 403cb22a72f122040550fdf5a309bf4e260545014c19ba8015126813c20e6127ff358866245bd57168a2e2d038ba53f0f4712a6ac1aaa5743962d8662b16d749
@@ -167,28 +167,33 @@ module Actions
167
167
  copy_outputs
168
168
  end
169
169
 
170
- def puppet_module_names(uuids)
171
- ::Katello::PuppetModule.id_search(uuids).map(&:name)
170
+ def puppet_module_names(ids)
171
+ find_puppet_modules(ids).pluck(:name).uniq
172
172
  end
173
173
 
174
174
  def remove_puppet_names(repo, names)
175
175
  plan_action(Pulp::Repository::RemovePuppetModule, :pulp_id => repo.pulp_id, :clauses => {:unit => {:name => {'$in' => names}}})
176
176
  end
177
177
 
178
- def copy_puppet_content(new_repo, puppet_module_uuids)
178
+ def copy_puppet_content(new_repo, puppet_module_ids)
179
179
  copy_outputs = []
180
- unless puppet_module_uuids.blank?
181
- remove_puppet_names(new_repo, puppet_module_names(puppet_module_uuids))
182
- copy_outputs = puppet_module_uuids.map { |uuid| copy_puppet_module(new_repo, uuid).output }
180
+ unless puppet_module_ids.blank?
181
+ remove_puppet_names(new_repo, puppet_module_names(puppet_module_ids))
182
+ copy_outputs = puppet_module_ids.map { |module_id| copy_puppet_module(new_repo, module_id).output }
183
183
  plan_action(Pulp::ContentViewPuppetEnvironment::IndexContent, id: new_repo.id)
184
184
  end
185
185
  copy_outputs
186
186
  end
187
187
 
188
- def copy_puppet_module(new_repo, uuid)
189
- possible_repos = ::Katello::PuppetModule.find(uuid).repositories.in_organization(new_repo.organization).in_default_view
188
+ def find_puppet_modules(ids)
189
+ ::Katello::PuppetModule.with_identifiers(ids)
190
+ end
191
+
192
+ def copy_puppet_module(new_repo, module_id)
193
+ puppet_module = find_puppet_modules([module_id]).first
194
+ possible_repos = puppet_module.repositories.in_organization(new_repo.organization).in_default_view
190
195
  plan_action(Pulp::Repository::CopyPuppetModule, :source_pulp_id => possible_repos.first.pulp_id,
191
- :target_pulp_id => new_repo.pulp_id, :clauses => {'unit_id' => uuid}, :include_result => true)
196
+ :target_pulp_id => new_repo.pulp_id, :clauses => {'unit_id' => puppet_module.uuid}, :include_result => true)
192
197
  end
193
198
 
194
199
  def plan_copy(action_class, source_repo, target_repo, clauses = nil, override_config = nil)
@@ -19,7 +19,7 @@ module Katello
19
19
  has_many :systems, :through => :system_activation_keys
20
20
 
21
21
  has_many :pools, :through => :pool_activation_keys, :class_name => "Katello::Pool"
22
- has_many :pool_activation_keys, :class_name => "Katello::PoolActivationKey", :dependent => :destroy, :inverse_of => :activation_keys
22
+ has_many :pool_activation_keys, :class_name => "Katello::PoolActivationKey", :dependent => :destroy, :inverse_of => :activation_key
23
23
 
24
24
  before_validation :set_default_content_view, :unless => :persisted?
25
25
 
@@ -64,10 +64,11 @@ module Katello
64
64
  lifecycle_environment = host.lifecycle_environment
65
65
 
66
66
  if content_view && lifecycle_environment
67
- Katello::Repository.where(:distribution_version => host.os.release,
68
- :distribution_arch => host.architecture.name,
69
- :distribution_bootable => true
70
- )
67
+ Katello::Repository.in_environment(lifecycle_environment).in_content_views([content_view]).
68
+ where(:distribution_version => host.os.release,
69
+ :distribution_arch => host.architecture.name,
70
+ :distribution_bootable => true
71
+ )
71
72
  else
72
73
  []
73
74
  end
@@ -42,13 +42,15 @@ module Katello
42
42
  end
43
43
 
44
44
  def humanized_action
45
- case self.task.label
45
+ case self.task.try(:label)
46
46
  when "Actions::Katello::ContentView::Publish"
47
47
  _("Published new version")
48
48
  when "Actions::Katello::ContentView::Promote"
49
49
  _("Promoted to %{environment}") % { :environment => self.environment.name }
50
50
  when "Actions::Katello::ContentView::Remove"
51
51
  _("Deleted from %{environment}") % { :environment => self.environment.name }
52
+ else
53
+ _("Unknown Action")
52
54
  end
53
55
  end
54
56
 
@@ -408,16 +408,8 @@ module Katello
408
408
  end
409
409
 
410
410
  def products
411
- all_products = []
412
-
413
- self.entitlements.each do |entitlement|
414
- pool = Katello::Pool.find_by_cp_id(entitlement['pool']['id'])
415
- Katello::Product.where(:cp_id => pool.product_id).each do |product|
416
- all_products << product
417
- end
418
- end
419
-
420
- return all_products
411
+ pool_ids = self.entitlements.map { |entitlement| entitlement['pool']['id'] }
412
+ Katello::Product.joins(:subscriptions => :pools).where("#{Katello::Pool.table_name}.cp_id" => pool_ids).enabled.uniq
421
413
  end
422
414
 
423
415
  def find_entitlement(pool_id)
@@ -121,7 +121,7 @@ module Katello
121
121
  end
122
122
 
123
123
  def self.in_organization(org)
124
- where(:environment_id => org.kt_environments)
124
+ where("#{Repository.table_name}.environment_id" => org.kt_environments.pluck("#{KTEnvironment.table_name}.id"))
125
125
  end
126
126
 
127
127
  def self.in_environment(env_id)
@@ -15,6 +15,8 @@
15
15
  # and development environments. Values can be overridden bellow.
16
16
  #
17
17
  common:
18
+ ssl_client_key: '/etc/pki/katello/private/abed.usersys.redhat.com-pulp-client.key'
19
+ ssl_client_cert: '/etc/pki/katello/certs/abed.usersys.redhat.com-pulp-client.crt'
18
20
  use_cp: # set to true/false if you want to override default
19
21
  use_pulp: # set to true/false if you want to override default
20
22
  use_elasticsearch: # set to true/false if you want to override default
@@ -1,3 +1,3 @@
1
1
  module Katello
2
- VERSION = "2.4.0"
2
+ VERSION = "2.4.1"
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: 2.4.0
4
+ version: 2.4.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: 2015-12-23 00:00:00.000000000 Z
11
+ date: 2016-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails