katello 3.9.1 → 3.10.0.rc1

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 (229) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/katello/hosts/host_and_hostgroup_edit.js +28 -12
  3. data/app/controllers/katello/api/rhsm/candlepin_dynflow_proxy_controller.rb +12 -3
  4. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +4 -13
  5. data/app/controllers/katello/api/v2/content_credentials_controller.rb +1 -1
  6. data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +1 -1
  7. data/app/controllers/katello/api/v2/content_view_versions_controller.rb +6 -4
  8. data/app/controllers/katello/api/v2/content_views_controller.rb +8 -3
  9. data/app/controllers/katello/api/v2/gpg_keys_controller.rb +2 -1
  10. data/app/controllers/katello/api/v2/host_module_streams_controller.rb +39 -0
  11. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +20 -11
  12. data/app/controllers/katello/api/v2/module_streams_controller.rb +2 -1
  13. data/app/controllers/katello/api/v2/repository_sets_controller.rb +17 -8
  14. data/app/controllers/katello/application_controller.rb +0 -2
  15. data/app/controllers/katello/concerns/hosts_controller_extensions.rb +5 -2
  16. data/app/lib/actions/candlepin/consumer/attach_subscription.rb +0 -2
  17. data/app/lib/actions/candlepin/consumer/remove_subscription.rb +0 -2
  18. data/app/lib/actions/katello/capsule_content/create_repos.rb +1 -25
  19. data/app/lib/actions/katello/capsule_content/sync.rb +1 -1
  20. data/app/lib/actions/katello/content_view/promote.rb +2 -5
  21. data/app/lib/actions/katello/content_view/promote_to_environment.rb +2 -5
  22. data/app/lib/actions/katello/content_view/publish.rb +1 -4
  23. data/app/lib/actions/katello/content_view_puppet_environment/create.rb +6 -10
  24. data/app/lib/actions/katello/content_view_version/export.rb +0 -2
  25. data/app/lib/actions/katello/content_view_version/incremental_update.rb +19 -1
  26. data/app/lib/actions/katello/environment/publish_repositories.rb +2 -1
  27. data/app/lib/actions/katello/gpg_key/update.rb +17 -0
  28. data/app/lib/actions/katello/host/attach_subscriptions.rb +0 -2
  29. data/app/lib/actions/katello/host/erratum/install.rb +6 -0
  30. data/app/lib/actions/katello/host/generate_applicability.rb +0 -2
  31. data/app/lib/actions/katello/host/hypervisors_update.rb +11 -6
  32. data/app/lib/actions/katello/host/package/install.rb +6 -0
  33. data/app/lib/actions/katello/host/package/remove.rb +6 -0
  34. data/app/lib/actions/katello/host/package/update.rb +7 -1
  35. data/app/lib/actions/katello/host/package_group/install.rb +6 -0
  36. data/app/lib/actions/katello/host/package_group/remove.rb +6 -0
  37. data/app/lib/actions/katello/host/recalculate_errata_status.rb +0 -2
  38. data/app/lib/actions/katello/host/remove_subscriptions.rb +0 -2
  39. data/app/lib/actions/katello/host/update.rb +1 -0
  40. data/app/lib/actions/katello/host/update_content_overrides.rb +0 -2
  41. data/app/lib/actions/katello/host/upload_package_profile.rb +13 -12
  42. data/app/lib/actions/katello/host/upload_profiles.rb +70 -0
  43. data/app/lib/actions/katello/product/reindex_subscriptions.rb +0 -2
  44. data/app/lib/actions/katello/product/repositories_certs_reset.rb +4 -4
  45. data/app/lib/actions/katello/product/repositories_gpg_reset.rb +2 -2
  46. data/app/lib/actions/katello/repository/check_matching_content.rb +18 -6
  47. data/app/lib/actions/katello/repository/clone_deb_content.rb +1 -1
  48. data/app/lib/actions/katello/repository/clone_to_environment.rb +3 -5
  49. data/app/lib/actions/katello/repository/clone_to_version.rb +2 -3
  50. data/app/lib/actions/katello/repository/clone_yum_content.rb +1 -2
  51. data/app/lib/actions/katello/repository/clone_yum_metadata.rb +2 -2
  52. data/app/lib/actions/katello/repository/create.rb +1 -31
  53. data/app/lib/actions/katello/repository/destroy.rb +1 -2
  54. data/app/lib/actions/katello/repository/export.rb +0 -2
  55. data/app/lib/actions/katello/repository/fetch_pxe_files.rb +0 -2
  56. data/app/lib/actions/katello/repository/filtered_index_content.rb +0 -2
  57. data/app/lib/actions/katello/repository/finish_upload.rb +0 -2
  58. data/app/lib/actions/katello/repository/import_upload.rb +0 -2
  59. data/app/lib/actions/katello/repository/index_content.rb +0 -1
  60. data/app/lib/actions/katello/repository/index_package_groups.rb +0 -2
  61. data/app/lib/actions/katello/repository/instance_update.rb +21 -0
  62. data/app/lib/actions/katello/repository/remove_content.rb +0 -2
  63. data/app/lib/actions/katello/repository/sync.rb +0 -1
  64. data/app/lib/actions/katello/repository/update.rb +0 -2
  65. data/app/lib/actions/katello/upstream_subscriptions/bind_entitlement.rb +0 -2
  66. data/app/lib/actions/katello/upstream_subscriptions/bind_entitlements.rb +0 -2
  67. data/app/lib/actions/katello/upstream_subscriptions/remove_entitlement.rb +0 -1
  68. data/app/lib/actions/katello/upstream_subscriptions/remove_entitlements.rb +0 -2
  69. data/app/lib/actions/katello/upstream_subscriptions/update_entitlement.rb +0 -1
  70. data/app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb +0 -2
  71. data/app/lib/actions/pulp/abstract.rb +13 -14
  72. data/app/lib/actions/pulp/repository/create.rb +13 -211
  73. data/app/lib/actions/pulp/repository/create_in_plan.rb +4 -18
  74. data/app/lib/actions/pulp/repository/refresh.rb +7 -70
  75. data/app/lib/actions/pulp/repository/sync.rb +1 -2
  76. data/app/lib/katello/capsule_content.rb +3 -3
  77. data/app/lib/katello/resources/candlepin/consumer.rb +1 -1
  78. data/app/lib/katello/resources/candlepin/product.rb +1 -1
  79. data/app/lib/katello/validators/hostgroup_kickstart_repository_validator.rb +1 -1
  80. data/app/models/katello/available_module_stream.rb +11 -0
  81. data/app/models/katello/concerns/content_facet_host_extensions.rb +1 -0
  82. data/app/models/katello/concerns/host_managed_extensions.rb +56 -0
  83. data/app/models/katello/concerns/hostgroup_extensions.rb +17 -0
  84. data/app/models/katello/concerns/redhat_extensions.rb +20 -6
  85. data/app/models/katello/concerns/search_by_repository_name.rb +0 -1
  86. data/app/models/katello/concerns/smart_proxy_extensions.rb +26 -12
  87. data/app/models/katello/content_facet_applicable_module_stream.rb +7 -0
  88. data/app/models/katello/content_view_puppet_environment.rb +14 -35
  89. data/app/models/katello/erratum.rb +54 -24
  90. data/app/models/katello/erratum_package.rb +6 -0
  91. data/app/models/katello/glue/pulp/repo.rb +5 -228
  92. data/app/models/katello/gpg_key.rb +1 -0
  93. data/app/models/katello/host/content_facet.rb +38 -83
  94. data/app/models/katello/host_available_module_stream.rb +47 -0
  95. data/app/models/katello/module_stream.rb +18 -0
  96. data/app/models/katello/module_stream_erratum_package.rb +6 -0
  97. data/app/models/katello/product.rb +0 -2
  98. data/app/models/katello/product_content.rb +1 -0
  99. data/app/models/katello/repository.rb +15 -6
  100. data/app/models/katello/root_repository.rb +1 -1
  101. data/app/models/katello/rpm.rb +5 -17
  102. data/app/services/katello/applicable_content_helper.rb +111 -0
  103. data/app/services/katello/managed_content_medium_provider.rb +7 -0
  104. data/app/services/katello/pulp/consumer.rb +13 -7
  105. data/app/services/katello/pulp/repository.rb +157 -4
  106. data/app/services/katello/pulp/repository/deb.rb +47 -0
  107. data/app/services/katello/pulp/repository/docker.rb +43 -0
  108. data/app/services/katello/pulp/repository/file.rb +31 -0
  109. data/app/services/katello/pulp/repository/ostree.rb +40 -0
  110. data/app/services/katello/pulp/repository/puppet.rb +43 -0
  111. data/app/services/katello/pulp/repository/yum.rb +61 -0
  112. data/app/services/katello/repository_type.rb +1 -1
  113. data/app/views/katello/api/v2/content_facet/base.json.rabl +1 -0
  114. data/app/views/katello/api/v2/content_view_versions/base.json.rabl +0 -1
  115. data/app/views/katello/api/v2/errata/_counts.json.rabl +0 -1
  116. data/app/views/katello/api/v2/errata/show.json.rabl +9 -3
  117. data/app/views/katello/api/v2/host_collections/delta_activation_keys.rabl +0 -1
  118. data/app/views/katello/api/v2/host_module_streams/base.json.rabl +8 -0
  119. data/app/views/katello/api/v2/host_module_streams/index.json.rabl +7 -0
  120. data/app/views/katello/api/v2/packages/backend.json.rabl +0 -1
  121. data/app/views/katello/api/v2/repositories/show.json.rabl +6 -6
  122. data/app/views/katello/layouts/react.html.erb +2 -2
  123. data/app/views/overrides/activation_keys/_host_synced_content_select.html.erb +0 -1
  124. data/config/routes/api/rhsm.rb +1 -0
  125. data/config/routes/overrides.rb +4 -0
  126. data/db/migrate/20181008201422_add_modules_to_errata_packages.rb +29 -0
  127. data/db/migrate/20181017181806_available_module_streams.rb +34 -0
  128. data/db/migrate/20181027014323_add_applicable_modules.rb +24 -0
  129. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/module-stream-actions.service.js +2 -1
  130. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-info.html +1 -1
  131. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/views/new-content-credential.html +1 -0
  132. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-host-bulk-module-streams-modal.html +2 -2
  133. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html +37 -22
  134. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +4 -1
  135. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-module-streams.controller.js +27 -7
  136. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-module-streams.html +29 -0
  137. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/errata-details.html +15 -1
  138. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +1 -1
  139. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-promotion.controller.js +0 -1
  140. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-publish.controller.js +1 -2
  141. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-versions.controller.js +3 -1
  142. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/content-view-history.controller.js +1 -1
  143. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-promotion.html +0 -15
  144. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-publish.html +0 -14
  145. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/erratum.controller.js +19 -0
  146. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-info.html +0 -12
  147. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-packages.html +36 -0
  148. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum.html +7 -0
  149. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/errata.routes.js +9 -0
  150. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-module-streams.factory.js +18 -0
  151. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +4 -2
  152. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +2 -2
  153. data/engines/bastion_katello/app/assets/stylesheets/bastion_katello/bastion_katello.scss +13 -0
  154. data/lib/katello/permissions/host_permissions.rb +3 -0
  155. data/lib/katello/repository_types/deb.rb +3 -1
  156. data/lib/katello/repository_types/docker.rb +3 -1
  157. data/lib/katello/repository_types/file.rb +1 -0
  158. data/lib/katello/repository_types/ostree.rb +3 -1
  159. data/lib/katello/repository_types/puppet.rb +3 -1
  160. data/lib/katello/repository_types/yum.rb +3 -1
  161. data/lib/katello/tasks/delete_orphaned_content.rake +1 -1
  162. data/lib/katello/tasks/reset.rake +1 -0
  163. data/lib/katello/tasks/test.rake +14 -0
  164. data/lib/katello/tasks/unify_hosts.rake +2 -0
  165. data/lib/katello/tasks/virt_who_report.rake +2 -1
  166. data/lib/katello/version.rb +1 -1
  167. data/locale/Makefile +52 -17
  168. data/locale/update-i18n +22 -0
  169. data/package.json +11 -1
  170. data/webpack/__mocks__/foremanReact/components/common/EmptyState.js +8 -0
  171. data/webpack/move_to_foreman/components/common/table/components/Table.js +2 -1
  172. data/webpack/move_to_pf/react-bootstrap-select/index.js +4 -2
  173. data/webpack/move_to_pf/test-utils/testHelpers.js +9 -0
  174. data/webpack/redux/OrganizationProducts/OrganizationProductsActions.js +24 -0
  175. data/webpack/redux/OrganizationProducts/OrganizationProductsConstants.js +5 -0
  176. data/webpack/redux/OrganizationProducts/OrganizationProductsReducer.js +38 -0
  177. data/webpack/redux/OrganizationProducts/OrganizationProductsSelectors.js +7 -0
  178. data/webpack/redux/OrganizationProducts/__tests__/OrganizationProductsActions.test.js +47 -0
  179. data/webpack/redux/OrganizationProducts/__tests__/OrganizationProductsReducer.test.js +33 -0
  180. data/webpack/redux/OrganizationProducts/__tests__/OrganizationProductsSelectors.test.js +19 -0
  181. data/webpack/redux/OrganizationProducts/__tests__/__snapshots__/OrganizationProductsActions.test.js.snap +49 -0
  182. data/webpack/redux/OrganizationProducts/__tests__/__snapshots__/OrganizationProductsReducer.test.js.snap +36 -0
  183. data/webpack/redux/OrganizationProducts/__tests__/__snapshots__/OrganizationProductsSelectors.test.js.snap +9 -0
  184. data/webpack/redux/OrganizationProducts/index.js +13 -0
  185. data/webpack/redux/actions/RedHatRepositories/enabled.js +7 -1
  186. data/webpack/redux/actions/RedHatRepositories/helpers.js +4 -0
  187. data/webpack/redux/actions/RedHatRepositories/sets.js +2 -0
  188. data/webpack/redux/reducers/RedHatRepositories/enabled.fixtures.js +8 -2
  189. data/webpack/redux/reducers/RedHatRepositories/enabled.js +1 -1
  190. data/webpack/redux/reducers/RedHatRepositories/sets.fixtures.js +12 -3
  191. data/webpack/redux/reducers/index.js +2 -0
  192. data/webpack/scenes/RedHatRepositories/components/SearchBar.js +68 -33
  193. data/webpack/scenes/RedHatRepositories/index.js +13 -2
  194. data/webpack/scenes/RedHatRepositories/index.scss +26 -0
  195. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +1 -1
  196. data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +1 -1
  197. data/webpack/scenes/Subscriptions/SubscriptionActions.js +18 -2
  198. data/webpack/scenes/Subscriptions/SubscriptionConstants.js +8 -0
  199. data/webpack/scenes/Subscriptions/SubscriptionHelpers.js +15 -0
  200. data/webpack/scenes/Subscriptions/SubscriptionReducer.js +22 -14
  201. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +39 -90
  202. data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +14 -0
  203. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +1 -3
  204. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +0 -1
  205. data/webpack/scenes/Subscriptions/__tests__/SubscriptionHelpers.test.js +84 -0
  206. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsActions.test.js +26 -1
  207. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +5 -0
  208. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsReducer.test.js +177 -75
  209. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsSelectors.test.js +29 -0
  210. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionHelpers.test.js.snap +31 -0
  211. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsActions.test.js.snap +32 -0
  212. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +18 -96
  213. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsReducer.test.js.snap +511 -0
  214. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsSelectors.test.js.snap +26 -0
  215. data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +6 -1
  216. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +3 -21
  217. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +113 -0
  218. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.test.js +47 -0
  219. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +504 -0
  220. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/index.js +1 -0
  221. data/webpack/scenes/Subscriptions/index.js +15 -4
  222. metadata +59 -14
  223. data/app/lib/actions/pulp/repository/associate_distributor.rb +0 -20
  224. data/app/lib/actions/pulp/repository/associate_importer.rb +0 -23
  225. data/app/lib/actions/pulp/repository/delete_distributor.rb +0 -18
  226. data/app/lib/actions/pulp/repository/refresh_distributor.rb +0 -19
  227. data/app/lib/actions/pulp/repository/update_importer.rb +0 -33
  228. data/app/lib/katello/bulk_actions.rb +0 -63
  229. data/webpack/move_to_foreman/components/common/EmptyState/index.js +0 -68
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 69e80194e98966a9f7d9942fdd36fb5996718cca
4
- data.tar.gz: 6daa564d8872d33964d3cda0c1f6f9268b603aa8
3
+ metadata.gz: 56354aa529245602ddac6bbb8fe6b4c46b68e80e
4
+ data.tar.gz: 875ed3e65866ebc2d0ec9ac51db388c47bfddb51
5
5
  SHA512:
