katello 3.11.0.rc2 → 3.11.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
  SHA256:
3
- metadata.gz: 33692b74c9a55f4c19bfe2791e7b6ea3c9e480441f8e6069916702f12d061287
4
- data.tar.gz: 534f1a11e88cecf4a44218d51019cf2aaa567b310314c9dc415ab0b3e09ebd56
3
+ metadata.gz: 267be6055b2d210a259cba76847d38cdb98cfbe61c0cc2f0d621fae88f5f8c26
4
+ data.tar.gz: 7085283452d4f8069e69e0a469b3d3e665133a828d41358f900cd48a64903cc4
5
5
  SHA512:
6
- metadata.gz: 3bd83f58ccd7cc236b1de78e2c8004ad6a870791b9bb9cfc4b2051d5af29fe71d1df61a4cb177473a07c88fb057cd2703c247eaa909684332cd7b6bc3a848564
7
- data.tar.gz: 844f4cac7b5f9263c0b7a4c3883d1a53cf8fb73626860cda4ca94b66875022b5a60c8e25557442770700b6bfe58d5f661448bbb3371aa7779be1cb6b339f710d
6
+ metadata.gz: e88f9a1ae89d8f6924c624dca9e251cef617514c0ff5eb60b835b3aa8e8fc82ad2416ed0ae11f4c1c32999f675e1421a4e46d60cc311d087960ee2775e7d0e24
7
+ data.tar.gz: 7db70cea9f0ee0d5fea237fb50d58b76f76b966eea1c712f20d8f8ccd8d02cd2fd1c5ea8020499be81dfdf4351fb34cfecd05f6ab1c9e58b299f1990ea3479f9
@@ -125,7 +125,7 @@ module Katello
125
125
  @product_content = @product.product_content_by_id(params[:id])
126
126
  else
127
127
  content = Katello::Content.find_by(:cp_content_id => params[:id], :organization_id => @organization[:id])
128
- @product_content = Katello::ProductContent.find_by(:id => content[:id])
128
+ @product_content = Katello::ProductContent.find_by(:content_id => content.id)
129
129
  end
130
130
  fail HttpErrors::NotFound, _("Couldn't find repository set with id '%s'.") % params[:id] if @product_content.nil?
131
131
  @product = @product_content.product if @product.nil?
@@ -1,7 +1,7 @@
1
1
  module Actions
2
2
  module Pulp
3
3
  module Repository
4
- class Refresh < Pulp::Abstract
4
+ class Refresh < Pulp::AbstractAsyncTask
5
5
  input_format do
6
6
  param :capsule_id
7
7
  param :pulp_id
@@ -12,9 +12,13 @@ module Actions
12
12
  plan_self(:capsule_id => options[:capsule_id], :pulp_id => repository.pulp_id)
13
13
  end
14
14
 
15
- def run
15
+ def invoke_external_task
16
16
  repo = ::Katello::Repository.find_by(:pulp_id => input[:pulp_id])
17
- output[:results] = repo.backend_service(smart_proxy(input[:capsule_id])).refresh
17
+ if repo.nil?
18
+ repo = ::Katello::ContentViewPuppetEnvironment.find_by(:pulp_id => input[:pulp_id])
19
+ repo = repo.nonpersisted_repository
20
+ end
21
+ repo.backend_service(smart_proxy(input[:capsule_id])).refresh
18
22
  end
19
23
  end
20
24
  end
@@ -88,14 +88,19 @@ module Katello
88
88
  end
89
89
 
90
90
  def equivalent_kickstart_repository
91
- return unless operatingsystem && kickstart_repository
91
+ return unless operatingsystem &&
92
+ kickstart_repository &&
93
+ operatingsystem.respond_to?(:kickstart_repos)
92
94
  ks_repos = operatingsystem.kickstart_repos(self)
93
95
  ks_repos.find { |repo| repo[:name] == kickstart_repository.label }
94
96
  end
95
97
 
96
98
  def matching_kickstart_repository?
97
99
  return true unless operatingsystem
98
- operatingsystem.kickstart_repos(self).any? { |repo| repo[:id] == kickstart_repository_id }
100
+
101
+ if operatingsystem.respond_to? :kickstart_repos
102
+ return operatingsystem.kickstart_repos(self).any? { |repo| repo[:id] == kickstart_repository_id }
103
+ end
99
104
  end
100
105
 
101
106
  private
@@ -72,8 +72,9 @@ module Katello
72
72
 
