katello 4.15.0.rc1 → 4.15.0.rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9e186226a2565c97bcbb32824cb73529b41587d5835331f92d7703873422c54
4
- data.tar.gz: 3a447ab555fd7af2c11d6fa9314e62aa3c8bdd6a7592932eebd5f2dfcb9a5f55
3
+ metadata.gz: 42fc16f97e3c3ec773c97e554fc14f11ae7bc3e92ceae35d05a25acb3086965d
4
+ data.tar.gz: c197411d237e7a82c9a9caa1ecf7bfdbc958354d01fe373e95207d81b410854b
5
5
  SHA512:
6
- metadata.gz: b114285e86a4a17948bf0636e4f0f4cad6eb8c8a53b75ff7e0986ff54758dbe4911a3beafe2ab5fc1d8aa9c73929cedc30abf638c2087a6e8108d3b0903975b6
7
- data.tar.gz: b5998fa315eb371df74500e1e8868caff62da9c30dfd6473361981ae94e23ac1a8b38a6c91f90f0c8e9078358cc3c21f31d7cd41a738d7cd46f9943ee205acad
6
+ metadata.gz: 1ed1e2c8ec5408e98341e8608f17b3500b0d57b21f780d97582a6f21e953cd93209f3d6cb67e412f62a98648bef14a5adee0310fd23665c25a53ece294ff6d67
7
+ data.tar.gz: f1ebce7de2995fa8fd1cdb571887d787b20070e6b8a31300d0fb557ffe0813b37cd52711251d54a91cddf176d76878156d6fa0d622a0ddd57c3b024ee2b1dbfa
@@ -2,7 +2,8 @@ module Katello
2
2
  class Api::V2::GenericContentUnitsController < Api::V2::ApiController
3
3
  resource_description do
4
4
  name 'Content Units'
5
- param :content_type, String, desc: N_("Possible values: #{Katello::RepositoryTypeManager.generic_content_types.join(", ")}"), required: true
5
+ param :content_type, lambda { |val| Katello::RepositoryTypeManager.generic_content_types.include?(val) },
6
+ desc: N_("Possible values: %s") % Katello::RepositoryTypeManager.generic_content_types.join(", "), required: true
6
7
  end
7
8
  apipie_concern_subst(:a_resource => N_("a content unit"), :resource_id => "content_units")
8
9
 
@@ -101,22 +101,14 @@ module Katello
101
101
 
102
102
  def find_by_applicable_errata(_key, operator, value)
103
103
  conditions = sanitize_sql_for_conditions(["#{Katello::Erratum.table_name}.errata_id #{operator} ?", value_to_sql(operator, value)])
104
- hosts = ::Host::Managed.joins(:applicable_errata).where(conditions)
105
- if hosts.empty?
106
- { :conditions => "1=0" }
107
- else
108
- { :conditions => "#{::Host::Managed.table_name}.id IN (#{hosts.pluck(:id).join(',')})" }
109
- end
104
+ hosts = ::Host::Managed.joins(:applicable_errata).select(:id).where(conditions)
105
+ { :conditions => "#{::Host::Managed.table_name}.id IN (#{hosts.to_sql})" }
110
106
  end
111
107
 
112
108
  def find_by_installable_errata(_key, operator, value)
113
109
  conditions = sanitize_sql_for_conditions(["#{Katello::Erratum.table_name}.errata_id #{operator} ?", value_to_sql(operator, value)])
114
- facets = Katello::Host::ContentFacet.joins_installable_errata.where(conditions)
115
- if facets.empty?
116
- { :conditions => "1=0" }
117
- else
118
- { :conditions => "#{::Host::Managed.table_name}.id IN (#{facets.pluck(:host_id).join(',')})" }
119
- end
110
+ facets = Katello::Host::ContentFacet.joins_installable_errata.select(:host_id).where(conditions)
111
+ { :conditions => "#{::Host::Managed.table_name}.id IN (#{facets.to_sql})" }
120
112
  end
121
113
 
122
114
  def find_by_applicable_debs(_key, operator, value)
@@ -139,42 +131,26 @@ module Katello
139
131
 
140
132
  def find_by_applicable_rpms(_key, operator, value)
141
133
  conditions = sanitize_sql_for_conditions(["#{Katello::Rpm.table_name}.nvra #{operator} ?", value_to_sql(operator, value)])
