katello 3.6.0.rc2 → 3.6.0

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: d376533486b2a2a64e867237c0519e9fd2920578
4
- data.tar.gz: 43ce0faa39c88c23ca900ae85d0f986603ba736b
3
+ metadata.gz: d939b0f76999c8b4811105c3b8357f5298ffe7fa
4
+ data.tar.gz: 1fa1c0d78c2d7ce024b3c8e640325d1c1bd53f4d
5
5
  SHA512:
6
- metadata.gz: 38aea3e72162444cc2d3766e2e610f30fd48dbdd8010683846a107d0c5100faec287b12f90ab1f83e2715d3dd2389e993476b4f557cdb27f826d5c0f2f897aa6
7
- data.tar.gz: 47d26d3b9b377c91d0ffd9a13f09ae37fee6296a267d0d6489bb4cb8551b899dc779736dbea07285c128d54cebec7d1e5cd9138ff6760ff51c10c649dfae2bda
6
+ metadata.gz: a0cb319515bb5a1d43219315259d27960b816dc5b25e7b24728976d070d906a07a5c8cb793e1b116084782544e52531154369f58ffc2135a55434f783adfb934
7
+ data.tar.gz: 0567cfcd54cfaa33133c1bdc999c7d2588c5dd9a1f7571d67dc48e1be34ef9816fbb8eadf2c6266c0b1aa42dd84d69dff50b4de02ab47a81dfd39208e2e249b1
@@ -165,10 +165,20 @@ module Katello
165
165
  end
166
166
  end
167
167
 
168
- def self.propose_existing_hostname(facts)
168
+ def self.propose_custom_fact(facts)
169
169
  setting_fact = Setting[:register_hostname_fact]
170
- if !setting_fact.blank? && !facts[setting_fact].blank? && ::Host.where(:name => setting_fact.downcase).any?
171
- name = facts[setting_fact]
170
+ only_use_custom_fact = Setting[:register_hostname_fact_strict_match]
171
+
172
+ if !setting_fact.blank? && !facts[setting_fact].blank?
173
+ if only_use_custom_fact || ::Host.where(:name => setting_fact.downcase).any?
174
+ facts[setting_fact]
175
+ end
176
+ end
177
+ end
178
+
179
+ def self.propose_existing_hostname(facts)
180
+ if propose_custom_fact(facts)
181
+ name = propose_custom_fact(facts)
172
182
  elsif ::Host.where(:name => facts['network.hostname'].downcase).any?
173
183
  name = facts['network.hostname']
174
184
  elsif !facts['network.fqdn'].blank? && ::Host.where(:name => facts['network.fqdn'].downcase).any?
@@ -4,24 +4,9 @@ module Katello
4
4
  Katello::RhsmFactName
5
5
  end
6
6
 
7
- def normalize(_facts)
8
- facts = super
7
+ def normalize(facts)
9
8
  facts = change_separator(facts)
10
- add_compose_facts(facts)
11
- end
12
-
13
- def add_compose_facts(facts)
14
- additional_keys = []
15
- facts.each_key do |fact_name|
16
- parts = fact_name.split(RhsmFactName::SEPARATOR)
17
- additional_keys += parts[0..-2].reduce([]) { |memo, part| memo << [memo.last, part].compact.join(RhsmFactName::SEPARATOR) }
18
- end
19
-
20
- # add the facts hierarchy to facts hash
21
- additional_keys.uniq.each do |key|
22
- facts[key] = nil
23
- end
24
- facts
9
+ super(facts)
25
10
  end
26
11
 
27
12
  def change_separator(facts)
@@ -65,6 +65,8 @@ class Setting::Content < Setting
65
65
  false, N_('Delete Host upon unregister')),
66
66
  self.set('register_hostname_fact', N_("When registering a host via subscription-manager, force use the specified fact (in the form of 'fact.fact')"),
67
67
  '', N_('Subscription manager name registration fact'), nil),
68
+ self.set('register_hostname_fact_strict_match', N_('If true, and register_hostname_fact is set and provided, registration will look for a new host by name only '\
69
+ 'using that fact, and will skip all hostname matching'), false, N_('Subscription manager name registration fact strict matching'), nil),
68
70
  self.set('erratum_install_batch_size', N_("Errata installed via katello-agent will be triggered in batches of this size. Set to 0 to install all errata in one batch."),
69
71
  0, N_('Erratum Install Batch Size')),
70
72
  self.set('default_location_subscribed_hosts',
@@ -53,6 +53,7 @@ module Katello
53
53
  host.content_facet = populate_content_facet(host, content_view_environment, host_uuid)
54
54
  host.subscription_facet = populate_subscription_facet(host, activation_keys, consumer_params, host_uuid)
55
55
  host.save! # the host has content and subscription facets at this point
56
+ create_initial_subscription_status(host)
56
57
 
57
58
  User.as_anonymous_admin do
58
59
  begin
@@ -94,6 +95,10 @@ module Katello
94
95
  destroy_host_record(host.id)
95
96
  end
96
97
 
98
+ def create_initial_subscription_status(host)
99
+ ::Katello::SubscriptionStatus.create!(:host => host, :status => ::Katello::SubscriptionStatus::UNKNOWN)
100
+ end
101
+
97
102
  def create_in_cp_and_pulp(host, content_view_environment, consumer_params, activation_keys)
98
103
  # if CP fails, nothing to clean up yet w.r.t. backend services
99
104
  cp_create = ::Katello::Resources::Candlepin::Consumer.create(content_view_environment.cp_id, consumer_params, activation_keys.map(&:cp_name))
@@ -102,7 +102,9 @@ angular.module('Bastion.content-hosts').controller('ContentHostsBulkErrataModalC
102
102
  formData.authenticityToken = $window.AUTH_TOKEN.replace(/&quot;/g, '');
103
103
  formData.remoteAction = 'errata_install';
104
104
  formData.errata = errataIds.join(',');
105
- formData.hostIds = selectedHosts.included.ids.join(',');
105
+ if (selectedHosts.included.ids) {
106
+ formData.hostIds = selectedHosts.included.ids.join(',');
107
+ }
106
108
  formData.search = selectedHosts.included.search;
107
109
  formData.customize = customize;
108
110
 
@@ -108,7 +108,7 @@
108
108
  <ul uib-dropdown-menu>
109
109
  <li>
110
110
  <a ui-sref="content-host.packages.actions" translate>
111
- Yum Actions
111
+ Actions
112
112
  </a>
113
113
  </li>
114
114
  <li>
@@ -11,7 +11,7 @@ module Katello
11
11
  )
12
12
  end
13
13
 
14
- initializer 'katello.mount_engine', :after => :build_middleware_stack do |app|
14
+ initializer 'katello.mount_engine', :before => :sooner_routes_load, :after => :build_middleware_stack do |app|
15
15
  app.routes_reloader.paths << "#{Katello::Engine.root}/config/routes/mount_engine.rb"
16
16
  end
17
17
 
@@ -141,7 +141,7 @@ module Katello
141
141
  app.config.autoload_paths += Dir["#{config.root}/app/views/foreman"]
142
142
  end
143
143
 
144
- initializer "katello.paths" do |app|
144
+ initializer "katello.paths", :before => :sooner_routes_load do |app|
145
145
  app.routes_reloader.paths << "#{Katello::Engine.root}/config/routes/api/v2.rb"
146
146
  app.routes_reloader.paths << "#{Katello::Engine.root}/config/routes/api/rhsm.rb"
147
147
  app.routes_reloader.paths.unshift("#{Katello::Engine.root}/config/routes/overrides.rb")
@@ -1,3 +1,3 @@
1
1
  module Katello
2
- VERSION = "3.6.0.rc2".freeze
2
+ VERSION = "3.6.0".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.6.0.rc2
4
+ version: 3.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - N/A
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-02 00:00:00.000000000 Z
11
+ date: 2018-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0.12'
89
+ version: 0.11.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0.12'
96
+ version: 0.11.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: dynflow
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -1490,7 +1490,6 @@ files:
1490
1490
  - db/migrate/20171120144843_add_repository_ignore_proxy.rb
1491
1491
  - db/migrate/20171211124439_add_uuid_index_to_katello_subscription_facets.rb
1492
1492
  - db/migrate/20180103230812_set_errata_updated_date.rb
1493
- - db/migrate/20180227094827_use_uuid_for_task_id.rb
1494
1493
  - db/seeds.d/101-locations.rb
1495
1494
  - db/seeds.d/102-organizations.rb
1496
1495
  - db/seeds.d/103-provisioning_templates.rb
@@ -2191,12 +2190,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
2191
2190
  version: '0'
2192
2191
  required_rubygems_version: !ruby/object:Gem::Requirement
2193
2192
  requirements:
2194
- - - ">"
2193
+ - - ">="
2195
2194
  - !ruby/object:Gem::Version
2196
- version: 1.3.1
2195
+ version: '0'
2197
2196
  requirements: []
2198
2197
  rubyforge_project:
2199
- rubygems_version: 2.4.6
2198
+ rubygems_version: 2.6.14.1
2200
2199
  signing_key:
2201
2200
  specification_version: 4
2202
2201
  summary: ''
@@ -1,26 +0,0 @@
1
- class UseUuidForTaskId < ActiveRecord::Migration[5.0]
2
- # PostgreSQL has a special column type for storing UUIDs.
3
- # Using this type instead of generic string should lead to having
4
- # smaller DB and possibly better overall performance.
5
- def up
6
- if on_postgresql?
7
- change_table :katello_content_view_histories do |t|
8
- t.change :task_id, :uuid, :using => 'task_id::uuid'
9
- end
10
- end
11
- end
12
-
13
- def down
14
- if on_postgresql?
15
- change_table :katello_content_view_histories do |t|
16
- t.change :task_id, :string, :null => true, :limit => 255
17
- end
18
- end
19
- end
20
-
21
- private
22
-
23
- def on_postgresql?
24
- ActiveRecord::Base.connection.adapter_name == 'PostgreSQL'
25
- end
26
- end