73
73
  if content_view && lifecycle_environment && host.os && host.architecture
74
74
  Katello::Repository.in_environment(lifecycle_environment).in_content_views([content_view]).
75
- where(:distribution_version => host.os.release,
76
- :distribution_arch => host.architecture.name)
75
+ where(:distribution_arch => host.architecture.name).
76
+ where("#{Katello::Repository.table_name}.distribution_version = :release or #{Katello::Repository.table_name}.distribution_version like :match",
77
+ release: host.os.release, match: "#{host.os.release}.%")
77
78
  else
78
79
  []
79
80
  end
@@ -34,10 +34,6 @@ module Katello
34
34
  end
35
35
 
36
36
  module InstanceMethods
37
- def empty?
38
- return self.repos(library).empty?
39
- end
40
-
41
37
  def distributions(env)
42
38
  to_ret = []
43
39
  self.repos(env).each do |repo|
@@ -149,9 +149,10 @@ module Katello
149
149
  end
150
150
 
151
151
  def refresh
152
- update_or_associate_importer
153
- update_or_associate_distributors
154
- remove_unnecessary_distributors
152
+ tasks = update_or_associate_importer
153
+ tasks += update_or_associate_distributors
154
+ tasks += remove_unnecessary_distributors
155
+ tasks
155
156
  end
156
157
 
157
158
  def update_or_associate_importer
@@ -159,6 +160,7 @@ module Katello
159
160
  importer = generate_importer
160
161
  found = existing_importers.find { |i| i['importer_type_id'] == importer.id }
161
162
 
163
+ tasks = []
162
164
  if found
163
165
  ssl_ca_cert = importer.config.delete('ssl_ca_cert')
164
166
  ssl_client_cert = importer.config.delete('ssl_client_cert')
@@ -166,36 +168,40 @@ module Katello
166
168
  importer.config['basic_auth_username'] = nil if importer.config['basic_auth_username'].blank?
167
169
  importer.config['basic_auth_password'] = nil if importer.config['basic_auth_password'].blank?
168
170
  # Update ssl options by themselves workaround for https://pulp.plan.io/issues/2727
