katello 3.16.0.rc5 → 3.16.0.rc5.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 +4 -4
- data/app/controllers/katello/api/v2/content_view_filters_controller.rb +5 -1
- data/app/lib/actions/katello/host/attach_subscriptions.rb +5 -1
- data/app/lib/actions/katello/sync_plan/run.rb +1 -1
- data/app/lib/actions/pulp3/repository/presenters/content_unit_presenter.rb +1 -1
- data/app/models/katello/content_view_filter.rb +4 -0
- data/app/models/katello/content_view_module_stream_filter.rb +11 -3
- data/app/models/katello/repository.rb +11 -0
- data/app/presenters/katello/sync_status_presenter.rb +4 -2
- data/app/services/katello/pulp/repository/yum.rb +2 -1
- data/app/services/katello/pulp3/migration.rb +6 -2
- data/app/views/katello/api/v2/content_view_filters/base.json.rabl +4 -0
- data/db/migrate/20200709021250_add_original_modules_to_content_view_module_stream_filter.rb +5 -0
- data/db/migrate/20200721142707_remove_duplicate_katello_pools_index.rb +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.routes.js +1 -13
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js +17 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/module-stream-filter-details.html +17 -0
- data/lib/katello/tasks/reports.rake +16 -0
- data/lib/katello/version.rb +1 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c713303404ad8912ded54dd3d110d6ef3f8e1ed9500f55abf1f31f2180d08a2
|
4
|
+
data.tar.gz: 07eb7edbe97e87b35d0ebd26eb90c0da64a8eddb69d4435333a546eaa82d298b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67508f99358a420af1f1fbdb332e427bec5ee59092c69f05790029be0d14b624f6306dc351c550f02671819add178da8ae92938aeb2f66a262bebbd287cbad66
|
7
|
+
data.tar.gz: 5267fc924abe8504b4688481792f964adab5b530f2110e3bb8954717fef6a6d691635f0c64d9f2a56b7bf311620df1b5cde767e9e9d2894ad454d134552f9425
|
@@ -37,6 +37,8 @@ module Katello
|
|
37
37
|
param :type, String, :desc => N_("type of filter (e.g. rpm, package_group, erratum, docker, modulemd)"), :required => true
|
38
38
|
param :original_packages, :bool, :desc => N_("add all packages without errata to the included/excluded list. " \
|
39
39
|
"(package filter only)")
|
40
|
+
param :original_module_streams, :bool, :desc => N_("add all module streams without errata to the included/excluded list. " \
|
41
|
+
"(module stream filter only)")
|
40
42
|
param :inclusion, :bool, :desc => N_("specifies if content should be included or excluded, default: inclusion=false")
|
41
43
|
param :repository_ids, Array, :desc => N_("list of repository ids")
|
42
44
|
param :description, String, :desc => N_("description of the filter")
|
@@ -60,6 +62,8 @@ module Katello
|
|
60
62
|
param :name, String, :desc => N_("new name for the filter")
|
61
63
|
param :original_packages, :bool, :desc => N_("add all packages without errata to the included/excluded list. " \
|
62
64
|
"(package filter only)")
|
65
|
+
param :original_module_streams, :bool, :desc => N_("add all module streams without errata to the included/excluded list. " \
|
66
|
+
"(module stream filter only)")
|
63
67
|
param :inclusion, :bool, :desc => N_("specifies if content should be included or excluded, default: inclusion=false")
|
64
68
|
param :repository_ids, Array, :desc => N_("list of repository ids")
|
65
69
|
param :description, String, :desc => N_("description of the filter"), :required => false
|
@@ -95,7 +99,7 @@ module Katello
|
|
95
99
|
end
|
96
100
|
|
97
101
|
def filter_params
|
98
|
-
params.require(:content_view_filter).permit(:name, :inclusion, :original_packages, :description, :repository_ids => [])
|
102
|
+
params.require(:content_view_filter).permit(:name, :inclusion, :original_packages, :original_module_streams, :description, :repository_ids => [])
|
99
103
|
end
|
100
104
|
end
|
101
105
|
end
|
@@ -8,12 +8,16 @@ module Actions
|
|
8
8
|
|
9
9
|
def plan(host, pools_with_quantities_params)
|
10
10
|
action_subject(host)
|
11
|
+
|
12
|
+
subscription_facet = host.subscription_facet
|
13
|
+
fail _("Register host '%s' before attaching subscriptions") % host.name unless subscription_facet
|
14
|
+
|
11
15
|
sequence do
|
12
16
|
pool_ids = []
|
13
17
|
pools_with_quantities = pools_with_quantities_params.map do |pool_with_quantity|
|
14
18
|
::Katello::PoolWithQuantities.fetch(pool_with_quantity)
|
15
19
|
end
|
16
|
-
existing_pool_ids =
|
20
|
+
existing_pool_ids = subscription_facet.candlepin_consumer.pool_ids
|
17
21
|
pools_with_quantities.each do |pool_with_quantities|
|
18
22
|
unless existing_pool_ids.include?(pool_with_quantities.pool.cp_id.to_s)
|
19
23
|
pool_ids << pool_with_quantities.pool.id
|
@@ -19,7 +19,7 @@ module Actions
|
|
19
19
|
syncable_products = sync_plan.products.syncable
|
20
20
|
syncable_roots = ::Katello::RootRepository.where(:product_id => syncable_products).has_url
|
21
21
|
|
22
|
-
plan_action(::Actions::BulkAction, ::Actions::Katello::Repository::Sync, syncable_roots.map(&:library_instance)) unless syncable_roots.empty?
|
22
|
+
plan_action(::Actions::BulkAction, ::Actions::Katello::Repository::Sync, syncable_roots.map(&:library_instance).compact) unless syncable_roots.empty?
|
23
23
|
plan_self(:sync_plan_name => sync_plan.name)
|
24
24
|
end
|
25
25
|
end
|
@@ -12,7 +12,7 @@ module Actions
|
|
12
12
|
def humanized_details
|
13
13
|
ret = []
|
14
14
|
ret << _("Cancelled.") if cancelled?
|
15
|
-
ret << _("Total
|
15
|
+
ret << _("Total steps: ") + "#{finished_units}/#{total_units}"
|
16
16
|
ret << "--------------------------------"
|
17
17
|
progress_reports = sync_task.try(:[], 'progress_reports') || []
|
18
18
|
progress_reports = progress_reports.sort_by { |pr| pr.try(:[], 'message') }
|
@@ -182,6 +182,10 @@ module Katello
|
|
182
182
|
fail "setting original_packages not supported for #{self.class.name}"
|
183
183
|
end
|
184
184
|
|
185
|
+
def original_module_streams=(_include_original)
|
186
|
+
fail "setting original_module_streams not supported for #{self.class.name}"
|
187
|
+
end
|
188
|
+
|
185
189
|
protected
|
186
190
|
|
187
191
|
def validate_repos
|
@@ -6,9 +6,17 @@ module Katello
|
|
6
6
|
|
7
7
|
validates_lengths_from_database
|
8
8
|
|
9
|
-
def generate_clauses(
|
10
|
-
|
11
|
-
|
9
|
+
def generate_clauses(repo)
|
10
|
+
rules = module_stream_rules || []
|
11
|
+
ids = rules.map(&:module_stream_id)
|
12
|
+
if self.original_module_streams
|
13
|
+
ids.concat(repo.module_streams_without_errata.map(&:id))
|
14
|
+
end
|
15
|
+
ids
|
16
|
+
end
|
17
|
+
|
18
|
+
def original_module_streams=(value)
|
19
|
+
self[:original_module_streams] = value
|
12
20
|
end
|
13
21
|
end
|
14
22
|
end
|
@@ -469,6 +469,17 @@ module Katello
|
|
469
469
|
end
|
470
470
|
end
|
471
471
|
|
472
|
+
def module_streams_without_errata
|
473
|
+
module_stream_errata = Katello::ModuleStreamErratumPackage.joins(:erratum_package => {:erratum => :repository_errata})
|
474
|
+
.where("#{RepositoryErratum.table_name}.repository_id" => self.id)
|
475
|
+
.pluck("#{Katello::ModuleStreamErratumPackage.table_name}.module_stream_id")
|
476
|
+
if module_stream_errata.any?
|
477
|
+
self.module_streams.where("#{ModuleStream.table_name}.id NOT in (?)", module_stream_errata)
|
478
|
+
else
|
479
|
+
self.module_streams
|
480
|
+
end
|
481
|
+
end
|
482
|
+
|
472
483
|
def self.with_errata(errata)
|
473
484
|
joins(:repository_errata).where("#{Katello::RepositoryErratum.table_name}.erratum_id" => errata)
|
474
485
|
end
|
@@ -19,6 +19,8 @@ module Katello
|
|
19
19
|
def sync_progress
|
20
20
|
return {:state => nil} unless @repo
|
21
21
|
return empty_task(@repo) unless @task
|
22
|
+
display_output = @task.humanized[:output]
|
23
|
+
display_output = display_output.split("\n")[0] if (display_output && @repo.version_href)
|
22
24
|
{
|
23
25
|
:id => @repo.id,
|
24
26
|
:product_id => @repo.product.id,
|
@@ -29,8 +31,8 @@ module Katello
|
|
29
31
|
:start_time => format_date(@task.started_at),
|
30
32
|
:finish_time => format_date(@task.ended_at),
|
31
33
|
:duration => format_duration(@task.ended_at, @task.started_at),
|
32
|
-
:display_size =>
|
33
|
-
:size =>
|
34
|
+
:display_size => display_output,
|
35
|
+
:size => display_output,
|
34
36
|
:is_running => @task.pending && @task.state != 'paused',
|
35
37
|
:error_details => @task.errors
|
36
38
|
}
|
@@ -246,7 +246,8 @@ module Katello
|
|
246
246
|
remove = clause_gen.remove_clause
|
247
247
|
remove_clauses = {filters: {unit: remove}} if remove
|
248
248
|
else
|
249
|
-
|
249
|
+
non_modular_rpms = ::Katello::Rpm.in_repositories(repo).non_modular.pluck(:filename)
|
250
|
+
copy_clauses = non_modular_rpms.blank? ? nil : {filters: {unit: ContentViewPackageFilter.generate_rpm_clauses(non_modular_rpms)}}
|
250
251
|
remove_clauses = nil
|
251
252
|
end
|
252
253
|
|
@@ -35,11 +35,15 @@ module Katello
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def pulp2_content_api
|
38
|
-
Pulp2to3MigrationClient::
|
38
|
+
Pulp2to3MigrationClient::Pulp2ContentApi.new(api_client)
|
39
|
+
rescue NameError
|
40
|
+
Pulp2to3MigrationClient::Pulp2contentApi.new(api_client) #backwards compatible
|
39
41
|
end
|
40
42
|
|
41
43
|
def pulp2_repositories_api
|
42
|
-
Pulp2to3MigrationClient::
|
44
|
+
Pulp2to3MigrationClient::Pulp2RepositoriesApi.new(api_client)
|
45
|
+
rescue NameError
|
46
|
+
Pulp2to3MigrationClient::Pulp2repositoriesApi.new(api_client) #backwards compatible
|
43
47
|
end
|
44
48
|
|
45
49
|
def create_and_run_migrations
|
@@ -17,6 +17,10 @@ if @resource.respond_to?(:package_rules)
|
|
17
17
|
attributes :original_packages
|
18
18
|
end
|
19
19
|
|
20
|
+
if @resource.respond_to?(:module_stream_rules)
|
21
|
+
attributes :original_module_streams
|
22
|
+
end
|
23
|
+
|
20
24
|
node :rules do |filter|
|
21
25
|
if filter.respond_to?(:package_rules)
|
22
26
|
filter.package_rules.map do |rule|
|
@@ -10,21 +10,9 @@
|
|
10
10
|
*/
|
11
11
|
angular.module('Bastion.capsule-content').config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {
|
12
12
|
//Catch the url to prevent the router to perform redirect.
|
13
|
-
$urlRouterProvider.when('/smart_proxies/:proxyId', [
|
14
|
-
$stateParams.pageName = 'smart_proxies/detail';
|
13
|
+
$urlRouterProvider.when('/smart_proxies/:proxyId', [function () {
|
15
14
|
return true;
|
16
15
|
}]);
|
17
|
-
|
18
|
-
// Add rule to redirect links on the smart proxy detail page.
|
19
|
-
// Changing state doesn't work there since there's no <ui-view> element there
|
20
|
-
$urlRouterProvider.rule(function ($injector, $location) {
|
21
|
-
var $stateParams = $injector.get('$stateParams'),
|
22
|
-
$window = $injector.get('$window');
|
23
|
-
|
24
|
-
if ($stateParams.pageName === 'smart_proxies/detail') {
|
25
|
-
$window.location.href = $location.path();
|
26
|
-
}
|
27
|
-
});
|
28
16
|
}]);
|
29
17
|
|
30
18
|
/**
|
@@ -3,19 +3,32 @@
|
|
3
3
|
* @name Bastion.content-views.controller:FilterDetailsController
|
4
4
|
*
|
5
5
|
* @requires $scope
|
6
|
+
* @requires $q
|
7
|
+
* @requires translate
|
8
|
+
* @requires Notification
|
6
9
|
* @requires Filter
|
7
10
|
*
|
8
11
|
* @description
|
9
12
|
* Handles fetching a filter.
|
10
13
|
*/
|
11
14
|
angular.module('Bastion.content-views').controller('FilterDetailsController',
|
12
|
-
['$scope', 'Filter', function ($scope, Filter) {
|
13
|
-
|
15
|
+
['$scope', '$q', 'translate', 'Notification', 'Filter', function ($scope, $q, translate, Notification, Filter) {
|
14
16
|
$scope.filter = Filter.get({'content_view_id': $scope.$stateParams.contentViewId, filterId: $scope.$stateParams.filterId});
|
15
17
|
|
16
18
|
$scope.updateFilter = function (filter) {
|
17
|
-
|
18
|
-
};
|
19
|
+
var deferred = $q.defer();
|
19
20
|
|
21
|
+
filter.$update(function (response) {
|
22
|
+
deferred.resolve(response);
|
23
|
+
Notification.setSuccessMessage(translate('Filter Updated - ' + $scope.filter.name));
|
24
|
+
}, function (response) {
|
25
|
+
deferred.reject(response);
|
26
|
+
angular.forEach(response.data.errors, function (errorMessage) {
|
27
|
+
Notification.setErrorMessage(translate("An error occurred saving the Filter: ") + errorMessage);
|
28
|
+
});
|
29
|
+
});
|
30
|
+
|
31
|
+
return deferred.promise;
|
32
|
+
};
|
20
33
|
}]
|
21
34
|
);
|
@@ -1,4 +1,21 @@
|
|
1
1
|
<div data-extend-template="layouts/partials/table.html">
|
2
|
+
<div data-block="filters">
|
3
|
+
<div class="checkbox">
|
4
|
+
<label>
|
5
|
+
<input type="checkbox"
|
6
|
+
ng-model="filter.original_module_streams"
|
7
|
+
ng-change="updateFilter(filter)"/>
|
8
|
+
|
9
|
+
<span ng-show="filter.inclusion" translate>
|
10
|
+
Include all Module Streams with no errata.
|
11
|
+
</span>
|
12
|
+
|
13
|
+
<span ng-show="!filter.inclusion" translate>
|
14
|
+
Exclude all Module Streams with no errata.
|
15
|
+
</span>
|
16
|
+
</label>
|
17
|
+
</div>
|
18
|
+
</div>
|
2
19
|
|
3
20
|
<div data-block="list-actions">
|
4
21
|
<button type="button" class="btn btn-primary"
|
@@ -0,0 +1,16 @@
|
|
1
|
+
load "#{Rails.root}/lib/tasks/reports.rake"
|
2
|
+
|
3
|
+
#define this task since its not in foreman 2.1
|
4
|
+
namespace :dynflow do
|
5
|
+
desc <<~END_DESC
|
6
|
+
Sets up the environment to act as a Dynflow client. By acting as a client, it still send tasks to be processed, but it cannot execute tasks.
|
7
|
+
END_DESC
|
8
|
+
task :client do
|
9
|
+
dynflow = ::Rails.application.dynflow
|
10
|
+
dynflow.config.remote = true
|
11
|
+
dynflow.initialize!
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
#Katello reports can generate a foreman task, so mark the task as a dynflow client
|
16
|
+
["reports:daily", "reports:weekly", "reports:monthly"].each { |task| Rake::Task[task].enhance ["dynflow:client"] }
|
data/lib/katello/version.rb
CHANGED
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.16.0.rc5
|
4
|
+
version: 3.16.0.rc5.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: 2020-07-
|
11
|
+
date: 2020-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -261,7 +261,7 @@ dependencies:
|
|
261
261
|
version: '0.1'
|
262
262
|
- - "<"
|
263
263
|
- !ruby/object:Gem::Version
|
264
|
-
version: 0.
|
264
|
+
version: 0.2.0b15
|
265
265
|
type: :runtime
|
266
266
|
prerelease: false
|
267
267
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -271,7 +271,7 @@ dependencies:
|
|
271
271
|
version: '0.1'
|
272
272
|
- - "<"
|
273
273
|
- !ruby/object:Gem::Version
|
274
|
-
version: 0.
|
274
|
+
version: 0.2.0b15
|
275
275
|
- !ruby/object:Gem::Dependency
|
276
276
|
name: pulp_container_client
|
277
277
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1988,6 +1988,8 @@ files:
|
|
1988
1988
|
- db/migrate/20200506163345_add_applicability_indicesto_katello_host_available_module_streams.rb
|
1989
1989
|
- db/migrate/20200511204005_create_katello_host_queue_elements.rb
|
1990
1990
|
- db/migrate/20200526200422_encrypt_root_repository_upstream_password.rb
|
1991
|
+
- db/migrate/20200709021250_add_original_modules_to_content_view_module_stream_filter.rb
|
1992
|
+
- db/migrate/20200721142707_remove_duplicate_katello_pools_index.rb
|
1991
1993
|
- db/seeds.d/101-locations.rb
|
1992
1994
|
- db/seeds.d/102-organizations.rb
|
1993
1995
|
- db/seeds.d/104-proxy.rb
|
@@ -4342,6 +4344,7 @@ files:
|
|
4342
4344
|
- lib/katello/tasks/receptor/extract_orgs.rake
|
4343
4345
|
- lib/katello/tasks/regenerate_ueber_certs.rake
|
4344
4346
|
- lib/katello/tasks/reimport.rake
|
4347
|
+
- lib/katello/tasks/reports.rake
|
4345
4348
|
- lib/katello/tasks/repository.rake
|
4346
4349
|
- lib/katello/tasks/reset.rake
|
4347
4350
|
- lib/katello/tasks/rubocop.rake
|