142
- hosts = ::Host::Managed.joins(:applicable_rpms).where(conditions)
143
- if hosts.empty?
144
- { :conditions => "1=0" }
145
- else
146
- { :conditions => "#{::Host::Managed.table_name}.id IN (#{hosts.pluck(:id).join(',')})" }
147
- end
134
+ hosts = ::Host::Managed.joins(:applicable_rpms).select(:id).where(conditions)
135
+ { :conditions => "#{::Host::Managed.table_name}.id IN (#{hosts.to_sql})" }
148
136
  end
149
137
 
150
138
  def find_by_installable_rpms(_key, operator, value)
151
139
  conditions = sanitize_sql_for_conditions(["#{Katello::Rpm.table_name}.nvra #{operator} ?", value_to_sql(operator, value)])
152
- facets = Katello::Host::ContentFacet.joins_installable_rpms.where(conditions)
153
- if facets.empty?
154
- { :conditions => "1=0" }
155
- else
156
- { :conditions => "#{::Host::Managed.table_name}.id IN (#{facets.pluck(:host_id).join(',')})" }
157
- end
140
+ facets = Katello::Host::ContentFacet.joins_installable_rpms.select(:host_id).where(conditions)
141
+ { :conditions => "#{::Host::Managed.table_name}.id IN (#{facets.to_sql})" }
158
142
  end
159
143
 
160
144
  def find_by_repository_content_label(_key, operator, value)
161
145
  conditions = sanitize_sql_for_conditions(["#{Katello::Content.table_name}.label #{operator} ?", value_to_sql(operator, value)])
162
- facets = Katello::Host::ContentFacet.joins_repositories.where(conditions)
163
- if facets.empty?
164
- { :conditions => "1=0" }
165
- else
166
- { :conditions => "#{::Host::Managed.table_name}.id IN (#{facets.pluck(:host_id).join(',')})" }
167
- end
146
+ facets = Katello::Host::ContentFacet.joins_repositories.select(:host_id).where(conditions)
147
+ { :conditions => "#{::Host::Managed.table_name}.id IN (#{facets.to_sql})" }
168
148
  end
169
149
 
170
150
  def find_by_repository_name(_key, operator, value)
171
151
  conditions = sanitize_sql_for_conditions(["#{Katello::RootRepository.table_name}.name #{operator} ?", value_to_sql(operator, value)])
172
- facets = Katello::Host::ContentFacet.joins_repositories.where(conditions)
173
- if facets.empty?
174
- { :conditions => "1=0" }
175
- else
176
- { :conditions => "#{::Host::Managed.table_name}.id IN (#{facets.pluck(:host_id).join(',')})" }
177
- end
152
+ facets = Katello::Host::ContentFacet.joins_repositories.select(:host_id).where(conditions)
153
+ { :conditions => "#{::Host::Managed.table_name}.id IN (#{facets.to_sql})" }
178
154
  end
179
155
 
180
156
  def in_content_view_environments(content_views: nil, lifecycle_environments: nil)
@@ -534,10 +534,16 @@ module Katello
534
534
  versions_by_name_arch = {}
535
535
  if versions.present?
536
536
  JSON.parse(versions).each do |nvra|
537
- nvra =~ /([^.]*)-[-.\w]*\.(\w+)/
538
- versions_by_name_arch[[Regexp.last_match(1), Regexp.last_match(2)]] = nvra
537
+ package_info = ::Katello::Util::Package.parse_nvrea(nvra)
538
+ versions_by_name_arch[[package_info[:name], package_info[:arch]]] = nvra
539
539
  end
540
540
  end
541
+
542
+ # > versions_by_name_arch
543
+ # =>
544
+ # {["glibc-langpack-en", "x86_64"]=>"glibc-langpack-en-2.34-100.el9_4.2.x86_64",
545
+ # ["crypto-policies", "noarch"]=>"crypto-policies-20221215-1.git9a18988.el9_2.1.noarch"}
546
+
541
547
  pkg_name_archs = installed_packages.search_for(search).distinct.pluck(:name, :arch)
542
548
  if pkg_name_archs.empty?
543
549
  fail _("Cannot upgrade packages: No installed packages found for search term '%s'.") % search
@@ -19,10 +19,17 @@ reboot = commands.delete('reboot')
19
19
  <% if reboot -%>
