katello 3.18.0.rc1 → 3.18.0.rc2

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.

Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/v2/content_view_filters_controller.rb +17 -8
  3. data/app/controllers/katello/api/v2/content_view_versions_controller.rb +5 -2
  4. data/app/controllers/katello/api/v2/content_views_controller.rb +10 -1
  5. data/app/controllers/katello/api/v2/host_debs_controller.rb +1 -0
  6. data/app/controllers/katello/api/v2/host_errata_controller.rb +2 -2
  7. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +18 -6
  8. data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +1 -1
  9. data/app/controllers/katello/api/v2/products_controller.rb +9 -9
  10. data/app/controllers/katello/api/v2/repository_sets_controller.rb +24 -14
  11. data/app/controllers/katello/concerns/api/v2/authorization.rb +10 -0
  12. data/app/controllers/katello/concerns/api/v2/bulk_hosts_extensions.rb +22 -18
  13. data/app/controllers/katello/concerns/registration_controller_extensions.rb +16 -0
  14. data/app/lib/actions/helpers/smart_proxy_sync_history_helper.rb +24 -0
  15. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +16 -7
  16. data/app/lib/actions/katello/content_view/publish.rb +5 -4
  17. data/app/lib/actions/katello/content_view_version/import.rb +3 -10
  18. data/app/lib/actions/katello/host/upload_package_profile.rb +3 -1
  19. data/app/lib/actions/katello/host/upload_profiles.rb +8 -6
  20. data/app/lib/actions/katello/repository/import_upload.rb +2 -0
  21. data/app/lib/actions/katello/repository/remove_content.rb +1 -1
  22. data/app/lib/actions/katello/repository/sync.rb +3 -1
  23. data/app/lib/actions/katello/repository/update.rb +1 -0
  24. data/app/lib/actions/katello/repository/upload_files.rb +1 -0
  25. data/app/lib/actions/middleware/record_smart_proxy_sync_history.rb +15 -0
  26. data/app/lib/actions/pulp/consumer/sync_capsule.rb +4 -2
  27. data/app/lib/actions/pulp/repository/distributor_publish.rb +1 -1
  28. data/app/lib/actions/pulp3/abstract_async_task.rb +1 -0
  29. data/app/lib/actions/pulp3/capsule_content/sync.rb +1 -0
  30. data/app/lib/actions/pulp3/content_view_version/export.rb +5 -1
  31. data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +23 -6
  32. data/app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb +4 -1
  33. data/app/models/katello/authorization/content_view_filter.rb +15 -0
  34. data/app/models/katello/concerns/smart_proxy_extensions.rb +2 -0
  35. data/app/models/katello/content_view.rb +25 -4
  36. data/app/models/katello/content_view_filter.rb +5 -0
  37. data/app/models/katello/content_view_puppet_module.rb +8 -0
  38. data/app/models/katello/content_view_repository.rb +13 -1
  39. data/app/models/katello/ping.rb +8 -3
  40. data/app/models/katello/repository.rb +26 -0
  41. data/app/models/katello/smart_proxy_sync_history.rb +8 -0
  42. data/app/services/katello/pulp3/content_view_version/export.rb +64 -6
  43. data/app/services/katello/pulp3/content_view_version/import.rb +2 -27
  44. data/app/services/katello/pulp3/content_view_version/import_export_common.rb +6 -0
  45. data/app/services/katello/pulp3/content_view_version/import_validator.rb +107 -0
  46. data/app/services/katello/pulp3/migration.rb +7 -1
  47. data/app/services/katello/pulp3/repository/yum.rb +1 -2
  48. data/app/services/katello/pulp3/task.rb +3 -3
  49. data/app/services/katello/pulp3/task_group.rb +6 -0
  50. data/app/services/katello/repository_type.rb +2 -1
  51. data/app/services/katello/smart_proxy_helper.rb +9 -0
  52. data/app/views/foreman/hosts/_registration.html.erb +12 -0
  53. data/app/views/katello/api/v2/content_views/base.json.rabl +1 -0
  54. data/db/migrate/20200929200357_create_katello_smart_proxy_sync_history.rb +13 -0
  55. data/db/migrate/20201021150008_add_import_only_to_katello_content_view.rb +5 -0
  56. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.controller.js +6 -2
  57. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +12 -0
  58. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details.html +7 -7
  59. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-info.html +7 -1
  60. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js +17 -3
  61. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/views/content-view-new.html +16 -2
  62. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/views/content-views.html +5 -0
  63. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository-types.service.js +8 -1
  64. data/lib/katello/engine.rb +1 -0
  65. data/lib/katello/permission_creator.rb +11 -11
  66. data/lib/katello/plugin.rb +6 -1
  67. data/lib/katello/tasks/pulp3_migration_abort.rake +17 -0
  68. data/lib/katello/version.rb +1 -1
  69. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +13 -11
  70. data/webpack/test-utils/react-testing-lib-wrapper.js +3 -0
  71. metadata +12 -3
  72. data/webpack/__mocks__/foremanReact/components/common/Fill/GlobalFill.js +0 -3
