katello 3.14.0 → 3.14.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: 4753e9076eca5c39d6930c003dd67a5cbd01bbbd97b47bef6e81a74d6e576ceb
4
- data.tar.gz: 561e374445d3f901344a42d4e08701b8bd5d48ce57802bb477a296959ccfc0f3
3
+ metadata.gz: 40ea2dd0117ec5d25205f3868df5ebcb700767dcc7a6eda96f6aa2c30c0c7da3
4
+ data.tar.gz: 2084af6536db98b8525ec9c790bd00b8c3186897a469716d4bf2b52b36057ae0
5
5
  SHA512:
6
- metadata.gz: 8741afc15f04b339ca2fd45f537bea05e9ae8bc1b5de956620702781cda16ca95d64cb88641dd2118a4247585d656d0075738af58ddca50e959d123482ccd29d
7
- data.tar.gz: b18ce1b57e91ca577393412f27f20718683abbc1f53ed3645e9df47c3bd762f63f0221b5b1a118b3101d0f4cbe1ee69a4a65cba460a76f33cb92d2411c43eaec
6
+ metadata.gz: 38b703df376f2b4dadbbbfc64aac8a399de28e4cb39762bffd6c3d126dc110f89e7b1bb6ea9d925e31b8ee33ea72386ba3db2e47ce18e5830b764eb663d49d46
7
+ data.tar.gz: 38234d68e96fd389181b11533e1705b3558b0fa4bd198a37da14ddea4074511d06e5698d6f9bd6611065500d49a4bfcd3bb411fbc33e7c4c6cb7e2a25c85ad44
@@ -49,15 +49,9 @@ module Katello
49
49
  activation_key.organization = @organization
50
50
  activation_key.user = current_user
51
51
  end
52
- sync_task(::Actions::Katello::ActivationKey::Create, @activation_key)
52
+ sync_task(::Actions::Katello::ActivationKey::Create, @activation_key, service_level: activation_key_params['service_level'])
53
53
  @activation_key.reload
54
54
 
55
- sync_task(::Actions::Katello::ActivationKey::Update, @activation_key,
56
- :service_level => activation_key_params[:service_level],
57
- :release_version => activation_key_params[:release_version],
58
- :auto_attach => activation_key_params[:auto_attach]
59
- )
60
-
61
55
  respond_for_create(:resource => @activation_key)
62
56
  end
63
57
 
@@ -4,6 +4,8 @@ module Actions
4
4
  input_format do
5
5
  param :organization_label
6
6
  param :auto_attach
7
+ param :service_level
8
+ param :release_version
7
9
  param :purpose_role
8
10
  param :purpose_usage
9
11
  param :purpse_addons
@@ -13,6 +15,8 @@ module Actions
13
15
  output[:response] = ::Katello::Resources::Candlepin::ActivationKey.create(::Katello::Util::Model.uuid,
14
16
  input[:organization_label],
15
17
  input[:auto_attach],
18
+ input[:service_level],
19
+ input[:release_version],
16
20
  input[:purpose_role],
17
21
  input[:purpose_usage],
18
22
  input[:purpose_addons])
@@ -2,12 +2,14 @@ module Actions
2
2
  module Katello
3
3
  module ActivationKey
4
4
  class Create < Actions::EntryAction
5
- def plan(activation_key)
5
+ def plan(activation_key, params = {})
6
6
  activation_key.save!
7
7
  if ::SETTINGS[:katello][:use_cp]
8
8
  cp_create = plan_action(Candlepin::ActivationKey::Create,
9
9
  organization_label: activation_key.organization.label,
10
10
  auto_attach: activation_key.auto_attach,
11
+ service_level: params[:service_level],
12
+ release_version: activation_key.release_version,
11
13
  purpose_role: activation_key.purpose_role,
12
14
  purpose_usage: activation_key.purpose_usage,
13
15
  purpose_addons: activation_key.purpose_addons.pluck(:name))
@@ -10,9 +10,20 @@ module Katello
10
10
  ::Katello::Util::Data.array_with_indifferent_access akeys
11
11
  end
12
12
 
