katello 3.5.0.rc2 → 3.5.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 +4 -4
- data/app/assets/javascripts/katello/containers/container.js +10 -1
- data/app/assets/javascripts/katello/hosts/host_and_hostgroup_edit.js +7 -3
- data/app/controllers/katello/api/v2/api_controller.rb +11 -7
- data/app/controllers/katello/api/v2/host_collections_controller.rb +1 -1
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +1 -1
- data/app/controllers/katello/concerns/containers/steps_controller_extensions.rb +11 -3
- data/app/lib/actions/katello/capsule_content/create_repos.rb +1 -0
- data/app/lib/actions/katello/content_view/errata_mail.rb +1 -1
- data/app/lib/actions/katello/host/hypervisors_update.rb +1 -2
- data/app/lib/actions/katello/host/update.rb +2 -2
- data/app/lib/actions/katello/repository/errata_mail.rb +1 -1
- data/app/lib/actions/pulp/repository/abstract_copy_content.rb +1 -1
- data/app/lib/katello/resources/candlepin.rb +28 -2
- data/app/models/katello/activation_key.rb +1 -1
- data/app/models/katello/concerns/container_extensions.rb +1 -1
- data/app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb +39 -0
- data/app/models/katello/concerns/environment_extensions.rb +1 -1
- data/app/models/katello/concerns/location_extensions.rb +33 -8
- data/app/models/katello/content_view_puppet_environment.rb +4 -0
- data/app/models/katello/docker_manifest.rb +2 -0
- data/app/models/katello/docker_meta_tag.rb +33 -0
- data/app/models/katello/docker_tag.rb +19 -9
- data/app/models/katello/host/subscription_facet.rb +5 -7
- data/app/models/katello/product.rb +4 -4
- data/app/models/katello/subscription.rb +4 -3
- data/app/services/katello/candlepin/consumer.rb +0 -14
- data/app/services/katello/pulp/erratum.rb +1 -1
- data/app/views/dashboard/_content_views_widget.html.erb +1 -1
- data/app/views/foreman_docker/containers/steps/_katello_container.html.erb +15 -1
- data/app/views/katello/api/v2/docker_manifests/show.json.rabl +2 -1
- data/app/views/katello/api/v2/docker_tags/show.json.rabl +1 -1
- data/app/views/katello/api/v2/errata/show.json.rabl +2 -2
- data/config/katello.yaml.example +1 -1
- data/config/routes/api/v2.rb +6 -1
- data/db/migrate/20170822104447_add_katello_content_to_image.rb +5 -0
- data/db/migrate/20170913183848_add_errata_counts.rb +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/architectures/architecture.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version.controller.js +5 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-manifests/docker-manifest.factory.js +4 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/docker-tag-details.controller.js +2 -20
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/docker-tag-environments.controller.js +64 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/docker-tags.routes.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/apply-errata.controller.js +11 -15
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/erratum-content-hosts.controller.js +3 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/incremental-update.service.js +0 -11
- data/lib/katello/engine.rb +3 -1
- data/lib/katello/plugin.rb +11 -9
- data/lib/katello/tasks/clean_backend_objects.rake +65 -39
- data/lib/katello/version.rb +1 -1
- metadata +9 -6
@@ -2,6 +2,16 @@
|
|
2
2
|
<%= stylesheet "katello/containers/container" %>
|
3
3
|
<div>
|
4
4
|
<div class="form-group">
|
5
|
+
<% model_for("katello").errors.messages.select {|field, _| field == :katello_content }.each do |field, field_errors| %>
|
6
|
+
<div class="alert alert-danger">
|
7
|
+
<span class="pficon pficon-error-circle-o"></span>
|
8
|
+
<ul>
|
9
|
+
<% field_errors.each do |message| %>
|
10
|
+
<li><%= message %></li>
|
11
|
+
<% end %>
|
12
|
+
</ul>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
5
15
|
<%= hidden_field_tag :katello, true %>
|
6
16
|
<% if Organization.current -%>
|
7
17
|
<%= hidden_field_tag :organization_id, Organization.current.id%>
|
@@ -33,6 +43,10 @@
|
|
33
43
|
<span id="no_capsules" class="hide"> <%= _("Selected organization has no smart proxies with Pulp or Pulp Node features. Please choose a different organization.")-%></span>
|
34
44
|
<span id="error_capsules" class="hide"> <%= _("Unable to fetch any smart proxies. Please try again.")-%></span>
|
35
45
|
</div>
|
36
|
-
|
46
|
+
<script type="text/javascript">
|
47
|
+
$(document).ready(function() {
|
48
|
+
KT.container.setSelection(<%= @state.image.try(:katello_content).to_json.html_safe %>)
|
49
|
+
})
|
50
|
+
</script>
|
37
51
|
</div>
|
38
52
|
</div>
|
@@ -1,7 +1,6 @@
|
|
1
1
|
object @resource
|
2
2
|
|
3
|
-
attributes :uuid
|
4
|
-
attributes :title, :errata_id
|
3
|
+
attributes :id, :uuid, :title, :errata_id
|
5
4
|
attributes :issued, :updated, :version, :status, :release
|
6
5
|
attributes :severity, :description, :solution, :summary, :reboot_suggested
|
7
6
|
attributes :_href
|
@@ -10,6 +9,7 @@ child :cves => :cves do
|
|
10
9
|
attributes :cve_id, :href
|
11
10
|
end
|
12
11
|
|
12
|
+
attributes :title => :name
|
13
13
|
attributes :errata_type => :type
|
14
14
|
|
15
15
|
node(:hosts_available_count) { |m| m.hosts_available(params[:organization_id]).count }
|
data/config/katello.yaml.example
CHANGED
data/config/routes/api/v2.rb
CHANGED
@@ -119,7 +119,12 @@ Katello::Engine.routes.draw do
|
|
119
119
|
end
|
120
120
|
end
|
121
121
|
|
122
|
-
api_resources :docker_manifests, :only => [:index, :show]
|
122
|
+
api_resources :docker_manifests, :only => [:index, :show] do
|
123
|
+
collection do
|
124
|
+
get :auto_complete_search
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
123
128
|
api_resources :docker_tags, :only => [:index, :show] do
|
124
129
|
collection do
|
125
130
|
get :auto_complete_search
|
@@ -7,6 +7,7 @@ class AddErrataCounts < ActiveRecord::Migration
|
|
7
7
|
add_column :katello_content_facets, :applicable_rpm_count, :integer, :null => false, :default => 0
|
8
8
|
add_column :katello_content_facets, :upgradable_rpm_count, :integer, :null => false, :default => 0
|
9
9
|
|
10
|
+
Katello::Host::ContentFacet.reset_column_information
|
10
11
|
Katello::Host::ContentFacet.find_each do |content_facet|
|
11
12
|
content_facet.update_applicability_counts
|
12
13
|
end
|
@@ -9,7 +9,7 @@
|
|
9
9
|
*/
|
10
10
|
angular.module('Bastion.architectures').factory('Architecture',
|
11
11
|
['BastionResource', function (BastionResource) {
|
12
|
-
var resource = BastionResource('
|
12
|
+
var resource = BastionResource('api/v2/architectures/');
|
13
13
|
return resource;
|
14
14
|
}]
|
15
15
|
);
|
@@ -26,10 +26,11 @@
|
|
26
26
|
$scope.hasErrata = function (version) {
|
27
27
|
var found = false;
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
if (version['errata_counts'] &&
|
30
|
+
version['errata_counts'].total &&
|
31
|
+
version['errata_counts'].total !== 0) {
|
32
|
+
return true;
|
33
|
+
}
|
33
34
|
return found;
|
34
35
|
};
|
35
36
|
|
@@ -10,7 +10,10 @@
|
|
10
10
|
*/
|
11
11
|
function DockerManifest(BastionResource) {
|
12
12
|
return BastionResource('katello/api/v2/docker_manifests/:id',
|
13
|
-
{'id': '@id'}
|
13
|
+
{'id': '@id'},
|
14
|
+
{
|
15
|
+
'autocomplete': {method: 'GET', isArray: true, params: {id: 'auto_complete_search'}}
|
16
|
+
}
|
14
17
|
);
|
15
18
|
}
|
16
19
|
|
@@ -12,15 +12,13 @@
|
|
12
12
|
* Provides the functionality for the docker tags details action pane.
|
13
13
|
*/
|
14
14
|
angular.module('Bastion.docker-tags').controller('DockerTagDetailsController',
|
15
|
-
['$scope', '$location', '
|
16
|
-
function ($scope, $location,
|
15
|
+
['$scope', '$location', 'DockerTag', 'CurrentOrganization', 'ApiErrorHandler',
|
16
|
+
function ($scope, $location, DockerTag, CurrentOrganization, ApiErrorHandler) {
|
17
17
|
$scope.panel = {
|
18
18
|
error: false,
|
19
19
|
loading: true
|
20
20
|
};
|
21
21
|
|
22
|
-
$scope.table = {};
|
23
|
-
|
24
22
|
if ($scope.tag) {
|
25
23
|
$scope.panel.loading = false;
|
26
24
|
}
|
@@ -31,21 +29,5 @@ angular.module('Bastion.docker-tags').controller('DockerTagDetailsController',
|
|
31
29
|
$scope.panel.loading = false;
|
32
30
|
ApiErrorHandler.handleGETRequestErrors(response, $scope);
|
33
31
|
});
|
34
|
-
|
35
|
-
$scope.tag.$promise.then(function () {
|
36
|
-
var params = {
|
37
|
-
'organization_id': CurrentOrganization,
|
38
|
-
'search': $location.search().search || "",
|
39
|
-
'sort_by': 'name',
|
40
|
-
'sort_order': 'ASC',
|
41
|
-
'paged': false,
|
42
|
-
'ids[]': _.map($scope.tag['related_tags'], 'uuid')
|
43
|
-
};
|
44
|
-
var nutupane = new Nutupane(DockerTag, params);
|
45
|
-
$scope.controllerName = 'katello_docker_tags';
|
46
|
-
$scope.table = nutupane.table;
|
47
|
-
$scope.panel.loading = false;
|
48
|
-
nutupane.refresh();
|
49
|
-
});
|
50
32
|
}
|
51
33
|
]);
|
@@ -0,0 +1,64 @@
|
|
1
|
+
/**
|
2
|
+
* @ngdoc object
|
3
|
+
* @name Bastion.docker-tags.controller:DockerTagDetailsController
|
4
|
+
*
|
5
|
+
* @requires $scope
|
6
|
+
* @requires $location
|
7
|
+
* @requires DockerTag
|
8
|
+
* @requires CurrentOrganization
|
9
|
+
* @requires translate
|
10
|
+
*
|
11
|
+
* @description
|
12
|
+
* Provides the functionality for the docker tags details environments list.
|
13
|
+
*/
|
14
|
+
angular.module('Bastion.docker-tags').controller('DockerTagEnvironmentsController',
|
15
|
+
['$scope', '$location', 'Nutupane', 'DockerTag', 'CurrentOrganization', 'translate',
|
16
|
+
function ($scope, $location, Nutupane, DockerTag, CurrentOrganization, translate) {
|
17
|
+
var params = {
|
18
|
+
'organization_id': CurrentOrganization,
|
19
|
+
'search': $location.search().search || "",
|
20
|
+
'sort_by': 'name',
|
21
|
+
'sort_order': 'ASC',
|
22
|
+
'paged': false
|
23
|
+
};
|
24
|
+
var nutupane = new Nutupane(DockerTag, params, null, {disableAutoLoad: true});
|
25
|
+
|
26
|
+
var renderTable = function () {
|
27
|
+
var ids = _.map($scope.tag.related_tags, 'id');
|
28
|
+
var newParams = {
|
29
|
+
'organization_id': CurrentOrganization,
|
30
|
+
'search': $location.search().search || "",
|
31
|
+
'sort_by': 'name',
|
32
|
+
'sort_order': 'ASC',
|
33
|
+
'paged': false,
|
34
|
+
'ids[]': ids
|
35
|
+
};
|
36
|
+
$scope.table = nutupane.table;
|
37
|
+
nutupane.setParams(newParams);
|
38
|
+
$scope.panel.loading = false;
|
39
|
+
if (!_.isEmpty(ids)) {
|
40
|
+
nutupane.refresh();
|
41
|
+
}
|
42
|
+
};
|
43
|
+
|
44
|
+
$scope.controllerName = 'katello_docker_tags';
|
45
|
+
|
46
|
+
if ($scope.tag) {
|
47
|
+
$scope.panel.loading = false;
|
48
|
+
}
|
49
|
+
|
50
|
+
if ($scope.tag && $scope.tag.related_tags) {
|
51
|
+
renderTable();
|
52
|
+
} else {
|
53
|
+
$scope.tag.$promise.then(renderTable);
|
54
|
+
}
|
55
|
+
|
56
|
+
$scope.getManifestType = function (schema) {
|
57
|
+
if (schema['manifest_type'] === 'image') {
|
58
|
+
return translate("Image");
|
59
|
+
}
|
60
|
+
return translate("List");
|
61
|
+
};
|
62
|
+
|
63
|
+
}
|
64
|
+
]);
|
@@ -46,6 +46,7 @@ angular.module('Bastion.docker-tags').config(['$stateProvider', function ($state
|
|
46
46
|
url: '/environments',
|
47
47
|
permission: 'view_environments',
|
48
48
|
templateUrl: 'docker-tags/details/views/docker-tag-environments.html',
|
49
|
+
controller: 'DockerTagEnvironmentsController',
|
49
50
|
ncyBreadcrumb: {
|
50
51
|
label: "{{ 'Lifecycle Environments' | translate }}",
|
51
52
|
parent: 'docker-tag.info'
|
@@ -115,24 +115,20 @@ angular.module('Bastion.errata').controller('ApplyErrataController',
|
|
115
115
|
HostBulkAction.installContent(params, transitionToTask, error);
|
116
116
|
};
|
117
117
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
});
|
125
|
-
}
|
118
|
+
$scope.selectedContentHosts = IncrementalUpdate.getBulkContentHosts();
|
119
|
+
$scope.selectedContentHosts['errata_ids'] = IncrementalUpdate.getErrataIds();
|
120
|
+
$scope.selectedContentHosts['organization_id'] = CurrentOrganization;
|
121
|
+
HostBulkAction.availableIncrementalUpdates($scope.selectedContentHosts, function (updates) {
|
122
|
+
$scope.updates = updates;
|
123
|
+
});
|
126
124
|
|
127
125
|
$scope.confirmApply = function() {
|
128
126
|
$scope.applyingErrata = true;
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
}
|
135
|
-
});
|
127
|
+
if ($scope.updates.length === 0) {
|
128
|
+
applyErrata();
|
129
|
+
} else {
|
130
|
+
incrementalUpdate();
|
131
|
+
}
|
136
132
|
};
|
137
133
|
|
138
134
|
$scope.incrementalUpdates = IncrementalUpdate.getIncrementalUpdates();
|
@@ -80,6 +80,9 @@ angular.module('Bastion.errata').controller('ErratumContentHostsController',
|
|
80
80
|
|
81
81
|
$scope.goToNextStep = function () {
|
82
82
|
IncrementalUpdate.setBulkContentHosts(nutupane.getAllSelectedResults());
|
83
|
+
if ($scope.errata) {
|
84
|
+
IncrementalUpdate.setErrataIds([$scope.errata['errata_id']]);
|
85
|
+
}
|
83
86
|
|
84
87
|
if ($scope.errata && $scope.errata.id) {
|
85
88
|
$scope.transitionTo('erratum.apply', {errataId: $scope.errata.id});
|
@@ -129,17 +129,6 @@
|
|
129
129
|
searchId = Task.registerSearch(taskSearchParams, taskSearchComplete);
|
130
130
|
return deferred.promise;
|
131
131
|
};
|
132
|
-
|
133
|
-
/**
|
134
|
-
* Determines whether or not errata can be applied.
|
135
|
-
*
|
136
|
-
* For now, simply checks if the parameters exist.
|
137
|
-
*
|
138
|
-
* @returns boolean
|
139
|
-
*/
|
140
|
-
this.canApply = function () {
|
141
|
-
return this.errataIds.length > 0 && this.contentHostIds.length > 0;
|
142
|
-
};
|
143
132
|
}
|
144
133
|
|
145
134
|
angular.module('Bastion.errata').service('IncrementalUpdate', IncrementalUpdate);
|
data/lib/katello/engine.rb
CHANGED
@@ -40,7 +40,8 @@ module Katello
|
|
40
40
|
:url => 'https://localhost:8443/candlepin',
|
41
41
|
:oauth_key => 'katello',
|
42
42
|
:oauth_secret => 'katello',
|
43
|
-
:ca_cert_file => nil
|
43
|
+
:ca_cert_file => nil,
|
44
|
+
:bulk_load_size => 1000
|
44
45
|
}
|
45
46
|
}
|
46
47
|
|
@@ -193,6 +194,7 @@ module Katello
|
|
193
194
|
::Setting.send :include, Katello::Concerns::SettingExtensions
|
194
195
|
::Container.send :include, Katello::Concerns::ContainerExtensions
|
195
196
|
::DockerContainerWizardState.send :include, Katello::Concerns::DockerContainerWizardStateExtensions
|
197
|
+
::DockerContainerWizardStates::Image.send :include, Katello::Concerns::DockerContainerWizardStateImageExtensions
|
196
198
|
|
197
199
|
#Controller extensions
|
198
200
|
::HostsController.send :include, Katello::Concerns::HostsControllerExtensions
|
data/lib/katello/plugin.rb
CHANGED
@@ -244,16 +244,18 @@ Foreman::Plugin.register :katello do
|
|
244
244
|
'bastion/bastion/index_ie should have a permission that grants access'
|
245
245
|
])
|
246
246
|
|
247
|
-
|
248
|
-
base_scope
|
249
|
-
|
250
|
-
|
251
|
-
|
247
|
+
in_to_prepare do
|
248
|
+
add_controller_action_scope(HostsController, :index) do |base_scope|
|
249
|
+
base_scope
|
250
|
+
.preload(:content_view, :lifecycle_environment, :subscription_facet)
|
251
|
+
.preload(content_facet: [:bound_repositories, :content_view, :lifecycle_environment])
|
252
|
+
end
|
252
253
|
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
254
|
+
add_controller_action_scope(Api::V2::HostsController, :index) do |base_scope|
|
255
|
+
base_scope
|
256
|
+
.preload(:content_view, :lifecycle_environment, :subscription_facet)
|
257
|
+
.preload(content_facet: [:bound_repositories, :content_view, :lifecycle_environment])
|
258
|
+
end
|
257
259
|
end
|
258
260
|
|
259
261
|
register_info_provider Katello::Host::InfoProvider
|
@@ -1,42 +1,73 @@
|
|
1
1
|
namespace :katello do
|
2
2
|
desc "Cleans backend objects (hosts) that are missing in one or more backend systems. Run with COMMIT=true to commit changes."
|
3
3
|
task :clean_backend_objects => ["environment", "check_ping"] do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
class BackendCleaner
|
5
|
+
def initialize
|
6
|
+
@candlepin_uuids = []
|
7
|
+
@pulp_uuids = []
|
8
|
+
@katello_candlepin_uuids = []
|
9
|
+
@katello_pulp_uuids = []
|
10
|
+
end
|
11
|
+
|
12
|
+
def populate!
|
13
|
+
@candlepin_uuids = Katello::Resources::Candlepin::Consumer.all_uuids
|
14
|
+
@katello_candlepin_uuids = Katello::Host::SubscriptionFacet.pluck(:uuid).compact
|
15
|
+
|
16
|
+
@pulp_uuids = ::Katello.pulp_server.extensions.consumer.retrieve_all.map { |consumer| consumer['id'] }
|
17
|
+
@katello_pulp_uuids = Katello::Host::ContentFacet.pluck(:uuid).compact
|
18
|
+
end
|
19
|
+
|
20
|
+
def hosts_with_no_subscriptions
|
21
|
+
::Host.where(:id => Katello::Host::SubscriptionFacet.where(:uuid => @katello_candlepin_uuids - @candlepin_uuids).select(:host_id))
|
22
|
+
end
|
23
|
+
|
24
|
+
def hosts_with_no_content
|
25
|
+
::Host.where(:id => Katello::Host::ContentFacet.where(:uuid => @katello_pulp_uuids - @pulp_uuids).select(:host_id))
|
26
|
+
end
|
27
|
+
|
28
|
+
def hosts_with_nil_facets
|
29
|
+
nil_sub = Katello::Host::SubscriptionFacet.where(:uuid => nil).select(:host_id).to_sql
|
30
|
+
::Host.where(" id in (#{nil_sub})")
|
10
31
|
end
|
11
|
-
end
|
12
32
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
33
|
+
def cp_orphaned_host_uuids
|
34
|
+
@candlepin_uuids - @katello_candlepin_uuids
|
35
|
+
end
|
36
|
+
|
37
|
+
def pulp_orphaned_host_uuids
|
38
|
+
@pulp_uuids - @katello_pulp_uuids
|
18
39
|
end
|
19
40
|
end
|
20
41
|
|
21
|
-
def
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
42
|
+
def cleanup_hosts(cleaner)
|
43
|
+
cleaner.hosts_with_nil_facets.each do |host|
|
44
|
+
print "Host #{host.id} #{host.name} is partially missing subscription information. Un-registering\n"
|
45
|
+
execute("Failed to delete host") { ForemanTasks.sync_task(::Actions::Katello::Host::Unregister, host) }
|
46
|
+
end
|
47
|
+
|
48
|
+
cleaner.hosts_with_no_subscriptions.each do |host|
|
49
|
+
print "Host #{host.id} #{host.name} #{host.subscription_facet.try(:uuid)} is partially missing subscription information. Un-registering\n"
|
50
|
+
execute("Failed to delete host") { ForemanTasks.sync_task(::Actions::Katello::Host::Unregister, host) }
|
51
|
+
end
|
52
|
+
|
53
|
+
cleaner.hosts_with_no_content.each do |host|
|
54
|
+
print "Host #{host.id} #{host.name} #{host.content_facet.try(:uuid)} is partially missing content information. Un-registering\n"
|
55
|
+
execute("Failed to delete host") { ForemanTasks.sync_task(::Actions::Katello::Host::Unregister, host) }
|
28
56
|
end
|
29
57
|
end
|
30
58
|
|
31
|
-
def
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
59
|
+
def clean_backend_orphans(cleaner)
|
60
|
+
cp_uuids = cleaner.cp_orphaned_host_uuids
|
61
|
+
print "#{cp_uuids.count} orphaned consumer id(s) found in candlepin.\n"
|
62
|
+
cp_uuids.each do |consumer_id|
|
63
|
+
execute("exception when destroying candlepin consumer #{consumer_id}") { Katello::Resources::Candlepin::Consumer.destroy(consumer_id) }
|
64
|
+
end
|
65
|
+
|
66
|
+
pulp_uuids = cleaner.pulp_orphaned_host_uuids
|
67
|
+
print "#{pulp_uuids.count} orphaned consumer id(s) found in pulp.\n"
|
68
|
+
pulp_uuids.each do |consumer_id|
|
69
|
+
execute("exception when destroying pulp consumer #{consumer_id}") { Katello.pulp_server.extensions.consumer.delete(consumer_id) }
|
70
|
+
end
|
40
71
|
end
|
41
72
|
|
42
73
|
# rubocop:disable HandleExceptions
|
@@ -50,21 +81,16 @@ namespace :katello do
|
|
50
81
|
print e.inspect
|
51
82
|
end
|
52
83
|
|
53
|
-
def clean_backend_orphans
|
54
|
-
consumer_ids = Katello::Candlepin::Consumer.orphaned_consumer_ids
|
55
|
-
print "#{consumer_ids.count} orphaned consumer id(s) found.\n"
|
56
|
-
consumer_ids.each do |consumer_id|
|
57
|
-
execute("exception when destroying candlepin consumer #{consumer_id}") { Katello::Resources::Candlepin::Consumer.destroy(consumer_id) }
|
58
|
-
execute("exception when destroying pulp consumer #{consumer_id}") { Katello.pulp_server.extensions.consumer.delete(consumer_id) }
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
84
|
unless ENV['COMMIT'] == 'true'
|
63
85
|
print "The following changes will not actually be performed. Rerun with COMMIT=true to apply the changes\n"
|
64
86
|
end
|
65
87
|
|
88
|
+
SETTINGS[:katello][:candlepin][:bulk_load_size] = 15_000
|
66
89
|
User.current = User.anonymous_admin
|
67
|
-
|
68
|
-
|
90
|
+
cleaner = BackendCleaner.new
|
91
|
+
cleaner.populate!
|
92
|
+
|
93
|
+
cleanup_hosts(cleaner)
|
94
|
+
clean_backend_orphans(cleaner)
|
69
95
|
end
|
70
96
|
end
|
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.5.0
|
4
|
+
version: 3.5.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: 2017-
|
11
|
+
date: 2017-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -156,7 +156,7 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - ">="
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 2.
|
159
|
+
version: 2.5.0
|
160
160
|
- - "<"
|
161
161
|
- !ruby/object:Gem::Version
|
162
162
|
version: 3.0.0
|
@@ -166,7 +166,7 @@ dependencies:
|
|
166
166
|
requirements:
|
167
167
|
- - ">="
|
168
168
|
- !ruby/object:Gem::Version
|
169
|
-
version: 2.
|
169
|
+
version: 2.5.0
|
170
170
|
- - "<"
|
171
171
|
- !ruby/object:Gem::Version
|
172
172
|
version: 3.0.0
|
@@ -844,6 +844,7 @@ files:
|
|
844
844
|
- app/models/katello/concerns/content_facet_host_extensions.rb
|
845
845
|
- app/models/katello/concerns/content_view_filter_rule_common.rb
|
846
846
|
- app/models/katello/concerns/docker_container_wizard_state_extensions.rb
|
847
|
+
- app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb
|
847
848
|
- app/models/katello/concerns/environment_extensions.rb
|
848
849
|
- app/models/katello/concerns/host_managed_extensions.rb
|
849
850
|
- app/models/katello/concerns/hostgroup_extensions.rb
|
@@ -1416,6 +1417,7 @@ files:
|
|
1416
1417
|
- db/migrate/20170718142148_create_katello_subscription_facet_pools.rb
|
1417
1418
|
- db/migrate/20170821170915_add_index_to_installed_packages.rb
|
1418
1419
|
- db/migrate/20170821170916_add_nvra_index_to_installed_packages.rb
|
1420
|
+
- db/migrate/20170822104447_add_katello_content_to_image.rb
|
1419
1421
|
- db/migrate/20170913183848_add_errata_counts.rb
|
1420
1422
|
- db/migrate/20171010170443_add_index_to_katello_content_facet_errata.rb
|
1421
1423
|
- db/seeds.d/101-locations.rb
|
@@ -1641,6 +1643,7 @@ files:
|
|
1641
1643
|
- engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-manifests/docker-manifest.factory.js
|
1642
1644
|
- engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-manifests/docker-manifests.module.js
|
1643
1645
|
- engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/docker-tag-details.controller.js
|
1646
|
+
- engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/docker-tag-environments.controller.js
|
1644
1647
|
- engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/views/docker-tag-details.html
|
1645
1648
|
- engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/views/docker-tag-environments.html
|
1646
1649
|
- engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/views/docker-tag-info.html
|
@@ -2089,9 +2092,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
2089
2092
|
version: '0'
|
2090
2093
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
2091
2094
|
requirements:
|
2092
|
-
- - "
|
2095
|
+
- - ">="
|
2093
2096
|
- !ruby/object:Gem::Version
|
2094
|
-
version:
|
2097
|
+
version: '0'
|
2095
2098
|
requirements: []
|
2096
2099
|
rubyforge_project:
|
2097
2100
|
rubygems_version: 2.4.6
|