@@ -73,6 +73,12 @@ module Katello
73
73
  end
74
74
 
75
75
  def cancel
76
+ tasks_api = ::Katello::Pulp3::Api::Core.new(@smart_proxy).tasks_api
77
+ tasks_response = tasks_api.list(task_group: task_group_data['pulp_href'])
78
+ data = PulpcoreClient::TaskResponse.new(state: 'canceled')
79
+ tasks_response.results.collect do |result|
80
+ tasks_api.tasks_cancel(result.pulp_href, data)
81
+ end
76
82
  end
77
83
  end
78
84
  end
@@ -70,7 +70,8 @@ module Katello
70
70
  {
71
71
  :name => self.id.to_s,
72
72
  :id => self.id,
73
- :creatable => @allow_creation_by_user
73
+ :creatable => @allow_creation_by_user,
74
+ :pulp3_support => SmartProxy.pulp_primary.pulp3_repository_type_support?(self)
74
75
  }
75
76
  end
76
77
 
@@ -21,6 +21,15 @@ module Katello
21
21
  end
22
22
  end
23
23
 
24
+ def clear_smart_proxy_sync_histories(repo_list = [])
25
+ if repo_list.empty?
26
+ @smart_proxy.smart_proxy_sync_histories.delete_all
27
+ return
28
+ end
29
+ repo_ids = repo_list.map(&:id)
30
+ @smart_proxy.smart_proxy_sync_histories.where("repository_id IN (?)", repo_ids).delete_all
31
+ end
32
+
24
33
  def combined_repos_available_to_capsule(environment = nil, content_view = nil, repository = nil)
25
34
  lifecycle_environment_check(environment, repository)
26
35
  if repository
@@ -0,0 +1,12 @@
1
+ <div class='form-group'>
2
+ <label class='col-md-2 control-label'>
3
+ <%= _('Activation Key(s)') %>
4
+ <% help = _('Activation key(s) for Subscription Manager. Required for CentOS and Red Hat Enterprise Linux. Multiple keys add separated by comma, example: key1,key2,key3.') %>
5
+ <a rel="popover" data-content="<%= help %>" data-trigger="focus" data-container="body" data-html="true" tabindex="-1">
6
+ <span class="pficon pficon-info "></span>
7
+ </a>
8
+ </label>
9
+ <div class='col-md-4'>
10
+ <%= text_field_tag 'activation_key', params[:activation_key], class: 'form-control' %>
11
+ </div>
12
+ </div>
@@ -9,6 +9,7 @@ attributes :version_count
9
9
  attributes :latest_version
10
10
  attributes :auto_publish
11
11
  attributes :solve_dependencies
12
+ attributes :import_only
12
13
 
13
14
  node :next_version do |content_view|
14
15
  content_view.next_version.to_f.to_s