13
- def create(name, owner_key, auto_attach, purpose_role, purpose_usage, purpose_addons)
13
+ # rubocop:disable Metrics/ParameterLists
14
+ def create(name, owner_key, auto_attach, service_level, release_version, purpose_role, purpose_usage, purpose_addons)
14
15
  url = "/candlepin/owners/#{owner_key}/activation_keys"
15
- JSON.parse(self.post(url, {:name => name, :autoAttach => auto_attach, :role => purpose_role, :usage => purpose_usage, :addOns => purpose_addons}.to_json, self.default_headers).body).with_indifferent_access
16
+ params = {
17
+ name: name,
18
+ autoAttach: auto_attach,
19
+ serviceLevel: service_level,
20
+ releaseVer: release_version,
21
+ role: purpose_role,
22
+ usage: purpose_usage,
23
+ addOns: purpose_addons
24
+ }
25
+ response = self.post(url, params.to_json, self.default_headers)
26
+ JSON.parse(response.body).with_indifferent_access
16
27
  end
17
28
 
18
29
  # rubocop:disable Metrics/ParameterLists
@@ -72,8 +72,12 @@ module Katello
72
72
 
73
73
  def create_unlimited_subscription(owner_key, product_id, start_date)
74
74
  start_date ||= Time.now
75
- # End it 100 years from now
76
- end_date ||= start_date + 10_950.days
75
+
76
+ # Subscription-manager (python-rhsm) can't read the certificate with end date beyond
77
+ # 2049 year correctly. Refer the links below for more details:
78
+ # https://bugzilla.redhat.com/show_bug.cgi?id=1789654
79
+ # https://github.com/candlepin/candlepin/blob/5b87865f304555c112982af4fbc83a1c463d37b2/server/src/main/java/org/candlepin/model/UeberCertificateGenerator.java#L247
80
+ end_date = Time.parse('2049-12-01 00:00:00 +0000')
77
81
 
78
82
  pool = {
79
83
  'startDate' => start_date,
@@ -78,12 +78,12 @@ module Katello
78
78
  logger.error(e.message)
79
79
  logger.error("Lost database connection. Attempting reconnect.")
80
80
 
81
- active_record_retry_connect
81
+ active_record_retry_connect(logger)
82
82
 
83
83
  retry
84
84
  end
85
85
 
86
- def self.active_record_retry_connect
86
+ def self.active_record_retry_connect(logger)
87
87
  sleep 3
88
88
  ActiveRecord::Base.connection.reconnect!
89
89
  rescue
@@ -66,7 +66,7 @@ module Katello
66
66
  end
67
67
 
68
68
  def os_release_name(os_name)
69
- if os_name.match(::Operatingsystem::FAMILIES['Debian'])
69
+ if os_name&.match(::Operatingsystem::FAMILIES['Debian'])
70
70
  facts['distribution.id']&.split&.first&.downcase
71
71
  end
72
72
  end
@@ -152,6 +152,10 @@ module Katello
152
152
  'Debian'
153
153
  elsif name =~ /ubuntu/
154
154
  'Ubuntu'
155
+ elsif name =~ /oracle/
156
+ 'OracleLinux'
157
+ else
158
+ 'Unknown'
155
159
  end
156
160
  end
157
161
  end
@@ -9,7 +9,9 @@ module Katello
9
9
  error = nil
10
10
  status = nil
11
11
  loop do
12
- check_services(error, status)
12
+ Rails.application.executor.wrap do
13
+ check_services(error, status)
14
+ end
13
15
  sleep 15
14
16
  end
15
17
  end
@@ -21,7 +23,7 @@ module Katello
21
23
  rescue => error
22
24
  Rails.logger.error("Error occurred while pinging #{service_class}")
23
25
  Rails.logger.error(error.message)
24
- Rails.logger.error(error.backtrace.join('\n'))
26
+ Rails.logger.error(error.backtrace.join("\n"))
25
27
  ensure
26
28
  if error || !status&.dig(:running)
27
29
  begin
@@ -30,7 +32,7 @@ module Katello
30
32
  rescue => error
31
33
  Rails.logger.error("Error occurred while starting #{service_class}")
32
34
  Rails.logger.error(error.message)
33
- Rails.logger.error(error.backtrace.join('\n'))
35
+ Rails.logger.error(error.backtrace.join("\n"))
34
36
  ensure
35
37
  error = nil
36
38
  end
@@ -242,8 +242,7 @@ module Katello
242
242
  remove = clause_gen.remove_clause
243
243
  remove_clauses = {filters: {unit: remove}} if remove
244
244
  else
245
- non_modular_rpms = ::Katello::Rpm.in_repositories(repo).non_modular.pluck(:filename)
246
- copy_clauses = non_modular_rpms.blank? ? nil : {filters: {unit: ContentViewPackageFilter.generate_rpm_clauses(non_modular_rpms)}}
245
+ copy_clauses = {}
247
246
  remove_clauses = nil
248
247
  end
249
248
 
@@ -262,7 +262,7 @@ npm WARN unmet dependency /usr/lib/node_modules/block-stream requires inherits@'
262
262
  npm WARN unmet dependency undefined
263
263
  ```
264
264
 
265
- Running `sudo npm update -g phantomjs bower grunt-cli` should fix the issue.
265
+ Running `sudo npm update -g bower grunt-cli` should fix the issue.
266
266
 
267
267
  #### Fixing Dependency Errors ####
268
268
 
@@ -277,7 +277,7 @@ version of a component has been bumped.
277
277
  [See also *Installing a New Dependency*](#installing-a-new-dependency) as well as the related section
278
278
  [*Updating a New Dependency*](#updating-a-new-dependency)
279
279
 
280
- - `sudo npm update -g phantomjs bower grunt-cli`
280
+ - `sudo npm update -g bower grunt-cli`
281
281
  - `npm install`
282
282
  - `grunt bower:dev`
283
283
 
@@ -1,3 +1,3 @@
1
1
  module Katello
2
- VERSION = "3.14.0".freeze
2
+ VERSION = "3.14.1".freeze
3
3
  end
@@ -2,6 +2,7 @@ import thunk from 'redux-thunk';
2
2
  import Immutable from 'seamless-immutable';
3
3
  import configureMockStore from 'redux-mock-store';
4
4
  import { disableRepository, loadEnabledRepos } from '../enabled.js';
5
+ import { mock as mockApi } from '../../../../mockRequest';
5
6
  import {
6
7
  ENABLED_REPOSITORIES_REQUEST,
7
8
  DISABLE_REPOSITORY_REQUEST,
@@ -14,11 +15,13 @@ describe('RedHatRepositories enabled actions', () => {
14
15
  describe('disableRepository', () => {
15
16
  it('dispatches DISABLE_REPOSITORY_REQUEST', async () => {
16
17
  const mockRepo = { // don't need actual values because just checking that the action matches
17
- productId: null,
18
- contentId: null,
19
- basearch: null,
20
- releasever: null,
18
+ productId: 'some-product-id',
19
+ contentId: 'some-content-id',
20
+ basearch: 'some-base-search',
21
+ releasever: 'some-releasever',
21
22
  };
23
+ mockApi.onPut(`/products/${mockRepo.productId}/repository_sets/${mockRepo.contentId}/disable`).reply(200, []);
24
+
22
25
  await store.dispatch(disableRepository(mockRepo));
23
26
  expect(store.getActions()).toContainEqual({
24
27
  type: DISABLE_REPOSITORY_REQUEST,
@@ -28,6 +31,8 @@ describe('RedHatRepositories enabled actions', () => {
28
31
  });
29
32
  describe('loadEnabledRepos', () => {
30
33
  it('dispatches ENABLED_REPOSITORIES_REQUEST', async () => {
34
+ mockApi.onGet('/repositories').reply(200, []);
35
+
31
36
  await store.dispatch(loadEnabledRepos());
32
37
  expect(store.getActions()).toContainEqual({
33
38
  type: ENABLED_REPOSITORIES_REQUEST,
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.14.0
4
+ version: 3.14.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: 2019-12-10 00:00:00.000000000 Z
11
+ date: 2020-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails