katello 3.14.0.rc1 → 3.14.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 (77) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/katello/containers/container.js +5 -5
  3. data/app/assets/javascripts/katello/hosts/activation_key_edit.js +1 -1
  4. data/app/assets/javascripts/katello/hosts/host_and_hostgroup_edit.js +1 -1
  5. data/app/assets/javascripts/katello/sync_management/sync_management.js +6 -6
  6. data/app/controllers/katello/api/v2/repositories_controller.rb +1 -1
  7. data/app/lib/actions/katello/content_view/publish.rb +13 -4
  8. data/app/lib/actions/katello/content_view_puppet_environment/destroy.rb +3 -1
  9. data/app/lib/actions/katello/content_view_version/create_repos.rb +25 -0
  10. data/app/lib/actions/katello/content_view_version/incremental_update.rb +32 -12
  11. data/app/lib/actions/katello/environment/destroy.rb +5 -1
  12. data/app/lib/actions/katello/host/hypervisors_update.rb +12 -1
  13. data/app/lib/actions/katello/repository/clone_to_version.rb +3 -11
  14. data/app/lib/actions/pulp/repository/copy_units.rb +3 -6
  15. data/app/lib/actions/pulp/repository/refresh.rb +1 -1
  16. data/app/lib/actions/pulp/repository/sync.rb +3 -1
  17. data/app/lib/katello/resources/candlepin.rb +6 -0
  18. data/app/lib/katello/resources/candlepin/admin.rb +21 -0
  19. data/app/lib/katello/util/package_clause_generator.rb +10 -0
  20. data/app/lib/katello/util/support.rb +19 -0
  21. data/app/models/katello/glue/pulp/repo.rb +0 -13
  22. data/app/models/katello/host/subscription_facet.rb +2 -1
  23. data/app/models/katello/kt_environment.rb +1 -0
  24. data/app/models/katello/ping.rb +35 -3
  25. data/app/models/katello/repository.rb +5 -2
  26. data/app/models/katello/rhsm_fact_parser.rb +6 -1
  27. data/app/models/katello/root_repository.rb +1 -1
  28. data/app/services/katello/candlepin/consumer.rb +2 -1
  29. data/app/{lib/actions/candlepin/import_pool_handler.rb → services/katello/candlepin/event_handler.rb} +2 -2
  30. data/app/services/katello/candlepin_event_listener.rb +106 -0
  31. data/app/services/katello/candlepin_listening_service.rb +91 -0
  32. data/app/services/katello/event_daemon.rb +91 -0
  33. data/app/services/katello/event_monitor/poller_thread.rb +108 -0
  34. data/app/services/katello/event_queue.rb +4 -0
  35. data/app/services/katello/pulp/repository.rb +13 -6
  36. data/app/services/katello/pulp/repository/yum.rb +52 -12
  37. data/lib/katello/engine.rb +13 -14
  38. data/lib/katello/middleware/event_daemon.rb +14 -0
  39. data/lib/katello/plugin.rb +2 -0
  40. data/lib/katello/tasks/upgrade_check.rake +2 -7
  41. data/lib/katello/version.rb +1 -1
  42. data/locale/bn/katello.po +1 -1
  43. data/locale/cs/katello.po +1 -1
  44. data/locale/de/katello.po +2 -2
  45. data/locale/en/katello.po +1 -1
  46. data/locale/es/katello.po +2 -2
  47. data/locale/fr/katello.po +2 -2
  48. data/locale/gu/katello.po +1 -1
  49. data/locale/hi/katello.po +1 -1
  50. data/locale/it/katello.po +2 -2
  51. data/locale/ja/katello.po +2 -2
  52. data/locale/katello.pot +1 -1
  53. data/locale/kn/katello.po +1 -1
  54. data/locale/ko/katello.po +2 -2
  55. data/locale/mr/katello.po +1 -1
  56. data/locale/or/katello.po +1 -1
  57. data/locale/pa/katello.po +1 -1
  58. data/locale/pt/katello.po +1 -1
  59. data/locale/pt_BR/katello.po +2 -2
  60. data/locale/ru/katello.po +2 -2
  61. data/locale/ta/katello.po +1 -1
  62. data/locale/te/katello.po +1 -1
  63. data/locale/zh_CN/katello.po +2 -2
  64. data/locale/zh_TW/katello.po +2 -2
  65. data/webpack/components/Content/Details/__tests__/__snapshots__/ContentDetails.test.js.snap +2 -2
  66. data/webpack/scenes/RedHatRepositories/components/EnabledRepository/EnabledRepository.js +2 -2
  67. data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/RepositorySetRepository.js +3 -3
  68. data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +2 -2
  69. data/webpack/scenes/Subscriptions/SubscriptionsPage.scss +6 -0
  70. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +1 -1
  71. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.fixtures.js +1 -1
  72. metadata +11 -10
  73. data/app/lib/actions/candlepin/candlepin_listening_service.rb +0 -114
  74. data/app/lib/actions/candlepin/listen_on_candlepin_events.rb +0 -216
  75. data/app/lib/actions/katello/event_queue/monitor.rb +0 -122
  76. data/app/lib/actions/katello/event_queue/poller_thread.rb +0 -83
  77. data/app/lib/actions/katello/event_queue/suspended_action.rb +0 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1e2baddffe6d51af8dbaa2e187ada9d5be93c145a8b3bea3113b77f49592b14
4
- data.tar.gz: 3b42136f2440dc5c12e17472bcaa112d21a2d9e4db649dcbfcaa8f6b847d6732
3
+ metadata.gz: fdc69d79c80c2099fe91eff58b35861a0cebf3dd5ac4affa128d2b8751619769
4
+ data.tar.gz: 41cc9a3b3b657e44325274002b19884ae4c5b993c106ff191bfccf749d5a9a6c
5
5
  SHA512:
6
- metadata.gz: 179fe38f2b010e92ee61df9cec470142d2889ba0f03894eb7ac4ac4f4a96801f1e37106249dbdd3c851c2fdc7ed84b69ee001efa7f6e48c71d56c3618be1405b
7
- data.tar.gz: e98d76db3da13831b995f31bc5e6332ac7942e3179e679fb95756b911d0509313e31d09922cc6242eb0889abf1cb78aec72079c2601f9d7746d839f1d34b5b9e
6
+ metadata.gz: b28ea4eeb0db67f2b2bdba025b9191a57c54830e928f222b5c6f281eb1fc51a89cbb15d18f17eed853e914765ea57d9f1577f04a604fcc697786fe4c3b4217fd
7
+ data.tar.gz: e94f4bc8c64f672d5886ac900df8e13cc7322338fa048ec8eedcce1181adbaeb5c749119ebc86df734e021a014f89142554b236457fcb80819b535a2c60716dd
@@ -60,7 +60,7 @@ KT.container = (function(){
60
60
  noCapsules = $("#no_capsules"),
61
61
  org = getOrg(),
62
62
  spinner = $("#load_capsules"),
63
- url = foreman_url("/api/smart_proxies"),
63
+ url = tfm.tools.foremanUrl("/api/smart_proxies"),
64
64
  params = {
65
65
  organization_id: getOrg(),
66
66
  search: "feature = \"Pulp Node\" or feature = \"Pulp\"",
@@ -95,7 +95,7 @@ KT.container = (function(){
95
95
  var environmentDropdown = $('#kt_environment_id'),
96
96
  org = getOrg(),
97
97
  spinner = $("#load_environments"),
98
- url = foreman_url("/katello/api/organizations/" + org + "/environments");
98
+ url = tfm.tools.foremanUrl("/katello/api/organizations/" + org + "/environments");
99
99
 
100
100
  resetEnvironments();
101
101
  if (org !== "") {
@@ -121,7 +121,7 @@ KT.container = (function(){
121
121
  noCV = $("#no_content_views"),
122
122
  env = getEnvironment(),
123
123
  spinner = $("#load_content_views"),
124
- url = foreman_url("/katello/api/organizations/" + getOrg() + "/content_views");
124
+ url = tfm.tools.foremanUrl("/katello/api/organizations/" + getOrg() + "/content_views");
125
125
  params = {
126
126
  environment_id : env
127
127
  };
@@ -156,7 +156,7 @@ KT.container = (function(){
156
156
  noRepos = $("#no_repositories"),
157
157
  cv = getContentView(),
158
158
  spinner = $("#load_repositories"),
159
- url = foreman_url("/katello/api/repositories/"),
159
+ url = tfm.tools.foremanUrl("/katello/api/repositories/"),
160
160
  params = {
161
161
  organization_id: getOrg(),
162
162
  content_view_id: cv,
@@ -194,7 +194,7 @@ KT.container = (function(){
194
194
  var repo = getRepo(),
195
195
  tagsDropdown = $("#tag_id"),
196
196
  spinner = $("#load_tags"),
197
- url = foreman_url("/katello/api/repositories/" + repo + "/docker_tags"),
197
+ url = tfm.tools.foremanUrl("/katello/api/repositories/" + repo + "/docker_tags"),
198
198
  params = {};
199
199
 
200
200
  resetTags();
@@ -19,7 +19,7 @@ function ktLoadActivationKeys() {
19
19
  // environment & content view.
20
20
  $.ajax({
21
21
  type: 'get',
22
- url: foreman_url('/katello/api/v2/environments/' + getSelectedEnvId() + '/activation_keys'),
22
+ url: tfm.tools.foremanUrl('/katello/api/v2/environments/' + getSelectedEnvId() + '/activation_keys'),
23
23
  data: {'content_view_id': getSelectedContentViewId()},
24
24
  success: function(response) {
25
25
  KT.hosts.availableActivationKeys = {};
@@ -37,7 +37,7 @@ KT.hosts.fetchContentViews = function () {
37
37
  select.find('option').remove();
38
38
  if (envId) {
39
39
  KT.hosts.signalContentViewFetch(true);
40
- var url = foreman_url('/katello/api/v2/content_views/');
40
+ var url = tfm.tools.foremanUrl('/katello/api/v2/content_views/');
41
41
  $.get(url, {environment_id: envId, full_result: true}, function (data) {
42
42
  select.append($("<option />"));
43
43
  $.each(data.results, function(index, view) {
@@ -98,7 +98,7 @@ KT.content_actions = (function(){
98
98
 
99
99
  $.ajax({
100
100
  type: 'DELETE',
101
- url: foreman_url('/katello/sync_management/' + repo_id + '?organization_id=' + getOrg()),
101
+ url: tfm.tools.foremanUrl('/katello/sync_management/' + repo_id + '?organization_id=' + getOrg()),
102
102
  dataType: 'json',
103
103
  success: function(data) {
104
104
  },
@@ -112,7 +112,7 @@ KT.content_actions = (function(){
112
112
  if (syncing.length ===0){
113
113
  return;
114
114
  }
115
- var url = foreman_url('/katello/sync_management/sync_status');
115
+ var url = tfm.tools.foremanUrl('/katello/sync_management/sync_status');
116
116
  updater = $.PeriodicalUpdater(url, {
117
117
  data: function(){return {repoids:getSyncing(), organization_id:getOrg()}},
118
118
  method: 'get',
@@ -167,7 +167,7 @@ KT.content = (function(){
167
167
  progressBar = $('<a/>').attr('class', 'progress').text(" ");
168
168
 
169
169
  if(task_id !== undefined) {
170
- progressBar.attr('href', foreman_url('/foreman_tasks/tasks/' + task_id));
170
+ progressBar.attr('href', tfm.tools.foremanUrl('/foreman_tasks/tasks/' + task_id));
171
171
  }
172
172
 
173
173
  progress = progress ? progress : 0;
@@ -189,7 +189,7 @@ KT.content = (function(){
189
189
  finishRepo = function(repo_id, state, duration, raw_state, error_details, task_id){
190
190
  var element = $("#repo-" + repo_id);
191
191
  var messages = [];
192
- var url = foreman_url('/foreman_tasks/tasks/' + task_id);
192
+ var url = tfm.tools.foremanUrl('/foreman_tasks/tasks/' + task_id);
193
193
  state = '<a href="' + url + '">' + state + '</a>';
194
194
  element.find(".result .result-info").html(state);
195
195
  fadeUpdate(element.find(".duration"), duration);
@@ -211,7 +211,7 @@ KT.content = (function(){
211
211
  starttime = starttime === null ? katelloI18n.no_start_time : starttime;
212
212
 
213
213
  if(task_id !== undefined) {
214
- pg.attr('href', foreman_url('/foreman_tasks/tasks/' + task_id));
214
+ pg.attr('href', tfm.tools.foremanUrl('/foreman_tasks/tasks/' + task_id));
215
215
  }
216
216
 
217
217
  fadeUpdate(element.find(".start_time"), starttime);
@@ -219,7 +219,7 @@ KT.content = (function(){
219
219
  fadeUpdate(element.find(".duration"), '');
220
220
  fadeUpdate(element.find(".size"), display_size);
221
221
  element.find('.size').data('size', size);
222
- element.find('.info-tipsy').attr('href', foreman_url('/foreman_tasks/tasks/' + task_id));
222
+ element.find('.info-tipsy').attr('href', tfm.tools.foremanUrl('/foreman_tasks/tasks/' + task_id));
223
223
  progress = progress === 100 ? 99 : progress;
224
224
  value.show();
225
225
  value.animate({'width': progress },{ queue:false,
@@ -62,7 +62,7 @@ module Katello
62
62
  def_param_group :repo_create do
63
63
  param :label, String, :required => false
64
64
  param :product_id, :number, :required => true, :desc => N_("Product the repository belongs to")
65
- param :content_type, RepositoryTypeManager.creatable_repository_types.keys, :required => true, :desc => N_("type of repo (either 'yum', 'deb', 'puppet', 'docker', or 'ostree')")
65
+ param :content_type, RepositoryTypeManager.creatable_repository_types.keys, :required => true, :desc => N_("type of repo")
66
66
  end
67
67
 
68
68
  api :GET, "/repositories", N_("List of enabled repositories")
@@ -3,7 +3,7 @@ module Actions
3
3
  module Katello
4
4
  module ContentView
5
5
  class Publish < Actions::EntryAction
6
- # rubocop:disable MethodLength
6
+ # rubocop:disable MethodLength,Metrics/AbcSize
7
7
  def plan(content_view, description = "", options = {})
8
8
  action_subject(content_view)
9
9
  content_view.check_ready_to_publish!
@@ -31,15 +31,21 @@ module Actions
31
31
  :notes => description,
32
32
  :triggered_by => options[:triggered_by]
33
33
  )
34
+ source_repositories = []
35
+ content_view.publish_repositories do |repositories|
36
+ source_repositories += [repositories]
37
+ end
34
38
 
35
39
  sequence do
36
40
  plan_action(ContentView::AddToEnvironment, version, library)
41
+ repository_mapping = plan_action(ContentViewVersion::CreateRepos, version, source_repositories).repository_mapping
42
+
37
43
  concurrence do
38
- content_view.publish_repositories do |repositories|
44
+ source_repositories.each do |repositories|
39
45
  sequence do
40
- clone_to_version = plan_action(Repository::CloneToVersion, repositories, version,
46
+ plan_action(Repository::CloneToVersion, repositories, version, repository_mapping[repositories],
41
47
  :repos_units => options[:repos_units])
42
- plan_action(Repository::CloneToEnvironment, clone_to_version.new_repository, library)
48
+ plan_action(Repository::CloneToEnvironment, repository_mapping[repositories], library)
43
49
  end
44
50
  end
45
51
 
@@ -76,6 +82,9 @@ module Actions
76
82
  attrs[:metadata] = metadata
77
83
  end
78
84
  end
85
+
86
+ output[:content_view_id] = input[:content_view_id]
87
+ output[:content_view_version_id] = input[:content_view_version_id]
79
88
  end
80
89
 
81
90
  def rescue_strategy_for_self
@@ -4,7 +4,9 @@ module Actions
4
4
  class Destroy < Actions::EntryAction
5
5
  def plan(puppet_env)
6
6
  action_subject(puppet_env)
7
- plan_action(Pulp::Repository::Destroy, content_view_puppet_environment_id: puppet_env.id)
7
+ if ::Katello::RepositoryTypeManager.enabled?('puppet')
8
+ plan_action(Pulp::Repository::Destroy, content_view_puppet_environment_id: puppet_env.id)
9
+ end
8
10
  plan_self
9
11
  end
10
12
 
@@ -0,0 +1,25 @@
1
+ module Actions
2
+ module Katello
3
+ module ContentViewVersion
4
+ class CreateRepos < Actions::Base
5
+ # allows accessing the build object from the superior action
6
+ attr_accessor :repository_mapping
7
+ def plan(version, source_repositories = [])
8
+ self.repository_mapping = {}
9
+ concurrence do
10
+ source_repositories.each do |repositories|
11
+ new_repository = repositories.first.build_clone(content_view: version.content_view,
12
+ version: version)
13
+ plan_action(Repository::Create, new_repository, true, false)
14
+ repository_mapping[repositories] = new_repository
15
+ end
16
+ end
17
+ end
18
+
19
+ def humanized_name
20
+ _("Create Repositories")
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -16,8 +16,9 @@ module Actions
16
16
  end
17
17
 
18
18
  # rubocop:disable Metrics/MethodLength
19
+ # rubocop:disable Metrics/AbcSize
19
20
  def plan(old_version, environments, options = {})
20
- dep_solve = options.fetch(:resolve_dependencies, false)
21
+ dep_solve = options.fetch(:resolve_dependencies, true)
21
22
  description = options.fetch(:description, '')
22
23
  content = options.fetch(:content, {})
23
24
  new_components = options.fetch(:new_components, [])
@@ -36,11 +37,25 @@ module Actions
36
37
  :notes => description)
37
38
 
38
39
  copy_action_outputs = []
40
+ repos_to_clone = repos_to_copy(old_version, new_components)
39
41
 
40
42
  sequence do
43
+ repository_mapping = plan_action(ContentViewVersion::CreateRepos, new_content_view_version, repos_to_clone).repository_mapping
44
+
45
+ repos_to_clone.each do |source_repos|
46
+ plan_action(Repository::CloneToVersion,
47
+ source_repos,
48
+ new_content_view_version,
49
+ repository_mapping[source_repos],
50
+ incremental: true)
51
+ end
52
+
41
53
  concurrence do
42
- repos_to_copy(old_version, new_components).each do |source_repos|
43
- copy_action_outputs += copy_repos(source_repos, new_content_view_version, content, dep_solve)
54
+ repos_to_clone.each do |source_repos|
55
+ copy_action_outputs += copy_repos(repository_mapping[source_repos],
56
+ new_content_view_version,
57
+ content,
58
+ dep_solve)
44
59
  end
45
60
 
46
61
  sequence do
@@ -64,13 +79,14 @@ module Actions
64
79
  end
65
80
  end
66
81
 
67
- def copy_repos(source_repos, new_version, content, dep_solve)
82
+ def copy_repos(new_repo, new_version, content, dep_solve)
68
83
  copy_output = []
69
84
  sequence do
70
- new_repo = plan_action(Repository::CloneToVersion, source_repos, new_version, :incremental => true).new_repository
71
85
  solve_dependencies = new_version.content_view.solve_dependencies || dep_solve
72
86
  copy_output += copy_deb_content(new_repo, solve_dependencies, content[:deb_ids])
73
- copy_output += copy_yum_content(new_repo, solve_dependencies, content[:package_ids], content[:errata_ids])
87
+ copy_output += copy_yum_content(new_repo, solve_dependencies,
88
+ content[:package_ids],
89
+ content[:errata_ids])
74
90
 
75
91
  plan_action(Katello::Repository::MetadataGenerate, new_repo)
76
92
  plan_action(Katello::Repository::IndexContent, id: new_repo.id)
@@ -121,8 +137,10 @@ module Actions
121
137
  def run
122
138
  content = { ::Katello::Erratum::CONTENT_TYPE => [],
123
139
  ::Katello::Rpm::CONTENT_TYPE => [],
140
+ ::Katello::ModuleStream::CONTENT_TYPE => [],
124
141
  ::Katello::Deb::CONTENT_TYPE => [],
125
- ::Katello::PuppetModule::CONTENT_TYPE => []}
142
+ ::Katello::PuppetModule::CONTENT_TYPE => []
143
+ }
126
144
 
127
145
  input[:copy_action_outputs].each do |copy_output|
128
146
  copy_output[:pulp_tasks].each do |pulp_task|
@@ -132,6 +150,8 @@ module Actions
132
150
  case type
133
151
  when ::Katello::Erratum::CONTENT_TYPE
134
152
  content[::Katello::Erratum::CONTENT_TYPE] << unit['id']
153
+ when ::Katello::ModuleStream::CONTENT_TYPE
154
+ content[::Katello::ModuleStream::CONTENT_TYPE] << "#{unit['name']}:#{unit['stream']}:#{unit['version']}"
135
155
  when ::Katello::Rpm::CONTENT_TYPE
136
156
  content[::Katello::Rpm::CONTENT_TYPE] << ::Katello::Util::Package.build_nvra(unit)
137
157
  when ::Katello::Deb::CONTENT_TYPE
@@ -222,7 +242,7 @@ module Actions
222
242
  unless deb_ids.blank?
223
243
  copy_outputs << plan_action(Pulp::Repository::CopyUnits, new_repo.library_instance, new_repo,
224
244
  ::Katello::Deb.with_identifiers(deb_ids),
225
- resolve_dependencies: dep_solve).output
245
+ incremental_update: dep_solve).output
226
246
  end
227
247
  end
228
248
  copy_outputs
@@ -233,14 +253,14 @@ module Actions
233
253
  if new_repo.content_type == ::Katello::Repository::YUM_TYPE
234
254
  unless errata_ids.blank?
235
255
  copy_outputs << plan_action(Pulp::Repository::CopyUnits, new_repo.library_instance, new_repo,
236
- ::Katello::Erratum.with_identifiers(errata_ids),
237
- resolve_dependencies: dep_solve).output
256
+ ::Katello::Erratum.with_identifiers(errata_ids),
257
+ incremental_update: dep_solve).output
238
258
  end
239
259
 
240
260
  unless package_ids.blank?
241
261
  copy_outputs << plan_action(Pulp::Repository::CopyUnits, new_repo.library_instance, new_repo,
242
- ::Katello::Rpm.with_identifiers(package_ids),
243
- resolve_dependencies: dep_solve).output
262
+ ::Katello::Rpm.with_identifiers(package_ids),
263
+ incremental_update: dep_solve).output
244
264
  end
245
265
  end
246
266
  copy_outputs
@@ -42,7 +42,11 @@ module Actions
42
42
 
43
43
  def finalize
44
44
  environment = ::Katello::KTEnvironment.find(input['kt_environment']['id'])
45
- environment.destroy!
45
+
46
+ # CapsuleLifecycleEnvironment can cause issues when auditing, it will try to associate the audit to the deleted taxonomy
47
+ ::Katello::CapsuleLifecycleEnvironment.without_auditing do
48
+ environment.destroy!
49
+ end
46
50
  end
47
51
  end
48
52
  end
@@ -18,6 +18,8 @@ module Actions
18
18
  load_resources
19
19
  end
20
20
 
21
+ load_hosts_guests
22
+
21
23
  ActiveRecord::Base.transaction do
22
24
  @hosts.each do |uuid, host|
23
25
  update_host(uuid, host)
@@ -30,6 +32,16 @@ module Actions
30
32
  end
31
33
  end
32
34
 
35
+ def load_hosts_guests
36
+ @hosts.each do |uuid, host|
37
+ host.subscription_facet ||= host.build_subscription_facet(uuid: uuid)
38
+ # Only preload the virtual guests if 'guestIds' is not returned by Candlepin
39
+ consumer = @candlepin_attributes[uuid]
40
+ next unless consumer && consumer.try(:[], 'guestIds').empty?
41
+ host.subscription_facet.candlepin_consumer.virtual_guests
42
+ end
43
+ end
44
+
33
45
  # Loads all resources needed for refreshing subscription facet
34
46
  def load_resources
35
47
  @organizations = ::Organization.where(label: hypervisors_field(:organization_label)).map { |org| [org.label, org] }.to_h
@@ -136,7 +148,6 @@ module Actions
136
148
  end
137
149
 
138
150
  def update_subscription_facet(uuid, host)
139
- host.subscription_facet ||= host.build_subscription_facet(uuid: uuid)
140
151
  if @candlepin_attributes.key?(uuid)
141
152
  host.subscription_facet.candlepin_consumer.consumer_attributes = @candlepin_attributes[uuid]
142
153
  host.subscription_facet.import_database_attributes
@@ -2,17 +2,10 @@ module Actions
2
2
  module Katello
3
3
  module Repository
4
4
  class CloneToVersion < Actions::Base
5
- # allows accessing the build object from the superior action
6
- attr_accessor :new_repository
7
-
8
- def plan(repositories, content_view_version, options = {})
5
+ def plan(repositories, content_view_version, destination_repository, options = {})
9
6
  incremental = options.fetch(:incremental, false)
10
7
  content_view = content_view_version.content_view
11
8
  filters = incremental ? [] : content_view.filters.applicable(repositories.first)
12
-
13
- self.new_repository = repositories.first.build_clone(content_view: content_view,
14
- version: content_view_version)
15
-
16
9
  rpm_filenames = extract_rpm_filenames(options.fetch(:repos_units, nil), repositories.first.label)
17
10
  fail _('Cannot publish a composite with rpm filenames') if content_view.composite? && rpm_filenames&.any?
18
11
  if rpm_filenames&.any?
@@ -20,12 +13,11 @@ module Actions
20
13
  Rails.logger.warn("Filters on content view have been overridden by passed-in filename list during publish") if filters.any?
21
14
  end
22
15
 
23
- copy_contents = new_repository.master?
16
+ copy_contents = destination_repository.master?
24
17
  fail _('Cannot publish a link repository if multiple component clones are specified') if !copy_contents && repositories.count > 1
25
18
 
26
19
  sequence do
27
- plan_action(Repository::Create, new_repository, true, false)
28
- plan_action(::Actions::Katello::Repository::CloneContents, repositories, new_repository,
20
+ plan_action(::Actions::Katello::Repository::CloneContents, repositories, destination_repository,
29
21
  purge_empty_contents: true,
30
22
  filters: filters,
31
23
  rpm_filenames: rpm_filenames,
@@ -8,19 +8,16 @@ module Actions
8
8
  target_repo_id: target_repo.id,
9
9
  class_name: units.first.class.name,
10
10
  unit_ids: units.pluck(:id),
11
- resolve_dependencies: options[:resolve_dependencies])
11
+ incremental_update: options[:incremental_update])
12
12
  end
13
13
  end
14
14
 
15
15
  def invoke_external_task
16
16
  source_repo = ::Katello::Repository.find(input[:source_repo_id])
17
17
  target_repo = ::Katello::Repository.find(input[:target_repo_id])
18
-
19
18
  units = input[:class_name].constantize.where(:id => input[:unit_ids])
20
-
21
- override_config = ::Katello::Repository.build_override_config(input)
22
-
23
- source_repo.backend_service(SmartProxy.pulp_master).copy_units(target_repo, units, override_config)
19
+ source_repo.backend_service(SmartProxy.pulp_master).copy_units(target_repo, units,
20
+ incremental_update: input[:incremental_update])
24
21
  end
25
22
  end
26
23
  end
@@ -13,7 +13,7 @@ module Actions
13
13
  repo = ::Katello::ContentViewPuppetEnvironment.find_by(:pulp_id => input[:pulp_id])
14
14
  repo = repo.nonpersisted_repository
15
15
  end
16
- repo.backend_service(smart_proxy(input[:capsule_id])).refresh
16
+ repo.backend_service(smart_proxy(input[:capsule_id])).refresh_if_needed
17
17
  end
18
18
  end
19
19
  end
@@ -66,7 +66,9 @@ module Actions
66
66
  end
67
67
 
68
68
  def presenter
69
- repo = ::Katello::Repository.find(input['repo_id'])
69
+ repo = ::Katello::Repository.find(input['repo_id']) if input['repo_id']
70
+ # For repo sync tasks older than katello 3.14, we only have pulp_id available in input.
71
+ repo ||= ::Katello::Repository.where(:pulp_id => input['pulp_id']).first if input['pulp_id']
70
72
 
71
73
  if repo.try(:puppet?)
72
74
  Presenters::PuppetPresenter.new(self)