169
- smart_proxy.pulp_api.resources.repository.update_importer(repo.pulp_id, found['id'], :ssl_client_cert => ssl_client_cert,
171
+ tasks << smart_proxy.pulp_api.resources.repository.update_importer(repo.pulp_id, found['id'], :ssl_client_cert => ssl_client_cert,
170
172
  :ssl_client_key => ssl_client_key, :ssl_ca_cert => ssl_ca_cert)
171
- smart_proxy.pulp_api.resources.repository.update_importer(repo.pulp_id, found['id'], importer.config)
173
+ tasks << smart_proxy.pulp_api.resources.repository.update_importer(repo.pulp_id, found['id'], importer.config)
172
174
  else
173
- smart_proxy.pulp_api.resources.repository.associate_importer(repo.pulp_id, repo.importers.first['importer_type_id'], importer.config)
175
+ tasks << smart_proxy.pulp_api.resources.repository.associate_importer(repo.pulp_id, repo.importers.first['importer_type_id'], importer.config)
174
176
  end
177
+ tasks
175
178
  end
176
179
 
177
180
  def update_or_associate_distributors
181
+ tasks = []
178
182
  existing_distributors = backend_data["distributors"]
179
183
  generate_distributors.each do |distributor|
180
184
  found = existing_distributors.find { |i| i['distributor_type_id'] == distributor.type_id }
181
185
  if found
182
- smart_proxy.pulp_api.resources.repository.
183
- update_distributor(repo.pulp_id, found['id'], distributor.config)
186
+ tasks << smart_proxy.pulp_api.resources.repository.update_distributor(repo.pulp_id, found['id'], distributor.config)
184
187
  else
185
188
  smart_proxy.pulp_api.resources.repository.
186
189
  associate_distributor(repo.pulp_id, distributor.type_id, distributor.config, :distributor_id => distributor.id,
187
190
  :auto_publish => distributor.auto_publish)
188
191
  end
189
192
  end
193
+ tasks
190
194
  end
191
195
 
192
196
  def remove_unnecessary_distributors
197
+ tasks = []
193
198
  existing_distributors = backend_data["distributors"]
194
199
  generated_distributors = generate_distributors
195
200
  existing_distributors.each do |distributor|
196
201
  found = generated_distributors.find { |dist| dist.type_id == distributor['distributor_type_id'] }
197
- smart_proxy.pulp_api.resources.repository.delete_distributor(repo.pulp_id, distributor['id']) unless found
202
+ tasks << smart_proxy.pulp_api.resources.repository.delete_distributor(repo.pulp_id, distributor['id']) unless found
198
203
  end
204
+ tasks
199
205
  end
200
206
 
201
207
  def copy_units(destination_repo, units, options = {})
@@ -11,6 +11,6 @@
11
11
  <div id="organization-id" data-id="<%= Organization.current.id if Organization.current %>" ></div>
12
12
  <div id="user-id" data-id="<%= User.current.id if User.current %>" ></div>
13
13
  <div id="reactRoot"></div>
14
+ <%= mount_react_component('katello', '#reactRoot') %>
14
15
  <% end %>
15
16
  <%= render file: "layouts/base" %>
16
- <%= mount_react_component('katello', '#reactRoot') %>
@@ -1,6 +1,13 @@
1
1
  namespace :katello do
2
2
  namespace :upgrades do
3
3
  namespace '3.11' do
4
+ def wait_on_task(task, time = 0.1)
5
+ task = SmartProxy.pulp_master.pulp_api.resources.task.poll(task['task_id'])
6
+ return if Actions::Pulp::AbstractAsyncTask::FINISHED_STATES.include?(task['state'])
7
+ sleep time
8
+ wait_on_task(task, time + 0.2)
9
+ end
10
+
4
11
  desc "update puppet repos to regenerate pulp configuration"
5
12
  task :update_puppet_repos => %w(environment) do
6
13
  User.current = User.anonymous_admin
@@ -9,7 +16,8 @@ namespace :katello do
9
16
  puts "Refreshing repository #{repo.label} (#{repo.id})"
10
17
  install_dist = repo.backend_service(SmartProxy.pulp_master).backend_data['distributors'].find { |dist| dist['distributor_type_id'] == 'puppet_install_distributor' }
11
18
  if install_dist
12
- SmartProxy.pulp_master.pulp_api.resources.repository.delete_distributor(repo.pulp_id, install_dist['id'])
19
+ response = SmartProxy.pulp_master.pulp_api.resources.repository.delete_distributor(repo.pulp_id, install_dist['id'])
20
+ wait_on_task('task_id' => response['spawned_tasks'][0]['task_id'])
13
21
  end
14
22
  ForemanTasks.sync_task(::Actions::Pulp::Repository::Refresh, repo)
15
23
  rescue RestClient::ResourceNotFound
@@ -1,3 +1,3 @@
1
1
  module Katello
2
- VERSION = "3.11.0.rc2".freeze
2
+ VERSION = "3.11.0".freeze
3
3
  end
@@ -31,7 +31,7 @@ export const links = [
31
31
  },
32
32
  {
33
33
  // eslint-disable-next-line no-useless-escape
34
- path: 'subscriptions/:id([0-9]*$)',
34
+ path: 'subscriptions/:id([0-9]+)',
35
35
  component: withHeader(SubscriptionDetails, { title: __('Subscription Details') }),
36
36
  },
37
37
  {
@@ -43,7 +43,7 @@ export const links = [
43
43
  component: withHeader(ModuleStreams, { title: __('Module Streams') }),
44
44
  },
45
45
  {
46
- path: 'module_streams/:id([0-9]*$)',
46
+ path: 'module_streams/:id([0-9]+)',
47
47
  component: withHeader(ModuleStreamDetails, { title: __('Module Stream Details') }),
48
48
  },
49
49
  ];
@@ -6,7 +6,6 @@ exports[`subscription detail product content page renders correctly 1`] = `
6
6
  >
7
7
  <div
8
8
  className="list-group-item"
9
- initExpanded={false}
10
9
  >
11
10
  <div
12
11
  className="list-group-item-header"
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.11.0.rc2
4
+ version: 3.11.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: 2019-01-23 00:00:00.000000000 Z
11
+ date: 2019-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -2662,9 +2662,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
2662
2662
  version: '0'
2663
2663
  required_rubygems_version: !ruby/object:Gem::Requirement
2664
2664
  requirements:
2665
- - - ">"
2665
+ - - ">="
2666
2666
  - !ruby/object:Gem::Version
2667
- version: 1.3.1
2667
+ version: '0'
2668
2668
  requirements: []
2669
2669
  rubyforge_project:
2670
2670
  rubygems_version: 2.7.6