6
- metadata.gz: 7e6df8ffbe7dd816c21f438efe12b4a6973b2d2be4e37da959799ea7285ad7b38f49dff638432f2075c82b02185c3f69e473b66ac3d1a2f250fc57e3f3f923cf
7
- data.tar.gz: 1f2b5d16fac33a4b81da05bd320bfcd68eed769d28b79c41adf273ffebe5533f68ff560b8112743873fd5234dd7c86bba6d6e9ff883c70d73c5f5a03ef5429b2
6
+ metadata.gz: 9ba4bcb89eae3327727e378960f2b37d03f6ac098d57cc9699de8908d8c1652c4f8b1794f0dbd657cbc7343c320ccc05f65c90c1dc83a596644da38d266c1892
7
+ data.tar.gz: 6480a7323599b59b66ac44f62c9b0c697c968ca5c73496cdfddc72684b061065bacbb7734694411e6f35b0d95e3314a953431954054343bf664dc0f1075ec5da
@@ -6,8 +6,8 @@ $(document).on('ContentLoad', function(){
6
6
  window.tfm.hosts.registerPluginAttributes("os",
7
7
  ['lifecycle_environment_id', 'content_view_id', 'environment_id', 'content_source_id', 'architecture_id']);
8
8
 
9
- $("#hostgroup_lifecycle_environment_id").change(KT.hosts.fetchContentViews);
10
- $("#host_lifecycle_environment_id").change(KT.hosts.fetchContentViews);
9
+ $("#hostgroup_lifecycle_environment_id").change(KT.hosts.environmentChanged);
10
+ $("#host_lifecycle_environment_id").change(KT.hosts.environmentChanged);
11
11
 
12
12
  $("#hostgroup_content_view_id").change(KT.hosts.contentViewSelected);
13
13
  $("#host_content_view_id").change(KT.hosts.contentViewSelected);
@@ -19,18 +19,33 @@ $(document).on('ContentLoad', function(){
19
19
  KT.hosts.set_media_selection_bindings();
20
20
  });
21
21
 
22
+ KT.hosts.environmentChanged = function() {
23
+ // if we don't save the currently selected view it's likely
24
+ // it will be undefined in toggle_installation_medium due to the CV dropdown reload
25
+ var previous_content_view = KT.hosts.getSelectedContentView();
26
+
27
+ KT.hosts.fetchContentViews();
28
+ KT.hosts.toggle_installation_medium(previous_content_view);
29
+ };
30
+
22
31
  KT.hosts.fetchContentViews = function () {
23
32
  var select = KT.hosts.getContentViewSelect();
24
33
  var envId = KT.hosts.getSelectedEnvironment();
34
+ var option;
35
+ var previous_view = KT.hosts.getSelectedContentView();
36
+
25
37
  select.find('option').remove();
26
38
  if (envId) {
27
39
  KT.hosts.signalContentViewFetch(true);
28
40
  var url = foreman_url('/katello/api/v2/content_views/');
29
41
  $.get(url, {environment_id: envId, full_result: true}, function (data) {
30
- select.find('option').remove();
31
42
  select.append($("<option />"));
32
43
  $.each(data.results, function(index, view) {
33
- select.append($("<option />").val(view.id).text(view.name));
44
+ option = $("<option />").val(view.id).text(view.name);
45
+ if (view.id === parseInt(previous_view)) {
46
+ option.prop('selected', true);
47
+ }
48
+ select.append(option);
34
49
  });
35
50
  KT.hosts.signalContentViewFetch(false);
36
51
  });
@@ -40,7 +55,6 @@ KT.hosts.fetchContentViews = function () {
40
55
  KT.hosts.signalContentViewFetch = function(fetching) {
41
56
  var select = KT.hosts.getContentViewSelect();
42
57
  var select2 = KT.hosts.getContentViewSelect2();
43
- //parent = select.parent(),
44
58
  spinner = $('<img>').attr('src', select.data("spinner-path")),
45
59
  spinner_id = "content_view_spinner";
46
60
 
@@ -118,10 +132,10 @@ KT.hosts.getSelectedEnvironment = function () {
118
132
  };
119
133
 
120
134
  KT.hosts.onKatelloHostEditLoad = function(){
121
- var prefxies = ['host', 'hostgroup'],
122
- attributes = ['lifecycle_environment_id', 'content_view_id', 'environment_id', 'architecture_id'];
135
+ var prefixes = ['host', 'hostgroup'],
136
+ attributes = ['content_view_id', 'environment_id', 'architecture_id'];
123
137
 
124
- $.each(prefxies, function(index, prefix) {
138
+ $.each(prefixes, function(index, prefix) {
125
139
  $.each(attributes, function(attrIndex, attribute) {
126
140
  $('body').on('change', '#' + prefix + '_' + attribute, function () {
127
141
  KT.hosts.toggle_installation_medium();
@@ -134,18 +148,20 @@ KT.hosts.onKatelloHostEditLoad = function(){
134
148
  });
135
149
  };
136
150
 
137
- KT.hosts.toggle_installation_medium = function() {
138
- var lifecycle_environment_id, content_source_id, architecture_id, operatingsystem_id, content_view_id;
151
+ KT.hosts.toggle_installation_medium = function(content_view_id) {
152
+ var lifecycle_environment_id, content_source_id, architecture_id, operatingsystem_id;
153
+
154
+ if (content_view_id === undefined) {
155
+ content_view_id = KT.hosts.getSelectedContentView();
156
+ }
139
157
 
140
158
  if ($('#hostgroup_parent_id').length > 0) {
141
159
  lifecycle_environment_id = KT.hosts.getSelectedEnvironment();
142
- content_view_id = KT.hosts.getSelectedContentView();
143
160
  content_source_id = $('#content_source_id').val();
144
161
  architecture_id = $('#hostgroup_architecture_id').val();
145
162
  operatingsystem_id = $('#hostgroup_operatingsystem_id').val();
146
163
  } else {
147
164
  lifecycle_environment_id = KT.hosts.getSelectedEnvironment();
148
- content_view_id = KT.hosts.getSelectedContentView();
149
165
  content_source_id = $('#content_source_id').val();
150
166
  architecture_id = $('#host_architecture_id').val();
151
167
  operatingsystem_id = $('#host_operatingsystem_id').val();
@@ -4,9 +4,9 @@ module Katello
4
4
  include ForemanTasks::Triggers
5
5
  include AbstractController::Callbacks
6
6
 
7
- skip_before_action :authorize, :only => [:upload_package_profile]
8
- before_action :find_host, :only => [:upload_package_profile]
9
- before_action :authorize_client_or_user, :only => [:upload_package_profile]
7
+ skip_before_action :authorize, :only => [:upload_package_profile, :upload_profiles]
8
+ before_action :find_host, :only => [:upload_package_profile, :upload_profiles]
9
+ before_action :authorize_client_or_user, :only => [:upload_package_profile, :upload_profiles]
10
10
 
11
11
  skip_before_action :check_content_type
12
12
 
@@ -20,6 +20,15 @@ module Katello
20
20
  render :json => Resources::Candlepin::Consumer.get(@host.subscription_facet.uuid)
21
21
  end
22
22
 
23
+ api :PUT, "/consumers/:id/profiles", N_("Update installed packages, enabled repos, module inventory")
24
+ param :id, String, :desc => N_("UUID of the consumer"), :required => true
25
+ def upload_profiles
26
+ User.as_anonymous_admin do
27
+ async_task(::Actions::Katello::Host::UploadProfiles, @host, request.raw_post)
28
+ end
29
+ render :json => Resources::Candlepin::Consumer.get(@host.subscription_facet.uuid)
30
+ end
31
+
23
32
  def find_host(uuid = nil)
24
33
  params = request.path_parameters
25
34
  uuid ||= params[:id]
@@ -9,10 +9,10 @@ module Katello
9
9
 
10
10
  around_action :repackage_message
11
11
  before_action :find_host, :only => [:consumer_show, :consumer_destroy, :consumer_checkin, :enabled_repos,
12
- :upload_package_profile, :regenerate_identity_certificates, :facts,
12
+ :regenerate_identity_certificates, :facts,
13
13
  :available_releases, :serials, :upload_tracer_profile]
14
14
  before_action :authorize, :only => [:consumer_create, :list_owners, :rhsm_index]
15
- before_action :authorize_client_or_user, :only => [:consumer_show, :upload_package_profile, :regenerate_identity_certificates, :upload_tracer_profile, :facts, :proxy_jobs_get_path]
15
+ before_action :authorize_client_or_user, :only => [:consumer_show, :regenerate_identity_certificates, :upload_tracer_profile, :facts, :proxy_jobs_get_path]
16
16
  before_action :authorize_client_or_admin, :only => [:hypervisors_update, :async_hypervisors_update]
17
17
  before_action :authorize_proxy_routes, :only => [:get, :post, :put, :delete]
18
18
  before_action :authorize_client, :only => [:consumer_destroy, :consumer_checkin,
@@ -188,18 +188,9 @@ module Katello
188
188
  repos_params = params['enabled_repos'] rescue raise(HttpErrors::BadRequest, _("Expected attribute is missing:") + " enabled_repos")
189
189
  repos_params = repos_params['repos'] || []
190
190
 
191
- paths = repos_params.map do |repo|
192
- if !repo['baseurl'].blank?
193
- URI(repo['baseurl'].first).path
194
- else
195
- logger.warn("System #{@host.name} (#{@host.id}) attempted to bind to unspecific repo (#{repo}).")
196
- nil
197
- end
198
- end
199
-
200
191
  result = nil
201
192
  User.as_anonymous_admin do
202
- result = @host.content_facet.update_repositories_by_paths(paths.compact)
193
+ result = @host.import_enabled_repositories(repos_params)
203
194
  end
204
195
 
205
196
  respond_for_show :resource => result
@@ -250,7 +241,7 @@ module Katello
250
241
  #description N_("This service is available for unauthenticated users")
251
242
  def server_status
252
243
  candlepin_response = Resources::Candlepin::CandlepinPing.ping
253
- status = { :managerCapabilities => candlepin_response['managerCapabilities'],
244
+ status = { :managerCapabilities => candlepin_response['managerCapabilities'] + ["combined_reporting"],
254
245
  :result => candlepin_response['result'],
255
246
  :rulesSource => candlepin_response['rulesSource'],
256
247
  :rulesVersion => candlepin_response['rulesVersion'],
@@ -69,7 +69,7 @@ module Katello
69
69
  param :id, :number, :desc => N_("content credential numeric identifier"), :required => true
70
70
  param_group :content_credential
71
71
  def update
72
- @content_credential.update_attributes!(content_credential_params)
72
+ sync_task(::Actions::Katello::GpgKey::Update, @content_credential, content_credential_params.to_h)
73
73
  respond_for_show(:resource => @content_credential)
74
74
  end
75
75
 
@@ -107,7 +107,7 @@ module Katello
107
107
 
108
108
  def find_rule
109
109
  rule_clazz = ContentViewFilter.rule_class_for(@filter)
110
- @rule = rule_clazz.find(params[:id])
110
+ @rule = rule_clazz.where(content_view_filter_id: @filter.id).find(params[:id])
111
111
  end
112
112
 
113
113
  def rule_params
@@ -54,13 +54,10 @@ module Katello
54
54
  param :environment_id, :number, :deprecated => true, :desc => N_("LifeCycle Environment identifier")
55
55
  param :environment_ids, Array, :desc => N_("Identifiers for Lifecycle Environment")
56
56
  param :description, String, :desc => N_("The description for the content view version promotion")
57
- param :force_yum_metadata_regeneration, :bool, :desc => N_("Force metadata regeneration on the repositories " \
58
- "in the content view version")
59
57
  def promote
60
58
  is_force = ::Foreman::Cast.to_bool(params[:force])
61
59
  task = async_task(::Actions::Katello::ContentView::Promote,
62
- @version, @environments, is_force, params[:description],
63
- :force_yum_metadata_regeneration => params[:force_yum_metadata_regeneration])
60
+ @version, @environments, is_force, params[:description])
64
61
  respond_for_async :resource => task
65
62
  end
66
63
 
@@ -133,6 +130,7 @@ module Katello
133
130
  param :add_content, Hash do
134
131
  param :errata_ids, Array, :desc => "Errata ids or uuids to copy into the new versions"
135
132
  param :package_ids, Array, :desc => "Package ids or uuids to copy into the new versions"
133
+ param :deb_ids, Array, :desc => "Deb Package ids or uuids to copy into the new versions"
136
134
  param :puppet_module_ids, Array, :desc => "Puppet Module ids or uuids to copy into the new versions"
137
135
  end
138
136
  param :update_hosts, Hash, :desc => N_("After generating the incremental update, apply the changes to the specified hosts. Only Errata are supported currently.") do
@@ -277,6 +275,10 @@ module Katello
277
275
  fail _("package_ids is not an array") unless content[:package_ids].is_a?(Array)
278
276
  end
279
277
 
278
+ if content[:deb_ids]
279
+ fail _("deb_ids is not an array") unless content[:deb_ids].is_a?(Array)
280
+ end
281
+
280
282
  if content[:puppet_module_ids]
281
283
  fail _("puppet_module_ids is not an array") unless content[:puppet_module_ids].is_a?(Array)
282
284
  end
@@ -77,8 +77,6 @@ module Katello
77
77
  api :POST, "/content_views/:id/publish", N_("Publish a content view")
78
78
  param :id, :number, :desc => N_("Content view identifier"), :required => true
79
79
  param :description, String, :desc => N_("Description for the new published content view version")
80
- param :force_yum_metadata_regeneration, :bool, :desc => N_("Force yum metadata regeneration on the repositories " \
81
- "in the content view version")
82
80
  param :major, :number, :desc => N_("Override the major version number"), :required => false
83
81
  param :minor, :number, :desc => N_("Override the minor version number"), :required => false
84
82
 
@@ -91,8 +89,15 @@ module Katello
91
89
  fail HttpErrors::BadRequest, _("Directly setting package lists on composite content views is not allowed. Please " \
92
90
  "update the components, then re-publish the composite.")
93
91
  end
92
+ if params[:major].present? && params[:minor].present? && ContentViewVersion.find_by(:content_view_id => params[:id], :major => params[:major], :minor => params[:minor]).present?
93
+ fail HttpErrors::BadRequest, _("A CV version already exists with the same major and minor version (%{major}.%{minor})") % {:major => params[:major], :minor => params[:minor]}
94
+ end
95
+
96
+ if params[:major].present? && params[:minor].nil? || params[:major].nil? && params[:minor].present?
97
+ fail HttpErrors::BadRequest, _("Both major and minor parameters have to be used to override a CV version")
98
+ end
99
+
94
100
  task = async_task(::Actions::Katello::ContentView::Publish, @view, params[:description],
95
- :force_yum_metadata_regeneration => params[:force_yum_metadata_regeneration],
96
101
  :major => params[:major],
97
102
  :minor => params[:minor],
98
103
  :repos_units => params[:repos_units])
@@ -61,7 +61,8 @@ module Katello
61
61
  param :id, :number, :desc => N_("gpg key numeric identifier"), :required => true
62
62
  param_group :gpg_key
63
63
  def update
64
- @gpg_key.update_attributes!(gpg_key_params)
64
+ sync_task(::Actions::Katello::GpgKey::Update, @gpg_key, gpg_key_params.to_h)
65
+
65
66
  respond_for_show(:resource => @gpg_key)
66
67
  end
67
68
 
@@ -0,0 +1,39 @@
1
+ module Katello
2
+ class Api::V2::HostModuleStreamsController < Api::V2::ApiController
3
+ include Katello::Concerns::FilteredAutoCompleteSearch
4
+
5
+ before_action :find_host
6
+
7
+ resource_description do
8
+ api_version 'v2'
9
+ api_base_url "/api"
10
+ end
11
+
12
+ api :GET, "/hosts/:host_id/module_streams", N_("List module streams available to the host")
13
+ param :host_id, :number, :required => true, :desc => N_("ID of the host")
14
+ param :status, ::Katello::HostAvailableModuleStream::API_STATES.keys, :desc => N_("Streams based on the host based on their status")
15
+ param_group :search, Api::V2::ApiController
16
+ def index
17
+ collection = scoped_search(index_relation, :name, :asc, :resource_class => ::Katello::HostAvailableModuleStream)
18
+ respond_for_index(:collection => collection)
19
+ end
20
+
21
+ def index_relation
22
+ return HostAvailableModuleStream.upgradable([@host]) if params[:status] == HostAvailableModuleStream::UPGRADABLE
23
+
24
+ rel = @host.host_available_module_streams
25
+ return rel if params[:status].blank?
26
+ rel.send(::Katello::HostAvailableModuleStream::API_STATES[params[:status]])
27
+ end
28
+
29
+ def resource_class
30
+ Katello::HostAvailableModuleStream
31
+ end
32
+
33
+ private
34
+
35
+ def find_host
36
+ @host = resource_finder(::Host::Managed.authorized(:view_hosts, ::Host::Managed), params[:host_id])
37
+ end
38
+ end
39
+ end
@@ -13,6 +13,9 @@ module Katello
13
13
 
14
14
  before_action :validate_content_action, :only => [:install_content, :update_content, :remove_content]
15
15
 
16
+ # disable *_count fields on erratum rabl, since they perform N+1 queries
17
+ before_action :disable_erratum_hosts_count
18
+
16
19
  resource_description do
17
20
  api_version 'v2'
18
21
  api_base_url "/api"
@@ -20,17 +23,17 @@ module Katello
20
23
 
21
24
  PARAM_ACTIONS = {
22
25
  :install_content => {
23
- :package => :install_packages,
24
- :package_group => :install_package_groups,
26
+ :package => ::Actions::Katello::Host::Package::Install,
27
+ :package_group => ::Actions::Katello::Host::PackageGroup::Install,
25
28
  :errata => :install_errata
26
29
  },
27
30
  :update_content => {
28
- :package => :update_packages,
29
- :package_group => :update_package_groups
31
+ :package => ::Actions::Katello::Host::Package::Update,
32
+ :package_group => ::Actions::Katello::Host::PackageGroup::Install
30
33
  },
31
34
  :remove_content => {
32
- :package => :uninstall_packages,
33
- :package_group => :uninstall_package_groups
35
+ :package => ::Actions::Katello::Host::Package::Remove,
36
+ :package_group => ::Actions::Katello::Host::PackageGroup::Remove
34
37
  }
35
38
  }.with_indifferent_access
36
39
 
@@ -225,8 +228,7 @@ module Katello
225
228
  param :errata_ids, Array, :desc => N_("List of Errata ids")
226
229
  def available_incremental_updates
227
230
  version_environments = {}
228
- content_facets = Katello::Host::ContentFacet.with_non_installable_errata(@errata).
229
- where("#{Katello::Host::ContentFacet.table_name}.host_id" => @hosts)
231
+ content_facets = Katello::Host::ContentFacet.with_non_installable_errata(@errata, @hosts)
230
232
 
231
233
  ContentViewEnvironment.for_content_facets(content_facets).each do |cve|
232
234
  version = cve.content_view_version
@@ -308,9 +310,12 @@ module Katello
308
310
  task = async_task(::Actions::BulkAction, ::Actions::Katello::Host::Erratum::ApplicableErrataInstall, @hosts, errata_uuids.uniq)
309
311
  respond_for_async :resource => task
310
312
  else
311
- action = Katello::BulkActions.new(@hosts)
312
- job = action.send(PARAM_ACTIONS[params[:action]][params[:content_type]], params[:content], :update_all => params[:update_all])
313
- respond_for_show :template => 'job', :resource => job
313
+ content = params[:content]
314
+ if params[:action] == :update_content && params[:update_all]
315
+ content = []
316
+ end
317
+ task = async_task(::Actions::BulkAction, PARAM_ACTIONS[params[:action]][params[:content_type]], @hosts, content)
318
+ respond_for_async :resource => task
314
319
  end
315
320
  end
316
321
 
@@ -330,5 +335,9 @@ module Katello
330
335
  def find_content_view
331
336
  @view = ContentView.find(params[:content_view_id])
332
337
  end
338
+
339
+ def disable_erratum_hosts_count
340
+ @disable_counts = true
341
+ end
333
342
  end
334
343
  end
@@ -6,7 +6,8 @@ module Katello
6
6
 
7
7
  before_action :check_params, :only => :index
8
8
 
9
- update_api(:index) do
9
+ # updating params inherited from Katello::Concerns::Api::V2::RepositoryContentController
10
+ apipie_update_params([:index]) do
10
11
  param :host_ids, Array, :desc => N_("List of host id to list available module streams for")
11
12
  param :name_stream_only, :boolean, :desc => N_("Return name and stream information only)")
12
13
  end
@@ -4,8 +4,7 @@ module Katello
4
4
 
5
5
  include Katello::Concerns::FilteredAutoCompleteSearch
6
6
 
7
- before_action :find_product, :except => [:index, :auto_complete_search]
8
- before_action :find_product_or_organization, :only => [:index, :auto_complete_search]
7
+ before_action :find_product_or_organization
9
8
  before_action :custom_product?
10
9
  before_action :find_product_content, :except => [:index, :auto_complete_search]
11
10
 
@@ -15,7 +14,7 @@ module Katello
15
14
 
16
15
  api :GET, "/repository_sets", N_("List repository sets.")
17
16
  api :GET, "/products/:product_id/repository_sets", N_("List repository sets for a product.")
18
- param :product_id, :number, :required => true, :desc => N_("ID of a product to list repository sets from")
17
+ param :product_id, :number, :required => false, :desc => N_("ID of a product to list repository sets from")
19
18
  param :name, String, :required => false, :desc => N_("Repository set name to search on")
20
19
  param :enabled, :bool, :required => false, :desc => N_("If true, only return repository sets that have been enabled. Defaults to false")
21
20
  param :with_active_subscription, :bool, :required => false, :desc => N_("If true, only return repository sets that are associated with an active subscriptions")
@@ -28,7 +27,8 @@ module Katello
28
27
  api :GET, "/repository_sets/:id", N_("Get info about a repository set")
29
28
  api :GET, "/products/:product_id/repository_sets/:id", N_("Get info about a repository set")
30
29
  param :id, :number, :required => true, :desc => N_("ID of the repository set")
31
- param :product_id, :number, :required => true, :desc => N_("ID of a product to list repository sets from")
30
+ param :product_id, :number, :required => false, :desc => N_("ID of a product to list repository sets from")
31
+ param :organization_id, :number, :desc => N_("organization identifier"), :required => false
32
32
  def show
33
33
  respond :resource => @product_content
34
34
  end
@@ -36,7 +36,8 @@ module Katello
36
36
  api :GET, "/repository_sets/:id/available_repositories", N_("Get list of available repositories for the repository set")
37
37
  api :GET, "/products/:product_id/repository_sets/:id/available_repositories", N_("Get list of available repositories for the repository set")
38
38
  param :id, :number, :required => true, :desc => N_("ID of the repository set")
39
- param :product_id, :number, :required => true, :desc => N_("ID of a product to list repository sets from")
39
+ param :product_id, :number, :required => false, :desc => N_("ID of a product to list repository sets from")
40
+ param :organization_id, :number, :desc => N_("organization identifier"), :required => false
40
41
  def available_repositories
41
42
  scan_cdn = sync_task(::Actions::Katello::RepositorySet::ScanCdn, @product, @product_content.content.cp_content_id)
42
43
  repos = scan_cdn.output[:results]
@@ -72,9 +73,10 @@ module Katello
72
73
  api :PUT, "/repository_sets/:id/enable", N_("Enable a repository from the set")
73
74
  api :PUT, "/products/:product_id/repository_sets/:id/enable", N_("Enable a repository from the set")
74
75
  param :id, :number, :required => true, :desc => N_("ID of the repository set to enable")
75
- param :product_id, :number, :required => true, :desc => N_("ID of the product containing the repository set")
76
+ param :product_id, :number, :required => false, :desc => N_("ID of the product containing the repository set")
76
77
  param :basearch, String, :required => false, :desc => N_("Basearch to enable")
77
78
  param :releasever, String, :required => false, :desc => N_("Releasever to enable")
79
+ param :organization_id, :number, :desc => N_("organization identifier"), :required => false
78
80
  def enable
79
81
  task = sync_task(::Actions::Katello::RepositorySet::EnableRepository, @product, @product_content.content, substitutions)
80
82
  respond_for_async :resource => task
@@ -83,9 +85,10 @@ module Katello
83
85
  api :PUT, "/repository_sets/:id/disable", N_("Disable a repository from the set")
84
86
  api :PUT, "/products/:product_id/repository_sets/:id/disable", N_("Disable a repository from the set")
85
87
  param :id, :number, :required => true, :desc => N_("ID of the repository set to disable")
86
- param :product_id, :number, :required => true, :desc => N_("ID of the product containing the repository set")
88
+ param :product_id, :number, :required => false, :desc => N_("ID of the product containing the repository set")
87
89
  param :basearch, String, :required => false, :desc => N_("Basearch to disable")
88
90
  param :releasever, String, :required => false, :desc => N_("Releasever to disable")
91
+ param :organization_id, :number, :desc => N_("organization identifier"), :required => false
89
92
  def disable
90
93
  task = sync_task(::Actions::Katello::RepositorySet::DisableRepository, @product, @product_content.content, substitutions)
91
94
  respond_for_async :resource => task
@@ -118,8 +121,14 @@ module Katello
118
121
  end
119
122
 
120
123
  def find_product_content
121
- @product_content = @product.product_content_by_id(params[:id])
124
+ if @product.present?
125
+ @product_content = @product.product_content_by_id(params[:id])
126
+ else
127
+ content = Katello::Content.find_by(:cp_content_id => params[:id], :organization_id => @organization[:id])
128
+ @product_content = Katello::ProductContent.find_by(:id => content[:id])
129
+ end
122
130
  fail HttpErrors::NotFound, _("Couldn't find repository set with id '%s'.") % params[:id] if @product_content.nil?
131
+ @product = @product_content.product if @product.nil?
123
132
  end
124
133
 
125
134
  def find_product_or_organization