@@ -0,0 +1,13 @@
1
+ class CreateKatelloSmartProxySyncHistory < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :katello_smart_proxy_sync_history do |t|
4
+ t.references :smart_proxy, :null => false
5
+ t.references :repository, :null => false
6
+ t.datetime :started_at
7
+ t.datetime :finished_at
8
+ end
9
+ add_index "katello_smart_proxy_sync_history", ["smart_proxy_id"], :name => "index_spsh_smart_proxy_id"
10
+ add_index "katello_smart_proxy_sync_history", ["repository_id"], :name => "index_spsh_repository_id"
11
+ add_index "katello_smart_proxy_sync_history", [:smart_proxy_id, :repository_id], :unique => true, :name => 'index_spsh_smart_proxy_repository_unique'
12
+ end
13
+ end
@@ -0,0 +1,5 @@
1
+ class AddImportOnlyToKatelloContentView < ActiveRecord::Migration[6.0]
2
+ def change
3
+ add_column :katello_content_views, :import_only, :boolean, :default => false, :null => false
4
+ end
5
+ end
@@ -13,8 +13,8 @@
13
13
  * within the table.
14
14
  */
15
15
  angular.module('Bastion.content-views').controller('ContentViewsController',
16
- ['$scope', 'Nutupane', 'ContentView', 'CurrentOrganization',
17
- function ($scope, Nutupane, ContentView, CurrentOrganization) {
16
+ ['$scope', 'Nutupane', 'ContentView', 'CurrentOrganization', 'RepositoryTypesService',
17
+ function ($scope, Nutupane, ContentView, CurrentOrganization, RepositoryTypesService) {
18
18
 
19
19
  var nutupane = new Nutupane(ContentView, {
20
20
  'nondefault': true,
@@ -26,5 +26,9 @@ angular.module('Bastion.content-views').controller('ContentViewsController',
26
26
  $scope.controllerName = 'katello_content_views';
27
27
 
28
28
  $scope.table = nutupane.table;
29
+
30
+ $scope.importOnlyEnabled = function() {
31
+ return RepositoryTypesService.pulp3Supported('yum');
32
+ };
29
33
  }]
30
34
  );
@@ -84,5 +84,17 @@ angular.module('Bastion.content-views').controller('ContentViewDetailsController
84
84
  };
85
85
 
86
86
  $scope.fetchContentView();
87
+
88
+ $scope.$watch('contentView.import_only', function () {
89
+ if ($scope.contentView.import_only) {
90
+ /* eslint-disable camelcase */
91
+ $scope.contentView.solve_dependencies = false;
92
+ /* eslint-enable camelcase */
93
+ }
94
+ });
95
+
96
+ $scope.importOnlyEnabled = function() {
97
+ return RepositoryTypesService.pulp3Supported('yum');
98
+ };
87
99
  }]
88
100
  );
@@ -13,7 +13,7 @@
13
13
  </div>
14
14
 
15
15
  <nav data-block="item-actions">
16
- <button type="button" class="btn btn-primary" ng-hide="denied('publish_content_views', contentView)"
16
+ <button type="button" class="btn btn-primary" ng-hide="denied('publish_content_views', contentView) || contentView.import_only"
17
17
  ui-sref="content-view.publish">
18
18
  <span translate>Publish New Version</span>
19
19
  </button>
@@ -73,7 +73,7 @@
73
73
  Repositories
74
74
  </a>
75
75
  </li>
76
- <li>
76
+ <li ng-hide="contentView.import_only">
77
77
  <a ui-sref="content-view.yum.filters" translate>
78
78
  Filters
79
79
  </a>
@@ -82,21 +82,21 @@
82
82
  </li>
83
83
 
84
84
  <li ng-class="{active: stateIncludes('content-view.repositories.deb')}"
85
- ng-hide="contentView.composite || !repositoryTypeEnabled('deb')">
85
+ ng-hide="contentView.composite || contentView.import_only || !repositoryTypeEnabled('deb')">
86
86
  <a ui-sref="content-view.repositories.deb.list" translate>
87
87
  Apt Repositories
88
88
  </a>
89
89
  </li>
90
90
 
91
91
  <li ng-class="{active: stateIncludes('content-view.repositories.file')}"
92
- ng-hide="contentView.composite || !repositoryTypeEnabled('file')">
92
+ ng-hide="contentView.composite || contentView.import_only || !repositoryTypeEnabled('file')">
93
93
  <a ui-sref="content-view.repositories.file.list" translate>
94
94
  File Repositories
95
95
  </a>
96
96
  </li>
97
97
 
98
98
  <li ng-class="{active: stateIncludes('content-view.puppet-modules')}"
99
- ng-hide="contentView.composite || !repositoryTypeEnabled('puppet')">
99
+ ng-hide="contentView.composite || contentView.import_only || !repositoryTypeEnabled('puppet')">
100
100
  <a ui-sref="content-view.puppet-modules.list" translate>
101
101
  Puppet Modules
102
102
  </a>
@@ -104,7 +104,7 @@
104
104
 
105
105
  <li uib-dropdown
106
106
  ng-class="{active: stateIncludes('content-view.repositories.docker') || stateIncludes('content-view.docker.filters')}"
107
- ng-hide="contentView.composite || !repositoryTypeEnabled('docker')">
107
+ ng-hide="contentView.composite || contentView.import_only || !repositoryTypeEnabled('docker')">
108
108
  <a uib-dropdown-toggle>
109
109
  <span translate>Container Images</span>
110
110
  <i class="fa fa-chevron-down"></i>
@@ -124,7 +124,7 @@
124
124
  </li>
125
125
 
126
126
  <li ng-class="{active: stateIncludes('content-view.repositories.ostree')}"
127
- ng-hide="contentView.composite || !repositoryTypeEnabled('ostree')">
127
+ ng-hide="contentView.composite || contentView.import_only || !repositoryTypeEnabled('ostree')">
128
128
  <a ui-sref="content-view.repositories.ostree.list" translate>
129
129
  OSTree Content
130
130
  </a>
@@ -24,6 +24,12 @@
24
24
  <dd ng-show="contentView.composite" translate>Yes</dd>
25
25
  <dd ng-hide="contentView.composite" translate>No</dd>
26
26
 
27
+ <div ng-show="importOnlyEnabled()">
28
+ <dt translate>Import-only</dt>
29
+ <dd ng-show="contentView.import_only" translate>Yes</dd>
30
+ <dd ng-hide="contentView.import_only" translate>No</dd>
31
+ </div>
32
+
27
33
  <dt translate>Force Puppet Environment</dt>
28
34
  <dd>
29
35
  <div bst-edit-checkbox="contentView.force_puppet_environment"
@@ -50,7 +56,7 @@
50
56
  </dd>
51
57
  </div>
52
58
 
53
- <div>
59
+ <div ng-if="!contentView.import_only">
54
60
  <dt translate>Solve Dependencies</dt>
55
61
  <dd>
56
62
  <div bst-edit-checkbox="contentView.solve_dependencies"
@@ -11,8 +11,8 @@
11
11
  * @description
12
12
  */
13
13
  angular.module('Bastion.content-views').controller('NewContentViewController',
14
- ['$scope', 'ContentView', 'FormUtils', 'CurrentOrganization', 'contentViewSolveDependencies',
15
- function ($scope, ContentView, FormUtils, CurrentOrganization, contentViewSolveDependencies) {
14
+ ['$scope', 'ContentView', 'FormUtils', 'CurrentOrganization', 'contentViewSolveDependencies', 'RepositoryTypesService',
15
+ function ($scope, ContentView, FormUtils, CurrentOrganization, contentViewSolveDependencies, RepositoryTypesService) {
16
16
 
17
17
  function success(response) {
18
18
  var successState = 'content-view.repositories.yum.available';
@@ -44,17 +44,31 @@ angular.module('Bastion.content-views').controller('NewContentViewController',
44
44
  contentView.$save(success, error);
45
45
  };
46
46
 
47
+ $scope.importOnlyEnabled = function() {
48
+ return RepositoryTypesService.pulp3Supported('yum');
49
+ };
50
+
47
51
  $scope.$watch('contentView.name', function () {
48
- if ($scope.contentViewForm.name) {
52
+ if ($scope.contentViewForm && $scope.contentViewForm.name) {
49
53
  $scope.contentViewForm.name.$setValidity('server', true);
50
54
  FormUtils.labelize($scope.contentView);
51
55
  }
52
56
  });
53
57
 
58
+ $scope.$watch('contentView.import_only', function () {
59
+ if ($scope.contentView.import_only) {
60
+ $scope.contentView.composite = false;
61
+ /* eslint-disable camelcase */
62
+ $scope.contentView.solve_dependencies = false;
63
+ /* eslint-enable camelcase */
64
+ }
65
+ });
66
+
54
67
  $scope.$watch('contentView.composite', function () {
55
68
  if ($scope.contentView.composite) {
56
69
  /* eslint-disable camelcase */
57
70
  $scope.contentView.solve_dependencies = false;
71
+ $scope.contentView.import_only = false;
58
72
  } else {
59
73
  $scope.contentView.auto_publish = false;
60
74
  /* eslint-enable camelcase */
@@ -56,7 +56,7 @@
56
56
  </textarea>
57
57
  </div>
58
58
 
59
- <div bst-form-group>
59
+ <div bst-form-group ng-hide="contentView.import_only">
60
60
  <div class="checkbox">
61
61
  <label for="composite">
62
62
  <input id="composite"
@@ -70,7 +70,21 @@
70
70
  <p class="help-block" translate>A composite view contains other content views.</p>
71
71
  </div>
72
72
 
73
- <div bst-form-group ng-hide="contentView.composite">
73
+ <div bst-form-group ng-hide="!importOnlyEnabled() || contentView.composite">
74
+ <div class="checkbox">
75
+ <label for="import_only">
76
+ <input id="import_only"
77
+ name="import_only"
78
+ ng-model="contentView.import_only"
79
+ type="checkbox"
80
+ tabindex="4"/>
81
+ <span translate>Import-only</span>
82
+ </label>
83
+ </div>
84
+ <p class="help-block" translate>Designate whether this Content View is for importing from an upstream server. Import-only Content Views can not be published directly.</p>
85
+ </div>
86
+
87
+ <div bst-form-group ng-hide="contentView.composite || contentView.import_only">
74
88
  <div class="checkbox">
75
89
  <label for="solve_dependencies">
76
90
  <input id="solve_dependencies"
@@ -29,6 +29,7 @@
29
29
  <tr bst-table-head>
30
30
  <th bst-table-column><span translate>Name</span></th>
31
31
  <th bst-table-column><span translate>Composite View?</span></th>
32
+ <th bst-table-column ng-show="importOnlyEnabled()"><span translate>Import-only?</span></th>
32
33
  <th bst-table-column><span translate>Last Published</span></th>
33
34
  <th bst-table-column><span translate>Environments</span></th>
34
35
  <th bst-table-column><span translate>Repositories</span></th>
@@ -46,6 +47,10 @@
46
47
  <span ng-show="contentView.composite" translate>Yes</span>
47
48
  <span ng-hide="contentView.composite" translate>No</span>
48
49
  </td>
50
+ <td bst-table-cell ng-show="importOnlyEnabled()">
51
+ <span ng-show="contentView.import_only" translate>Yes</span>
52
+ <span ng-hide="contentView.import_only" translate>No</span>
53
+ </td>
49
54
  <td bst-table-cell>
50
55
  <span ng-show="contentView.last_published"><long-date-time date="contentView.last_published" /></span>
51
56
  <span ng-hide="contentView.last_published" translate>
@@ -11,7 +11,6 @@
11
11
  * current state of the application.
12
12
  */
13
13
  function RepositoryTypesService(repositoryTypes) {
14
-
15
14
  this.repositoryTypes = function () {
16
15
  return repositoryTypes;
17
16
  };
@@ -28,6 +27,14 @@
28
27
  });
29
28
  return angular.isDefined(found);
30
29
  };
30
+
31
+ this.pulp3Supported = function(desiredType) {
32
+ var found = _.find(repositoryTypes, function(type) {
33
+ return type.id === desiredType;
34
+ });
35
+
36
+ return found.pulp3_support;
37
+ };
31
38
  }
32
39
 
33
40
  angular
@@ -178,6 +178,7 @@ module Katello
178
178
  ::SmartProxiesController.include Katello::Concerns::SmartProxiesControllerExtensions
179
179
  ::Foreman::Plugin.fact_importer_registry.register(Katello::RhsmFactName::FACT_TYPE, Katello::RhsmFactImporter)
180
180
  ::FactParser.register_fact_parser(Katello::RhsmFactName::FACT_TYPE, Katello::RhsmFactParser)
181
+ ::RegistrationController.include Katello::Concerns::RegistrationControllerExtensions
181
182
 
182
183
  #Helper Extensions
183
184
  ::SmartProxiesController.class_eval do
@@ -292,7 +292,8 @@ module Katello
292
292
  :repo_puppet_modules,
293
293
  :repo_compare_errata,
294
294
  :repo_compare_packages,
295
- :repo_compare_puppet_modules]
295
+ :repo_compare_puppet_modules],
296
+ 'katello/api/v2/repository_sets' => [:index, :show, :available_repositories, :auto_complete_search]
296
297
  },
297
298
  :resource_type => 'Katello::Product',
298
299
  :finder_scope => :readable
@@ -301,14 +302,16 @@ module Katello
301
302
  'katello/api/v2/products' => [:create],
302
303
  'katello/api/v2/package_groups' => [:create]
303
304
  },
304
- :resource_type => 'Katello::Product'
305
+ :resource_type => 'Katello::Product',
306
+ :finder_scope => :editable
305
307
  @plugin.permission :edit_products,
306
308
  {
307
309
  'katello/api/v2/products' => [:update],
308
310
  'katello/api/v2/repositories' => [:create, :update, :remove_content, :import_uploads, :upload_content, :republish, :verify_checksum],
309
311
  'katello/api/v2/products_bulk_actions' => [:update_sync_plans, :update_http_proxy, :verify_checksum_products],
310
312
  'katello/api/v2/content_uploads' => [:create, :update, :destroy],
311
- 'katello/api/v2/organizations' => [:repo_discover, :cancel_repo_discover]
313
+ 'katello/api/v2/organizations' => [:repo_discover, :cancel_repo_discover],
314
+ 'katello/api/v2/repository_sets' => [:enable, :disable]
312
315
  },
313
316
  :resource_type => 'Katello::Product',
314
317
  :finder_scope => :editable
@@ -341,11 +344,10 @@ module Katello
341
344
  :finder_scope => :exportable
342
345
  end
343
346
 
344
- def subscription_permissions # rubocop:disable Metrics/MethodLength
347
+ def subscription_permissions
345
348
  @plugin.permission :view_subscriptions,
346
349
  {
347
- 'katello/api/v2/subscriptions' => [:index, :show, :available, :manifest_history, :auto_complete_search],
348
- 'katello/api/v2/repository_sets' => [:index, :show, :available_repositories, :auto_complete_search]
350
+ 'katello/api/v2/subscriptions' => [:index, :show, :available, :manifest_history, :auto_complete_search]
349
351
  },
350
352
  :resource_type => 'Katello::Subscription'
351
353
  @plugin.permission :attach_subscriptions,
@@ -360,8 +362,7 @@ module Katello
360
362
  :resource_type => 'Katello::Subscription'
361
363
  @plugin.permission :import_manifest,
362
364
  {
363
- 'katello/api/v2/subscriptions' => [:upload, :refresh_manifest],
364
- 'katello/api/v2/repository_sets' => [:enable, :disable]
365
+ 'katello/api/v2/subscriptions' => [:upload, :refresh_manifest]
365
366
  },
366
367
  :resource_type => 'Katello::Subscription'
367
368
  @plugin.permission :delete_manifest,
@@ -376,11 +377,10 @@ module Katello
376
377
  :resource_type => 'Katello::Subscription'
377
378
  end
378
379
 
379
- def sync_plan_permissions # rubocop:disable Metrics/MethodLength
380
+ def sync_plan_permissions
380
381
  @plugin.permission :view_sync_plans,
381
382
  {
382
- 'katello/api/v2/sync_plans' => [:index, :show, :add_products, :remove_products, :available_products, :auto_complete_search],
383
- 'katello/api/v2/products' => [:index]
383
+ 'katello/api/v2/sync_plans' => [:index, :show, :add_products, :remove_products, :available_products, :auto_complete_search]
384
384
  },
385
385
  :resource_type => 'Katello::SyncPlan',
386
386
  :finder_scope => :readable
@@ -3,7 +3,7 @@ require 'katello/repository_types.rb'
3
3
  require 'katello/host_status_manager.rb'
4
4
  # rubocop:disable Metrics/BlockLength
5
5
  Foreman::Plugin.register :katello do
6
- requires_foreman '>= 1.24'
6
+ requires_foreman '>= 2.3'
7
7
 
8
8
  sub_menu :top_menu, :content_menu, :caption => N_('Content'),
9
9
  :icon => 'fa fa-book', :after => :monitor_menu do
@@ -283,6 +283,11 @@ Foreman::Plugin.register :katello do
283
283
  # Extend Global Registration endpoint
284
284
  extend_allowed_registration_vars :activation_key
285
285
 
286
+ # Extend Global Registration UI
287
+ extend_page 'registration/_form' do |cx|
288
+ cx.add_pagelet :global_registration, name: N_('Katello'), partial: 'foreman/hosts/registration', priority: 100, id: 'katello'
289
+ end
290
+
286
291
  extend_page "smart_proxies/show" do |cx|
287
292
  cx.add_pagelet :details_content,
288
293
  :name => _('Storage'),
@@ -0,0 +1,17 @@
1
+ namespace :katello do
2
+ desc "Cancels all running Pulp 2 to 3 migration tasks."
3
+ task :pulp3_migration_abort => ["environment", "disable_dynflow"] do
4
+ migration_tasks = ForemanTasks::Task::DynflowTask.where(:label => "Actions::Pulp3::ContentMigration").where.not(:state => ["stopped", "paused"])
5
+ cancelled_tasks_count = 0
6
+ migration_tasks.each do |task|
7
+ task.execution_plan.steps.each do |_number, step|
8
+ if step.cancellable? && step.is_a?(Dynflow::ExecutionPlan::Steps::RunStep)
9
+ ::ForemanTasks.dynflow.world.event(task.execution_plan.id, step.id, Dynflow::Action::Cancellable::Cancel)
10
+ cancelled_tasks_count += 1
11
+ end
12
+ end
13
+ end
14
+
15
+ puts _("\e[33mCancelled #{cancelled_tasks_count} tasks.\e[0m")
16
+ end
17
+ end
@@ -1,3 +1,3 @@
1
1
  module Katello
2
- VERSION = "3.18.0.rc1".freeze
2
+ VERSION = "3.18.0.rc2".freeze
3
3
  end
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import { Grid, Col, Row, Tabs, Tab, Form, FormGroup, FormControl, ControlLabel } from 'react-bootstrap';
4
4
  import { Button, Spinner } from 'patternfly-react';
5
5
  import ForemanModal from 'foremanReact/components/ForemanModal';
6
+ import Slot from 'foremanReact/components/common/Slot';
6
7
  import { translate as __ } from 'foremanReact/common/I18n';
7
8
  import TooltipButton from '../../../components/TooltipButton';
8
9
  import { LoadingState } from '../../../components/LoadingState';
@@ -250,17 +251,17 @@ class ManageManifestModal extends Component {
250
251
  />
251
252
  }
252
253
  {canDeleteManifest &&
253
- <React.Fragment>
254
- <TooltipButton
255
- disabled={!isManifestImported || actionInProgress}
256
- bsStyle="danger"
257
- onClick={this.showDeleteManifestModal}
258
- title={__('Delete')}
259
- tooltipId="delete-manifest-button-tooltip"
260
- tooltipText={this.disabledTooltipText()}
261
- tooltipPlacement="top"
262
- />
263
- </React.Fragment>
254
+ <React.Fragment>
255
+ <TooltipButton
256
+ disabled={!isManifestImported || actionInProgress}
257
+ bsStyle="danger"
258
+ onClick={this.showDeleteManifestModal}
259
+ title={__('Delete')}
260
+ tooltipId="delete-manifest-button-tooltip"
261
+ tooltipText={this.disabledTooltipText()}
262
+ tooltipPlacement="top"
263
+ />
264
+ </React.Fragment>
264
265
  }
265
266
  </div>
266
267
  <ForemanModal title={__('Confirm delete manifest')} id={DELETE_MANIFEST_MODAL_ID}>
@@ -280,6 +281,7 @@ class ManageManifestModal extends Component {
280
281
  </FormGroup>
281
282
  </React.Fragment>
282
283
  }
284
+ <Slot id="katello-manage-manifest-form" multi />
283
285
  </Form>
284
286
  </Tab>
285
287
  }