20
20
  shutdown -r +1
21
21
  <% else -%>
22
- <%= commands.join("\n") %>
22
+ RETVAL=0
23
+ <% commands.each do |command| -%>
24
+ <%= command %>
25
+ if [ $? -ne 0 ]; then
26
+ RETVAL=1
27
+ fi
28
+ <% end -%>
23
29
  RUN_TRACER_CMD='katello-tracer-upload'
24
30
  if [ "$(id -u)" -ne 0 ]; then
25
31
  RUN_TRACER_CMD='sudo katello-tracer-upload'
26
32
  fi
27
33
  $RUN_TRACER_CMD
34
+ exit $RETVAL
28
35
  <% end %>
@@ -17,10 +17,11 @@ kind: job_template
17
17
  commands = @host.traces_helpers(search: input('Traces search query'))
18
18
  reboot = commands.delete('reboot')
19
19
  -%>
20
+ <% if reboot -%>
21
+ - reboot:
22
+ <% else -%>
20
23
  <%= render_template(
21
24
  'Run Command - Ansible Default',
22
25
  :command => (commands.push('katello-tracer-upload')).join("\n")
23
26
  ) %>
24
- <% if reboot %>
25
- - reboot:
26
- <% end %>
27
+ <% end -%>
@@ -16,8 +16,16 @@ template_inputs:
16
16
  commands = input(:helper).split(',').map { |split| split.strip }
17
17
  reboot = commands.delete('reboot')
18
18
  -%>
19
- <%= commands.join("\n") %>
20
- katello-tracer-upload
21
19
  <% if reboot -%>
22
20
  <%= render_template('Power Action - Script Default', action: 'restart') %>
23
- <% end %>
21
+ <% else -%>
22
+ RETVAL=0
23
+ <% commands.each do |command| -%>
24
+ <%= command %>
25
+ if [ $? -ne 0 ]; then
26
+ RETVAL=1
27
+ fi
28
+ <% end -%>
29
+ katello-tracer-upload
30
+ <% end -%>
31
+ exit $RETVAL
@@ -18,10 +18,11 @@ kind: job_template
18
18
  commands = input(:helper).split(',').map { |split| split.strip }
19
19
  reboot = commands.delete('reboot')
20
20
  -%>
21
+ <% if reboot -%>
22
+ - reboot:
23
+ <% else -%>
21
24
  <%= render_template(
22
25
  'Run Command - Ansible Default',
23
26
  :command => (commands.push('katello-tracer-upload')).join("\n")
24
27
  ) %>
25
- <% if reboot %>
26
- - reboot:
27
- <% end %>
28
+ <% end -%>
@@ -160,6 +160,8 @@ angular.module('Bastion.repositories').controller('NewRepositoryController',
160
160
  $scope.genericRemoteOptions.forEach(function(option) {
161
161
  if (option.type === "Array" && option.value !== "") {
162
162
  repository[option.name] = option.value.split(option.delimiter);
163
+ } else if (option.type === "number" && option.value === "") {
164
+ repository[option.name] = option.default;
163
165
  } else {
164
166
  repository[option.name] = option.value;
165
167
  }
@@ -24,7 +24,7 @@ Katello::RepositoryTypeManager.register('ostree') do
24
24
  generic_remote_option :exclude_refs, title: N_("Exclude Refs"), type: Array, input_type: "text", delimiter: ",", default: [],
25
25
  description: N_("A comma-separated list of tags to exclude during an ostree sync. The wildcards *, ? are recognized. 'exclude_refs' is evaluated after 'include_refs'.")
26
26
 
27
- generic_remote_option :depth, title: N_("Depth"), type: :number, input_type: "number", delimiter: "", default: 0, description: N_("An option to specify how many ostree commits to traverse.")
27
+ generic_remote_option :depth, title: N_("Depth"), type: :number, input_type: "number", default: 0, description: N_("An option to specify how many ostree commits to traverse.")
28
28
 
29
29
  url_description N_("URL of an OSTree repository.")
30
30
 
@@ -1,3 +1,3 @@
1
1
  module Katello
2
- VERSION = "4.15.0.rc1".freeze
2
+ VERSION = "4.15.0.rc2".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: 4.15.0.rc1
4
+ version: 4.15.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - N/A
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-15 00:00:00.000000000 Z
11
+ date: 2024-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails