katello 3.16.2 → 3.17.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 (381) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/katello/katello.scss +3 -7
  3. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +1 -1
  4. data/app/controllers/katello/api/v2/activation_keys_controller.rb +8 -0
  5. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +10 -4
  6. data/app/controllers/katello/api/v2/host_tracer_controller.rb +33 -8
  7. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +11 -11
  8. data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +0 -15
  9. data/app/controllers/katello/api/v2/repositories_controller.rb +5 -11
  10. data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +16 -0
  11. data/app/controllers/katello/concerns/api/v2/bulk_hosts_extensions.rb +4 -4
  12. data/app/controllers/katello/concerns/api/v2/hostgroups_controller_extensions.rb +1 -1
  13. data/app/controllers/katello/concerns/hosts_controller_extensions.rb +5 -11
  14. data/app/helpers/katello/concerns/dashboard_helper_extensions.rb +10 -0
  15. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +6 -7
  16. data/app/lib/actions/candlepin/product/content_add.rb +2 -1
  17. data/app/lib/actions/candlepin/product/content_update_enablement.rb +18 -0
  18. data/app/lib/actions/katello/applicability/hosts/bulk_generate.rb +2 -6
  19. data/app/lib/actions/katello/capsule_content/refresh_repos.rb +1 -1
  20. data/app/lib/actions/katello/capsule_content/sync.rb +1 -1
  21. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +3 -17
  22. data/app/lib/actions/katello/content_view_version/incremental_update.rb +2 -3
  23. data/app/lib/actions/katello/organization/simple_content_access/disable.rb +17 -0
  24. data/app/lib/actions/katello/organization/simple_content_access/enable.rb +17 -0
  25. data/app/lib/actions/katello/organization/simple_content_access/toggle.rb +36 -0
  26. data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +13 -0
  27. data/app/lib/actions/katello/product/content_create.rb +3 -3
  28. data/app/lib/actions/katello/product/destroy.rb +4 -25
  29. data/app/lib/actions/katello/repository/content_update.rb +41 -0
  30. data/app/lib/actions/katello/repository/destroy.rb +1 -5
  31. data/app/lib/actions/katello/repository/export.rb +1 -1
  32. data/app/lib/actions/katello/repository/multi_clone_contents.rb +15 -13
  33. data/app/lib/actions/katello/repository/sync.rb +25 -35
  34. data/app/lib/actions/katello/repository/update.rb +19 -30
  35. data/app/lib/actions/katello/repository/update_cv_repo_cert_guard.rb +17 -0
  36. data/app/lib/actions/pulp/orchestration/repository/smart_proxy_sync.rb +1 -0
  37. data/app/lib/actions/pulp/orchestration/repository/sync.rb +1 -2
  38. data/app/lib/actions/pulp/repository/sync.rb +1 -2
  39. data/app/lib/actions/pulp3/abstract_async_task.rb +0 -1
  40. data/app/lib/actions/pulp3/capsule_content/sync.rb +1 -3
  41. data/app/lib/actions/pulp3/content_view/delete_repository_references.rb +1 -1
  42. data/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb +2 -1
  43. data/app/lib/actions/pulp3/orchestration/repository/sync.rb +1 -3
  44. data/app/lib/actions/pulp3/repository/copy_content.rb +1 -0
  45. data/app/lib/actions/pulp3/repository/delete.rb +1 -1
  46. data/app/lib/actions/pulp3/repository/multi_copy_content.rb +1 -1
  47. data/app/lib/actions/pulp3/repository/save_version.rb +16 -20
  48. data/app/lib/actions/pulp3/repository/sync.rb +1 -1
  49. data/app/lib/actions/pulp3/repository/update_cv_repository_cert_guard.rb +2 -6
  50. data/app/lib/actions/pulp3/repository/upload_file.rb +1 -1
  51. data/app/lib/katello/resources/candlepin/product.rb +11 -0
  52. data/app/lib/katello/resources/cdn.rb +2 -3
  53. data/app/lib/katello/util/cdn_var_substitutor.rb +7 -9
  54. data/app/lib/katello/validators/hostgroup_kickstart_repository_validator.rb +11 -11
  55. data/app/models/katello/activation_key.rb +1 -1
  56. data/app/models/katello/concerns/content_facet_host_extensions.rb +7 -0
  57. data/app/models/katello/concerns/host_managed_extensions.rb +39 -0
  58. data/app/models/katello/concerns/hostgroup_extensions.rb +46 -24
  59. data/app/models/katello/concerns/smart_proxy_extensions.rb +5 -19
  60. data/app/models/katello/concerns/widget_extensions.rb +23 -0
  61. data/app/models/katello/content_view.rb +9 -1
  62. data/app/models/katello/content_view_package_filter.rb +1 -1
  63. data/app/models/katello/content_view_version.rb +7 -0
  64. data/app/models/katello/erratum.rb +13 -0
  65. data/app/models/katello/erratum_cve.rb +8 -0
  66. data/app/models/katello/glue/pulp/repo.rb +1 -1
  67. data/app/models/katello/host/content_facet.rb +18 -1
  68. data/app/models/katello/host_collection.rb +6 -0
  69. data/app/models/katello/hostgroup/content_facet.rb +18 -0
  70. data/app/models/katello/installed_package.rb +8 -0
  71. data/app/models/katello/kt_environment.rb +9 -1
  72. data/app/models/katello/model.rb +16 -0
  73. data/app/models/katello/pool.rb +17 -0
  74. data/app/models/katello/product.rb +6 -0
  75. data/app/models/katello/purpose_addons_status.rb +1 -0
  76. data/app/models/katello/purpose_role_status.rb +1 -0
  77. data/app/models/katello/purpose_sla_status.rb +1 -0
  78. data/app/models/katello/purpose_usage_status.rb +1 -0
  79. data/app/models/katello/repository.rb +3 -6
  80. data/app/models/katello/root_repository.rb +24 -16
  81. data/app/models/katello/subscription_status.rb +1 -1
  82. data/app/models/katello/trace_status.rb +1 -1
  83. data/app/models/setting/content.rb +6 -2
  84. data/app/services/cert/certs.rb +2 -10
  85. data/app/services/katello/event_daemon.rb +7 -8
  86. data/app/services/katello/host_status_manager.rb +13 -0
  87. data/app/services/katello/pulp3/migration.rb +1 -1
  88. data/app/services/katello/pulp3/repository/yum.rb +6 -72
  89. data/app/services/katello/pulp3/repository.rb +11 -10
  90. data/app/services/katello/pulp3/smart_proxy_mirror_repository.rb +1 -1
  91. data/app/services/katello/pulp3/task.rb +3 -3
  92. data/app/services/katello/pulp3/task_group.rb +0 -6
  93. data/app/services/katello/smart_proxy_helper.rb +16 -13
  94. data/app/views/foreman/smart_proxies/_content_sync.html.erb +1 -1
  95. data/app/views/katello/api/v2/repositories/base.json.rabl +1 -1
  96. data/config/routes/api/rhsm.rb +0 -1
  97. data/config/routes/api/v2.rb +8 -2
  98. data/config/routes/overrides.rb +0 -4
  99. data/db/migrate/20141222151001_add_host_content_view_environment.rb +1 -1
  100. data/db/migrate/20180904122343_create_hostgroup_content_facet.katello.rb +16 -0
  101. data/db/migrate/20200514092553_move_katello_fields_from_hostgroups.katello.rb +53 -0
  102. data/db/migrate/20200610112009_remove_audits_of_root_repo_with_content_id.rb +9 -0
  103. data/db/migrate/20200701150946_add_auto_enabled_to_root_repository.rb +5 -0
  104. data/db/seeds.d/75-job_templates.rb +2 -2
  105. data/engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js +3 -1
  106. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-associations.controller.js +5 -2
  107. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-details.controller.js +4 -2
  108. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-add-subscriptions.html +1 -1
  109. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-associations-content-hosts.html +2 -2
  110. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-details.html +1 -1
  111. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +4 -1
  112. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-packages-modal.controller.js +4 -1
  113. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-subscriptions-modal.controller.js +1 -0
  114. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-traces-modal.controller.js +4 -3
  115. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-environment-modal.html +7 -1
  116. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html +1 -0
  117. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-packages-modal.html +1 -0
  118. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +4 -2
  119. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.routes.js +1 -1
  120. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details-info.controller.js +7 -1
  121. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +4 -2
  122. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-add-subscriptions.html +1 -1
  123. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +1 -0
  124. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +14 -6
  125. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-subscriptions-list.html +1 -1
  126. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +6 -6
  127. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-details.controller.js +5 -2
  128. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +1 -1
  129. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-bulk-action.factory.js +1 -2
  130. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-traces-resolve.factory.js +18 -0
  131. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +45 -4
  132. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +1 -1
  133. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +1 -1
  134. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +1 -1
  135. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/it.po +1 -1
  136. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +1 -1
  137. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +1 -1
  138. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +1 -1
  139. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ru.po +1 -1
  140. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +1 -1
  141. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +1 -1
  142. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/product-bulk-action.factory.js +0 -1
  143. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details.controller.js +0 -6
  144. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-details.html +1 -7
  145. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +11 -1
  146. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +1 -1
  147. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +16 -4
  148. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository.factory.js +0 -1
  149. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.controller.js +0 -15
  150. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/views/products.html +0 -6
  151. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +1 -1
  152. data/lib/katello/engine.rb +6 -5
  153. data/lib/katello/permission_creator.rb +3 -3
  154. data/lib/katello/permissions/host_permissions.rb +0 -1
  155. data/lib/katello/plugin.rb +20 -16
  156. data/lib/katello/tasks/pulp3_post_migration_check.rake +1 -2
  157. data/lib/katello/tasks/reimport.rake +1 -1
  158. data/lib/katello/tasks/reports.rake +0 -12
  159. data/lib/katello/tasks/test.rake +15 -0
  160. data/lib/katello/version.rb +1 -1
  161. data/locale/action_names.rb +48 -48
  162. data/locale/bn/katello.po +137 -14
  163. data/locale/cs/katello.po +137 -14
  164. data/locale/de/katello.po +138 -15
  165. data/locale/en/katello.po +137 -14
  166. data/locale/es/katello.po +138 -15
  167. data/locale/fr/katello.po +138 -15
  168. data/locale/gu/katello.po +137 -14
  169. data/locale/hi/katello.po +137 -14
  170. data/locale/it/katello.po +138 -15
  171. data/locale/ja/katello.po +138 -15
  172. data/locale/katello.pot +969 -769
  173. data/locale/kn/katello.po +137 -14
  174. data/locale/ko/katello.po +138 -15
  175. data/locale/mr/katello.po +137 -14
  176. data/locale/or/katello.po +137 -14
  177. data/locale/pa/katello.po +137 -14
  178. data/locale/pt/katello.po +137 -14
  179. data/locale/pt_BR/katello.po +138 -15
  180. data/locale/ru/katello.po +138 -15
  181. data/locale/ta/katello.po +137 -14
  182. data/locale/te/katello.po +137 -14
  183. data/locale/zh_CN/katello.po +138 -15
  184. data/locale/zh_TW/katello.po +138 -15
  185. data/package.json +8 -25
  186. data/webpack/__mocks__/foremanReact/Root/Context/ForemanContext.js +3 -0
  187. data/webpack/components/ActionableDetail.js +63 -0
  188. data/webpack/components/Content/ContentTable.js +2 -2
  189. data/webpack/components/Content/Details/ContentDetailRepositoryTableSchema.js +1 -1
  190. data/webpack/components/Content/Details/ContentDetails.js +1 -1
  191. data/webpack/components/Content/__tests__/ContentTable.test.js +2 -2
  192. data/webpack/components/Content/__tests__/__snapshots__/ContentPage.test.js.snap +1 -1
  193. data/webpack/components/EditableSwitch.js +30 -0
  194. data/webpack/components/EditableTextInput/EditableTextInput.js +120 -0
  195. data/webpack/components/EditableTextInput/__tests__/editableTextInput.test.js +52 -0
  196. data/webpack/components/EditableTextInput/editableTextInput.scss +14 -0
  197. data/webpack/components/EditableTextInput/index.js +3 -0
  198. data/webpack/{scenes/ContentViews/components → components}/Loading.js +8 -5
  199. data/webpack/{move_to_pf → components}/LoadingState/LoadingState.js +0 -0
  200. data/webpack/{move_to_pf → components}/LoadingState/LoadingState.scss +0 -0
  201. data/webpack/{move_to_pf → components}/LoadingState/LoadingState.test.js +0 -0
  202. data/webpack/{move_to_pf → components}/LoadingState/__snapshots__/LoadingState.test.js.snap +0 -0
  203. data/webpack/{move_to_pf → components}/LoadingState/index.js +0 -0
  204. data/webpack/components/MultiSelect/index.js +1 -1
  205. data/webpack/{move_to_pf → components}/OptionTooltip/OptionTooltip.scss +0 -0
  206. data/webpack/{move_to_pf → components}/OptionTooltip/__tests__/OptionTooltip.test.js +0 -0
  207. data/webpack/{move_to_pf → components}/OptionTooltip/__tests__/__snapshots__/OptionTooltip.test.js.snap +0 -0
  208. data/webpack/{move_to_pf → components}/OptionTooltip/index.js +0 -0
  209. data/webpack/components/Search/Search.js +124 -0
  210. data/webpack/components/Search/Search.test.js +2 -1
  211. data/webpack/components/Search/__snapshots__/Search.test.js.snap +2 -0
  212. data/webpack/components/Search/__tests__/search.test.js +124 -0
  213. data/webpack/components/Search/index.js +11 -87
  214. data/webpack/{move_to_pf → components}/Select/Select.js +0 -0
  215. data/webpack/components/SelectOrg/SetOrganization.js +2 -2
  216. data/webpack/components/TabWrapper/TabWrapper.js +26 -0
  217. data/webpack/components/TabWrapper/index.js +3 -0
  218. data/webpack/components/TabbedView/TabbedView.js +38 -0
  219. data/webpack/components/TabbedView/TabbedView.scss +3 -0
  220. data/webpack/components/TabbedView/index.js +3 -0
  221. data/webpack/components/Table/EmptyStateMessage.js +61 -0
  222. data/webpack/{scenes/ContentViews/Table/TableWrapper.js → components/Table/MainTable.js} +23 -12
  223. data/webpack/components/Table/TableWrapper.js +94 -0
  224. data/webpack/{move_to_pf → components}/TooltipButton/TooltipButton.js +0 -0
  225. data/webpack/{move_to_pf → components}/TooltipButton/TooltipButton.scss +0 -0
  226. data/webpack/{move_to_pf → components}/TooltipButton/TooltipButton.test.js +0 -0
  227. data/webpack/{move_to_pf → components}/TooltipButton/__snapshots__/TooltipButton.test.js.snap +0 -0
  228. data/webpack/{move_to_pf → components}/TooltipButton/index.js +0 -0
  229. data/webpack/components/TypeAhead/TypeAhead.js +109 -0
  230. data/webpack/{move_to_pf → components}/TypeAhead/TypeAhead.scss +0 -0
  231. data/webpack/components/TypeAhead/helpers/commonPropTypes.js +35 -0
  232. data/webpack/components/TypeAhead/helpers/helpers.js +32 -0
  233. data/webpack/components/TypeAhead/index.js +3 -0
  234. data/webpack/{move_to_pf/TypeAhead → components/TypeAhead/pf3Search}/TypeAheadInput.js +3 -6
  235. data/webpack/{move_to_pf/TypeAhead → components/TypeAhead/pf3Search}/TypeAheadItems.js +3 -7
  236. data/webpack/components/TypeAhead/pf3Search/TypeAheadSearch.js +52 -0
  237. data/webpack/components/TypeAhead/pf4Search/TypeAheadInput.js +44 -0
  238. data/webpack/components/TypeAhead/pf4Search/TypeAheadInput.scss +11 -0
  239. data/webpack/components/TypeAhead/pf4Search/TypeAheadItems.js +57 -0
  240. data/webpack/components/TypeAhead/pf4Search/TypeAheadSearch.js +66 -0
  241. data/webpack/components/TypeAhead/pf4Search/TypeAheadSearch.scss +5 -0
  242. data/webpack/components/extensions/about/__tests__/SystemStatuses.test.js +1 -1
  243. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/CollapseSubscriptionGroupButton.js +0 -0
  244. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/CollapseSubscriptionGroupButton.test.js +0 -0
  245. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/Table.js +0 -0
  246. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/Table.test.js +0 -0
  247. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableBody.js +0 -0
  248. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableBody.test.js +0 -0
  249. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableBodyMessage.js +0 -0
  250. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableBodyMessage.test.js +0 -0
  251. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableFixtures.js +0 -0
  252. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableSelectionCell.js +0 -0
  253. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableSelectionCell.test.js +0 -0
  254. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableSelectionHeaderCell.js +0 -0
  255. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableSelectionHeaderCell.test.js +0 -0
  256. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/CollapseSubscriptionGroupButton.test.js.snap +0 -0
  257. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/Table.test.js.snap +0 -0
  258. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/TableBody.test.js.snap +0 -0
  259. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/TableBodyMessage.test.js.snap +0 -0
  260. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/TableSelectionCell.test.js.snap +0 -0
  261. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/TableSelectionHeaderCell.test.js.snap +0 -0
  262. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/index.js +0 -0
  263. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/EntitlementsInlineEditFormatter.js +1 -1
  264. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/__tests__/EntitlementsInlineEditFormatter.test.js +0 -0
  265. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/__tests__/__snapshots__/EntitlementsInlineEditFormatter.test.js.snap +0 -0
  266. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/cellFormatter.js +0 -0
  267. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/collapseableAndSelectionCellFormatter.js +0 -0
  268. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/ellipsisCellFormatter.js +0 -0
  269. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/headerFormatter.js +0 -0
  270. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/index.js +0 -0
  271. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/selectionCellFormatter.js +0 -0
  272. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/selectionHeaderCellFormatter.js +0 -0
  273. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/index.js +0 -0
  274. data/webpack/{move_to_pf → components}/react-bootstrap-select/index.js +0 -0
  275. data/webpack/containers/Application/config.js +5 -0
  276. data/webpack/containers/Application/overrides.scss +5 -0
  277. data/webpack/global_test_setup.js +3 -1
  278. data/webpack/redux/OrganizationProducts/OrganizationProductsActions.js +1 -1
  279. data/webpack/redux/OrganizationProducts/__tests__/OrganizationProductsActions.test.js +2 -2
  280. data/webpack/redux/actions/RedHatRepositories/enabled.js +1 -1
  281. data/webpack/redux/actions/RedHatRepositories/helpers.js +1 -1
  282. data/webpack/redux/actions/RedHatRepositories/repositorySetRepositories.js +1 -1
  283. data/webpack/redux/reducers/index.js +2 -0
  284. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js +1 -1
  285. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsTableSchema.js +1 -1
  286. data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsActions.js +1 -1
  287. data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailsActions.test.js +2 -2
  288. data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsTable.test.js +1 -1
  289. data/webpack/scenes/ContentViews/ContentViewSelectors.js +1 -2
  290. data/webpack/scenes/ContentViews/ContentViewsActions.js +4 -4
  291. data/webpack/scenes/ContentViews/ContentViewsConstants.js +4 -1
  292. data/webpack/scenes/ContentViews/ContentViewsPage.js +12 -6
  293. data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +44 -0
  294. data/webpack/scenes/ContentViews/Details/ContentViewDetailReducer.js +23 -0
  295. data/webpack/scenes/ContentViews/{details → Details}/ContentViewDetailSelectors.js +3 -0
  296. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +70 -0
  297. data/webpack/scenes/ContentViews/Details/ContentViewInfo.js +116 -0
  298. data/webpack/scenes/ContentViews/{details → Details}/DetailsContainer.js +8 -4
  299. data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +101 -0
  300. data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetails.fixtures.json +106 -0
  301. data/webpack/scenes/ContentViews/Details/contentViewInfo.scss +8 -0
  302. data/webpack/scenes/ContentViews/Details/index.js +7 -0
  303. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +51 -36
  304. data/webpack/scenes/ContentViews/Table/tableDataGenerator.js +47 -44
  305. data/webpack/scenes/ContentViews/__tests__/basicContentViews.fixtures.js +31 -0
  306. data/webpack/scenes/ContentViews/__tests__/contentViewList.fixtures.json +2 -1
  307. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +173 -23
  308. data/webpack/scenes/ContentViews/components/ContentViewIcon.js +26 -0
  309. data/webpack/scenes/ContentViews/components/{contentViewName.scss → contentViewIcon.scss} +0 -0
  310. data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailsActions.js +1 -1
  311. data/webpack/scenes/ModuleStreams/Details/Profiles/TableSchema.js +1 -1
  312. data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetailsActions.test.js +2 -2
  313. data/webpack/scenes/ModuleStreams/ModuleStreamsActions.js +1 -1
  314. data/webpack/scenes/ModuleStreams/ModuleStreamsTableSchema.js +1 -1
  315. data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsTable.test.js +1 -1
  316. data/webpack/scenes/Organizations/OrganizationSelectors.js +14 -0
  317. data/webpack/scenes/Products/ProductActions.js +1 -1
  318. data/webpack/scenes/RedHatRepositories/RedHatRepositoriesPage.js +1 -1
  319. data/webpack/scenes/Settings/SettingsConstants.js +3 -0
  320. data/webpack/scenes/Settings/SettingsReducer.js +33 -0
  321. data/webpack/scenes/Settings/SettingsSelectors.js +4 -0
  322. data/webpack/scenes/Settings/index.js +2 -1
  323. data/webpack/scenes/Subscriptions/Details/SubscriptionDetailActions.js +1 -1
  324. data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.js +1 -1
  325. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +59 -73
  326. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.scss +15 -0
  327. data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +43 -1
  328. data/webpack/scenes/Subscriptions/Manifest/ManifestConstants.js +8 -0
  329. data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryTableSchema.js +1 -1
  330. data/webpack/scenes/Subscriptions/Manifest/SimpleContentAccess.js +78 -0
  331. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +2 -0
  332. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestActions.test.js +56 -1
  333. data/webpack/scenes/Subscriptions/Manifest/__tests__/SimpleContentAccess.test.js +114 -0
  334. data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +6 -6
  335. data/webpack/scenes/Subscriptions/Manifest/__tests__/manifest.fixtures.js +36 -0
  336. data/webpack/scenes/Subscriptions/Manifest/index.js +3 -1
  337. data/webpack/scenes/Subscriptions/SubscriptionActions.js +1 -1
  338. data/webpack/scenes/Subscriptions/SubscriptionConstants.js +4 -0
  339. data/webpack/scenes/Subscriptions/SubscriptionHelpers.js +0 -3
  340. data/webpack/scenes/Subscriptions/SubscriptionReducer.js +38 -11
  341. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +30 -18
  342. data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +0 -3
  343. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsActions.js +1 -1
  344. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +2 -2
  345. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js +1 -1
  346. data/webpack/scenes/Subscriptions/__tests__/SubscriptionHelpers.test.js +0 -11
  347. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsActions.test.js.snap +2 -2
  348. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +4 -4
  349. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsReducer.test.js.snap +26 -1
  350. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js +2 -2
  351. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTable.js +27 -21
  352. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +6 -2
  353. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +2 -2
  354. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionTypeFormatter.test.js.snap +3 -3
  355. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/components/Table.js +1 -1
  356. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +28 -3
  357. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +5 -10
  358. data/webpack/scenes/Subscriptions/index.js +6 -2
  359. data/webpack/test-utils/nockWrapper.js +39 -5
  360. data/webpack/test-utils/react-testing-lib-wrapper.js +35 -9
  361. data/webpack/{move_to_foreman/common → utils}/helpers.js +12 -8
  362. data/webpack/utils/useEventListener.js +37 -0
  363. metadata +143 -83
  364. data/app/lib/actions/katello/repository/verify_checksum.rb +0 -28
  365. data/app/lib/actions/pulp3/orchestration/repository/trigger_update_repo_cert_guard.rb +0 -22
  366. data/app/lib/actions/pulp3/repository/presenters/repair_presenter.rb +0 -85
  367. data/app/lib/actions/pulp3/repository/repair.rb +0 -29
  368. data/app/services/katello/host_trace_manager.rb +0 -38
  369. data/vendor/assets/stylesheets/katello/jquery.loadmask.css.scss +0 -40
  370. data/vendor/assets/stylesheets/katello/ui.spinner.css.scss +0 -3
  371. data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalActions.js +0 -2
  372. data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalSelectors.js +0 -2
  373. data/webpack/__mocks__/foremanReact/components/ForemanModal/index.js +0 -4
  374. data/webpack/__mocks__/foremanReact/components/Settings/SettingsActions.js +0 -4
  375. data/webpack/__mocks__/foremanReact/components/Settings/SettingsConstants.js +0 -2
  376. data/webpack/move_to_pf/TypeAhead/TypeAhead.js +0 -138
  377. data/webpack/move_to_pf/TypeAhead/helpers.js +0 -5
  378. data/webpack/scenes/ContentViews/components/ContentViewName.js +0 -33
  379. data/webpack/scenes/ContentViews/components/EmptyStateMessage.js +0 -43
  380. data/webpack/scenes/ContentViews/details/ContentViewDetailActions.js +0 -12
  381. data/webpack/scenes/ContentViews/expansions/RepositoriesExpansion.js +0 -12
@@ -112,6 +112,23 @@ module Katello
112
112
  Pool.joins(:subscription).order("subscription.name")
113
113
  end
114
114
 
115
+ apipie :class, desc: "A class representing #{model_name.human} object" do
116
+ name 'Pool'
117
+ refs 'Pool'
118
+ sections only: %w[all additional]
119
+ prop_group :katello_idname_props, Katello::Model, meta: { friendly_name: 'pool' }
120
+ property :available, Integer, desc: 'Returns number of available subscriptions'
121
+ property :quantity, Integer, desc: 'Returns number of all subscriptions'
122
+ property :consumed, Integer, desc: 'Returns number of consumed subscriptions'
123
+ property :product_id, String, desc: 'Returns ID of the product'
124
+ property :account_number, Integer, desc: 'Returns subscription account number'
125
+ property :contract_number, Integer, desc: 'Returns subscription contract number'
126
+ property :type, String, desc: 'Returns type of the pool, e.g. "NORMAL"'
127
+ property :organization, 'Organization', desc: 'Returns organization to which the pool belongs'
128
+ property :start_date, ActiveSupport::TimeWithZone, desc: 'Returns subscription start date'
129
+ property :end_date, ActiveSupport::TimeWithZone, desc: 'Returns subscription end date'
130
+ property :days_until_expiration, Integer, desc: 'Returns number of days until expiration'
131
+ end
115
132
  class Jail < ::Safemode::Jail
116
133
  allow :id, :name, :available, :quantity, :product_id, :contract_number, :type, :account_number, :start_date, :end_date, :organization, :consumed, :days_until_expiration
117
134
  end
@@ -245,6 +245,12 @@ module Katello
245
245
  end
246
246
  end
247
247
 
248
+ apipie :class, desc: "A class representing #{model_name.human} object" do
249
+ name 'Product'
250
+ refs 'Product'
251
+ sections only: %w[all additional]
252
+ prop_group :katello_basic_props, Katello::Model, meta: { friendly_name: 'Product' }
253
+ end
248
254
  class Jail < ::Safemode::Jail
249
255
  allow :name, :label
250
256
  end
@@ -1,5 +1,6 @@
1
1
  module Katello
2
2
  class PurposeAddonsStatus < HostStatus::Status
3
+ UNKNOWN = Katello::PurposeStatus::UNKNOWN
3
4
  def self.status_name
4
5
  N_('Addons')
5
6
  end
@@ -1,5 +1,6 @@
1
1
  module Katello
2
2
  class PurposeRoleStatus < HostStatus::Status
3
+ UNKNOWN = Katello::PurposeStatus::UNKNOWN
3
4
  def self.status_name
4
5
  N_('Role')
5
6
  end
@@ -1,5 +1,6 @@
1
1
  module Katello
2
2
  class PurposeSlaStatus < HostStatus::Status
3
+ UNKNOWN = Katello::PurposeStatus::UNKNOWN
3
4
  def self.status_name
4
5
  N_('Service Level')
5
6
  end
@@ -1,5 +1,6 @@
1
1
  module Katello
2
2
  class PurposeUsageStatus < HostStatus::Status
3
+ UNKNOWN = Katello::PurposeStatus::UNKNOWN
3
4
  def self.status_name
4
5
  N_('Usage')
5
6
  end
@@ -92,9 +92,11 @@ module Katello
92
92
  has_many :kickstart_content_facets, :class_name => "Katello::Host::ContentFacet", :foreign_key => :kickstart_repository_id,
93
93
  :inverse_of => :kickstart_repository, :dependent => :nullify
94
94
 
95
- has_many :kickstart_hostgroups, :class_name => "::Hostgroup", :foreign_key => :kickstart_repository_id,
95
+ has_many :kickstart_hostgroup_content_facets, :class_name => "Katello::Hostgroup::ContentFacet", :foreign_key => :kickstart_repository_id,
96
96
  :inverse_of => :kickstart_repository, :dependent => :nullify
97
97
 
98
+ has_many :kickstart_hostgroups, :class_name => "::Hostgroup", :through => :kickstart_hostgroup_content_facets
99
+
98
100
  has_many :repository_module_streams, class_name: "Katello::RepositoryModuleStream", dependent: :delete_all
99
101
  has_many :module_streams, through: :repository_module_streams
100
102
 
@@ -133,7 +135,6 @@ module Katello
133
135
  scope :in_published_environments, -> { in_content_views(Katello::ContentView.non_default).where.not(:environment_id => nil) }
134
136
  scope :order_by_root, ->(attr) { joins(:root).order("#{Katello::RootRepository.table_name}.#{attr}") }
135
137
  scope :with_content, ->(content) { joins(Katello::RepositoryTypeManager.find_content_type(content).model_class.repository_association_class.name.demodulize.underscore.pluralize.to_sym).distinct }
136
- scope :by_rpm_count, -> { left_joins(:repository_rpms).group(:id).order("count(katello_repository_rpms.id) ASC") } # smallest count first
137
138
 
138
139
  scoped_search :on => :name, :relation => :root, :complete_value => true
139
140
  scoped_search :rename => :product, :on => :name, :relation => :product, :complete_value => true
@@ -593,10 +594,6 @@ module Katello
593
594
  environment
594
595
  end
595
596
 
596
- def self.smart_proxy_syncable
597
- where.not(:environment_id => nil)
598
- end
599
-
600
597
  def exist_for_environment?(environment, content_view, attribute = nil)
601
598
  if environment.present? && content_view.in_environment?(environment)
602
599
  repos = content_view.version(environment).repos(environment)
@@ -1,6 +1,6 @@
1
1
  module Katello
2
2
  class RootRepository < Katello::Model
3
- audited
3
+ audited :except => [:content_id]
4
4
  serialize :ignorable_content
5
5
  serialize :docker_tags_whitelist
6
6
 
@@ -65,6 +65,7 @@ module Katello
65
65
  validate :ensure_valid_docker_tags_whitelist
66
66
  validate :ensure_content_attribute_restrictions
67
67
  validate :ensure_valid_upstream_authorization
68
+ validate :ensure_auto_enablement_not_set
68
69
  validate :ensure_no_checksum_on_demand
69
70
  validates :url, presence: true, if: :ostree?
70
71
  validates :checksum_type, :inclusion => {:in => CHECKSUM_TYPES}, :allow_blank => true
@@ -104,16 +105,6 @@ module Katello
104
105
  }
105
106
  delegate :redhat?, :provider, :organization, to: :product
106
107
 
107
- # Note - Audit hook added to find records based on column except associations to display audit information
108
- def self.audit_hook_to_find_records(name, change, _audit)
109
- if name =~ /_id$/
110
- case name
111
- when 'content_id'
112
- Katello::Content.find_by(:cp_content_id => change)
113
- end
114
- end
115
- end
116
-
117
108
  def library_instance
118
109
  repositories.in_default_view.first
119
110
  end
@@ -234,6 +225,11 @@ module Katello
234
225
  end
235
226
  end
236
227
 
228
+ def ensure_auto_enablement_not_set
229
+ return if new_record? || !auto_enabled_changed?
230
+ errors.add(:auto_enabled, N_("Auto Enablement may only be set on custom repositories.")) if redhat?
231
+ end
232
+
237
233
  def custom_content_path
238
234
  parts = []
239
235
  # We generate repo path only for custom product content. We add this
@@ -330,16 +326,28 @@ module Katello
330
326
 
331
327
  def format_arches
332
328
  if content_type == ::Katello::Repository::DEB_TYPE
333
- # FIXME: This should be set to self.deb_architectures but it needs to have the
334
- # subscription-manager PR https://github.com/candlepin/subscription-manager/pull/2213
335
- # merged. Otherwise subscription-manager returns _NO_ debian repository as described in
336
- # https://community.theforeman.org/t/katello-3-16-1-1-el7-subscription-manager-doesnt-create-rhsm-repos-for-ubuntu/20928/38
337
- nil
329
+ self.deb_architectures
338
330
  else
339
331
  self.arch == "noarch" ? nil : self.arch
340
332
  end
341
333
  end
342
334
 
335
+ def content_enablements
336
+ product.root_repositories.map do |repo|
337
+ repo_content = { id: repo.content_id }
338
+ repo_content[:enabled] = repo.auto_enabled? if repo == self
339
+ repo_content
340
+ end
341
+ end
342
+
343
+ apipie :class, desc: 'A class representing Repository object' do
344
+ name 'Repository'
345
+ refs 'Repository'
346
+ sections only: %w[all additional]
347
+ prop_group :katello_basic_props, Katello::Model, meta: { friendly_name: 'Repository' }
348
+ property :docker_upstream_name, String, desc: 'Returns name of the upstream docker repository'
349
+ property :url, String, desc: 'Returns repository source URL'
350
+ end
343
351
  class Jail < ::Safemode::Jail
344
352
  allow :name, :label, :docker_upstream_name, :url
345
353
  end
@@ -22,7 +22,7 @@ module Katello
22
22
  when UNSUBSCRIBED_HYPERVISOR
23
23
  N_("Unsubscribed hypervisor")
24
24
  when DISABLED
25
- N_("Disabled")
25
+ N_("Simple Content Access")
26
26
  else
27
27
  N_("Unknown subscription status")
28
28
  end
@@ -3,7 +3,7 @@ module Katello
3
3
  REQUIRE_REBOOT = 2
4
4
  REQUIRE_PROCESS_RESTART = 1
5
5
  UP_TO_DATE = 0
6
-
6
+ UNKNOWN = -1
7
7
  def self.status_name
8
8
  N_("Traces")
9
9
  end
@@ -92,7 +92,7 @@ class Setting::Content < Setting
92
92
  self.set('check_services_before_actions', N_("Whether or not to check the status of backend services such as pulp and candlepin prior to performing some actions."),
93
93
  true, N_('Check services before actions')),
94
94
  self.set('foreman_proxy_content_batch_size', N_("How many repositories should be synced concurrently on the capsule. A smaller number may lead to longer sync times. A larger number will increase dynflow load."),
95
- 100, N_('Batch size to sync repositories in.')),
95
+ 25, N_('Batch size to sync repositories in.')),
96
96
  self.set('foreman_proxy_content_auto_sync', N_("Whether or not to auto sync the Smart Proxies after a Content View promotion."),
97
97
  true, N_('Sync Smart Proxies after Content View promotion')),
98
98
  self.set('default_download_policy', N_("Default download policy for custom repositories (either 'immediate', 'on_demand', or 'background')"), "immediate",
@@ -149,7 +149,11 @@ class Setting::Content < Setting
149
149
  self.set('host_tasks_workers_pool_size', N_("Amount of workers in the pool to handle the execution of host-related tasks. When set to 0, the default queue will be used instead. Restart of the dynflowd/foreman-tasks service is required."),
150
150
  5, N_('Host Tasks Workers Pool Size')),
151
151
  self.set('applicability_batch_size', N_("Number of host applicability calculations to process per task."),
152
- 50, N_('Applicability Batch Size'))
152
+ 50, N_('Applicability Batch Size')),
153
+ self.set('autosearch_while_typing', N_('For pages that support it, automatically perform search while typing in search input.'),
154
+ true, N_('Autosearch')),
155
+ self.set('autosearch_delay', N_('If Autosearch is enabled, delay in milliseconds before executing searches while typing.'),
156
+ 500, N_('Autosearch delay'))
153
157
  ]
154
158
  end
155
159
 
@@ -9,19 +9,11 @@ module Cert
9
9
  end
10
10
 
11
11
  def self.ssl_client_cert
12
- @ssl_client_cert ||= OpenSSL::X509::Certificate.new(File.open(ssl_client_cert_filename, 'r').read)
13
- end
14
-
15
- def self.ssl_client_cert_filename
16
- Setting['pulp_client_cert']
12
+ @ssl_client_cert ||= OpenSSL::X509::Certificate.new(File.open(Setting['pulp_client_cert'], 'r').read)
17
13
  end
18
14
 
19
15
  def self.ssl_client_key
20
- @ssl_client_key ||= OpenSSL::PKey::RSA.new(File.open(ssl_client_key_filename, 'r').read)
21
- end
22
-
23
- def self.ssl_client_key_filename
24
- Setting['pulp_client_key']
16
+ @ssl_client_key ||= OpenSSL::PKey::RSA.new(File.open(Setting['pulp_client_key'], 'r').read)
25
17
  end
26
18
 
27
19
  def self.verify_ueber_cert(organization)
@@ -1,5 +1,8 @@
1
1
  module Katello
2
2
  class EventDaemon
3
+ @services = {}
4
+ @cache = ActiveSupport::Cache::MemoryStore.new
5
+
3
6
  class Monitor
4
7
  def initialize(service_classes)
5
8
  @service_classes = service_classes
@@ -44,7 +47,6 @@ module Katello
44
47
  class << self
45
48
  def initialize
46
49
  FileUtils.touch(lock_file)
47
- @cache = ActiveSupport::Cache::MemoryStore.new
48
50
  end
49
51
 
50
52
  def settings
@@ -80,7 +82,7 @@ module Katello
80
82
  return unless pid == Process.pid
81
83
  @monitor_thread.kill
82
84
  @cache.clear
83
- services.values.each(&:close)
85
+ @services.values.each(&:close)
84
86
  File.unlink(pid_file) if pid_file && File.exist?(pid_file)
85
87
  end
86
88
 
@@ -114,7 +116,7 @@ module Katello
114
116
 
115
117
  def start_monitor_thread
116
118
  @monitor_thread = Thread.new do
117
- Monitor.new(services.values).start
119
+ Monitor.new(@services.values).start
118
120
  end
119
121
  end
120
122
 
@@ -125,11 +127,8 @@ module Katello
125
127
  end
126
128
  end
127
129
 
128
- def services
129
- {
130
- candlepin_events: ::Katello::CandlepinEventListener,
131
- katello_events: ::Katello::EventMonitor::PollerThread
132
- }
130
+ def register_service(name, klass)
131
+ @services[name] = klass
133
132
  end
134
133
  end
135
134
  end
@@ -0,0 +1,13 @@
1
+ module Katello
2
+ class HostStatusManager
3
+ STATUSES = [
4
+ Katello::ErrataStatus,
5
+ Katello::SubscriptionStatus,
6
+ Katello::PurposeSlaStatus,
7
+ Katello::PurposeRoleStatus,
8
+ Katello::PurposeUsageStatus,
9
+ Katello::PurposeAddonsStatus,
10
+ Katello::PurposeStatus,
11
+ Katello::TraceStatus].freeze
12
+ end
13
+ end
@@ -117,7 +117,7 @@ module Katello
117
117
  relative_path = pulp3_api.distributions_api.read(href).base_path
118
118
 
119
119
  dist_ref = Katello::Pulp3::DistributionReference.find_or_initialize_by(:path => relative_path)
120
- if (distribution_repo = Katello::Repository.find_by(:relative_path => relative_path) || Katello::Repository.find_by(:container_repository_name => relative_path))
120
+ if (distribution_repo = Katello::Repository.find_by(:relative_path => relative_path))
121
121
  dist_ref.href = href
122
122
  dist_ref.repository_id = distribution_repo.id
123
123
  dist_ref.save!
@@ -3,13 +3,10 @@ require 'pulp_rpm_client'
3
3
  module Katello
4
4
  module Pulp3
5
5
  class Repository
6
- # rubocop:disable Metrics/ClassLength
7
6
  class Yum < ::Katello::Pulp3::Repository
8
7
  include Katello::Util::Errata
9
8
  include Katello::Util::PulpcoreContentFilters
10
9
 
11
- UNIT_LIMIT = 10_000
12
-
13
10
  def remote_options
14
11
  if root.url.blank?
15
12
  common_remote_options.merge(url: nil, policy: root.download_policy)
@@ -34,6 +31,10 @@ module Katello
34
31
  }
35
32
  end
36
33
 
34
+ def sync_params
35
+ {remote: repo.remote_href, mirror: repo.root.mirror_on_sync, optimize: false}
36
+ end
37
+
37
38
  def mirror_remote_options
38
39
  policy = smart_proxy.download_policy
39
40
 
@@ -62,12 +63,6 @@ module Katello
62
63
  end
63
64
  end
64
65
 
65
- def sync_url_params(sync_options)
66
- params = super
67
- params[:optimize] = sync_options[:optimize] if sync_options.key?(:optimize)
68
- params
69
- end
70
-
71
66
  def self.distribution_bootable?(distribution)
72
67
  file_paths = distribution.results.first.images.map(&:path)
73
68
  file_paths.any? do |path|
@@ -107,70 +102,14 @@ module Katello
107
102
  data.config << config
108
103
  end
109
104
  end
110
- tasks << copy_content_chunked(data)
105
+ # FIXME: data's content being [] causes all content to be copied back
106
+ tasks << api.copy_api.copy_content(data)
111
107
  else
112
108
  tasks << remove_all_content_from_mapping(repo_id_map)
113
109
  end
114
110
  tasks.flatten
115
111
  end
116
112
 
117
- def copy_api_data_dup(data)
118
- data_dup = PulpRpmClient::Copy.new
119
- data_dup.dependency_solving = data.dependency_solving
120
- data_dup.config = []
121
- data.config.each do |repo_config|
122
- config_hash = {
123
- source_repo_version: repo_config[:source_repo_version],
124
- dest_repo: repo_config[:dest_repo],
125
- content: []
126
- }
127
- config_hash[:dest_base_version] = repo_config[:dest_base_version] if repo_config[:dest_base_version]
128
- data_dup.config << config_hash
129
- end
130
- data_dup
131
- end
132
-
133
- def copy_content_chunked(data)
134
- tasks = []
135
- # Don't chunk if there aren't enough content units
136
- if data.config.sum { |repo_config| repo_config[:content].size } <= UNIT_LIMIT
137
- return api.copy_api.copy_content(data)
138
- end
139
-
140
- unit_copy_counter = 0
141
- i = 0
142
- leftover_units = data.config.first[:content].deep_dup
143
-
144
- # Copy data and clear its content fields
145
- data_dup = copy_api_data_dup(data)
146
-
147
- while i < data_dup.config.size
148
- # Copy all units within repo or only some?
149
- if leftover_units.length < UNIT_LIMIT - unit_copy_counter
150
- copy_amount = leftover_units.length
151
- else
152
- copy_amount = UNIT_LIMIT - unit_copy_counter
153
- end
154
-
155
- data_dup.config[i][:content] = leftover_units.pop(copy_amount)
156
- unit_copy_counter += copy_amount
157
- if unit_copy_counter != 0
158
- tasks << api.copy_api.copy_content(data_dup)
159
- unit_copy_counter = 0
160
- end
161
-
162
- if leftover_units.empty?
163
- # Nothing more to copy -- clear current config's content
164
- data_dup.config[i][:content] = []
165
- i += 1
166
- # Fetch unit list for next data config
167
- leftover_units = data.config[i][:content].deep_dup unless i == data_dup.config.size
168
- end
169
- end
170
-
171
- tasks
172
- end
173
-
174
113
  def remove_all_content_from_mapping(repo_id_map)
175
114
  tasks = []
176
115
  repo_id_map.each do |_source_repo_ids, dest_repo_id_map|
@@ -208,11 +147,6 @@ module Katello
208
147
  api.repositories_api.modify(repo_href, data)
209
148
  end
210
149
 
211
- def repair(repository_version_href)
212
- data = PulpRpmClient::RepositoryVersion.new
213
- api.repository_versions_api.repair(repository_version_href, data)
214
- end
215
-
216
150
  def remove_all_content
217
151
  data = PulpRpmClient::RepositoryAddRemoveContent.new(
218
152
  remove_content_units: ['*'])
@@ -1,4 +1,5 @@
1
1
  require "pulpcore_client"
2
+
2
3
  module Katello
3
4
  module Pulp3
4
5
  class Repository
@@ -187,21 +188,21 @@ module Katello
187
188
  api.repositories_api.read(repository_reference.try(:repository_href))
188
189
  end
189
190
 
190
- def delete_repository(repo_reference = repository_reference)
191
- href = repo_reference.try(:repository_href)
192
- repo_reference.try(:destroy)
191
+ def delete(href = repository_reference.try(:repository_href))
192
+ repository_reference.try(:destroy)
193
193
  ignore_404_exception { api.repositories_api.delete(href) } if href
194
194
  end
195
195
 
196
- def sync(options = {})
197
- repository_sync_url_data = api.class.repository_sync_url_class.new(sync_url_params(options))
198
- [api.repositories_api.sync(repository_reference.repository_href, repository_sync_url_data)]
196
+ def sync_params
197
+ {remote: repo.remote_href, mirror: repo.root.mirror_on_sync}
199
198
  end
200
199
 
201
- def sync_url_params(_sync_options)
202
- params = {remote: repo.remote_href, mirror: repo.root.mirror_on_sync}
203
- params[:skip_types] = skip_types if skip_types
204
- params
200
+ def sync
201
+ sync_url_params = sync_params
202
+ skip_type_param = skip_types
203
+ sync_url_params[:skip_types] = skip_type_param if skip_type_param
204
+ repository_sync_url_data = api.class.repository_sync_url_class.new(sync_url_params)
205
+ [api.repositories_api.sync(repository_reference.repository_href, repository_sync_url_data)]
205
206
  end
206
207
 
207
208
  def create_publication
@@ -10,7 +10,7 @@ module Katello
10
10
  repo_map = {}
11
11
 
12
12
  smart_proxy_helper = ::Katello::SmartProxyHelper.new(smart_proxy)
13
- katello_pulp_ids = smart_proxy_helper.combined_repos_available_to_capsule.map(&:pulp_id)
13
+ katello_pulp_ids = smart_proxy_helper.repos_available_to_capsule.map(&:pulp_id)
14
14
  pulp3_enabled_repo_types.each do |repo_type|
15
15
  api = repo_type.pulp3_service_class.api(smart_proxy)
16
16
  repo_map[api] = api.list_all.reject { |capsule_repo| katello_pulp_ids.include? capsule_repo.name }
@@ -79,7 +79,7 @@ module Katello
79
79
 
80
80
  def error
81
81
  if task_data[:state] == CANCELED
82
- _("Task canceled")
82
+ self.new(_("Task canceled"))
83
83
  elsif task_data[:state] == FAILED
84
84
  if task_data[:error][:description].blank?
85
85
  _("Pulp task error")
@@ -90,8 +90,8 @@ module Katello
90
90
  end
91
91
 
92
92
  def cancel
93
- data = PulpcoreClient::TaskResponse.new(state: 'canceled')
94
- tasks_api.tasks_cancel(task_data['pulp_href'], data)
93
+ data = PulpcoreClient::Task.new(state: 'canceled')
94
+ tasks_api.tasks_cancel(pulp_task['pulp_href'], data)
95
95
  #the main task may have completed, so cancel spawned tasks too
96
96
  task_data['spawned_tasks']&.each { |spawned| tasks_api.tasks_cancel(spawned['pulp_href'], data) }
97
97
  end
@@ -73,12 +73,6 @@ 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
82
76
  end
83
77
  end
84
78
  end
@@ -13,31 +13,34 @@ module Katello
13
13
  @smart_proxy.pulp_master?
14
14
  end
15
15
 
16
- def lifecycle_environment_check(environment = nil, repository = nil)
17
- environment = repository.environment if repository
16
+ def repos_available_to_capsule(environment = nil, content_view = nil, repository = nil)
17
+ ret = []
18
+ if repository
19
+ environment = repository.environment
20
+ ret = [repository]
21
+ else
22
+ yum_repos = fetch_repos_available_to_capsule(environment, content_view) || []
23
+ puppet_envs = fetch_puppet_environments_available_to_capsule(environment, content_view) || []
24
+ ret = yum_repos + puppet_envs
25
+ end
18
26
 
19
27
  if environment && !self.smart_proxy.lifecycle_environments.include?(environment)
20
28
  fail _("Lifecycle environment '%{environment}' is not attached to this capsule.") % { :environment => environment.name }
21
29
  end
22
- end
23
30
 
24
- def combined_repos_available_to_capsule(environment = nil, content_view = nil, repository = nil)
25
- lifecycle_environment_check(environment, repository)
26
- if repository
27
- [repository]
28
- else
29
- repositories_available_to_capsule(environment, content_view) + puppet_environments_available_to_capsule(environment, content_view)
30
- end
31
+ ret
31
32
  end
32
33
 
33
- def repositories_available_to_capsule(environments, content_view)
34
+ private
35
+
36
+ def fetch_repos_available_to_capsule(environments = nil, content_view = nil)
34
37
  environments = @smart_proxy.lifecycle_environments if environments.nil?
35
38
  yum_repos = Katello::Repository.in_environment(environments)
36
39
  yum_repos = yum_repos.in_content_views([content_view]) if content_view
37
- yum_repos.smart_proxy_syncable
40
+ yum_repos.select(&:node_syncable?)
38
41
  end
39
42
 
40
- def puppet_environments_available_to_capsule(environments, content_view)
43
+ def fetch_puppet_environments_available_to_capsule(environments = nil, content_view = nil)
41
44
  environments = @smart_proxy.lifecycle_environments if environments.nil?
42
45
  puppet_environments = Katello::ContentViewPuppetEnvironment.in_environment(environments)
43
46
  puppet_environments = puppet_environments.in_content_view(content_view) if content_view
@@ -42,7 +42,7 @@
42
42
  <a ng-click="syncCapsule(true)">
43
43
  <span translate><strong>Complete Sync</strong></span>
44
44
  <p> A Complete Sync will sync repositories even if the upstream metadata appears to have no change.<br>
45
- Complete Sync is only relevant for yum repositories and will take longer than an optimized sync.</p>
45
+ Complete Sync is only relevant for yum/deb repositories and will take longer than an optimized sync.</p>
46
46
  </a>
47
47
  </li>
48
48
  </ul>
@@ -6,7 +6,7 @@ attributes :pulp_id => :backend_identifier
6
6
  attributes :relative_path, :container_repository_name, :full_path, :library_instance_id
7
7
 
8
8
  glue(@object.root) do
9
- attributes :content_type, :url, :arch, :content_id
9
+ attributes :content_type, :url, :arch, :content_id, :auto_enabled
10
10
  attributes :major, :minor
11
11
 
12
12
  child :product do |_product|
@@ -21,7 +21,6 @@ Katello::Engine.routes.draw do
21
21
  match '/owners/:organization_id/environments' => 'candlepin_proxies#rhsm_index', :via => :get
22
22
  match '/owners/:organization_id/pools' => 'candlepin_proxies#get', :via => :get, :as => :proxy_owner_pools_path
23
23
  match '/owners/:organization_id/servicelevels' => 'candlepin_proxies#get', :via => :get, :as => :proxy_owner_servicelevels_path
24
- match '/owners/:organization_id/system_purpose' => 'candlepin_proxies#get', :via => :get, :as => :proxy_owner_system_purpose_path
25
24
  match '/environments/:environment_id/consumers' => 'candlepin_proxies#consumer_create', :via => :post
26
25
  match '/consumers/:id' => 'candlepin_proxies#consumer_show', :via => :get
27
26
  match '/consumers/:id' => 'candlepin_proxies#regenerate_identity_certificates', :via => :post
@@ -304,6 +304,12 @@ Katello::Engine.routes.draw do
304
304
  end
305
305
  end
306
306
 
307
+ api_resources :traces, :only => [], :controller => 'host_tracer' do
308
+ collection do
309
+ put :resolve
310
+ end
311
+ end
312
+
307
313
  api_resources :srpms, :only => [:index, :show], :controller => 'srpms' do
308
314
  collection do
309
315
  get :auto_complete_search
@@ -349,6 +355,8 @@ Katello::Engine.routes.draw do
349
355
  delete :destroy
350
356
  put :update
351
357
  get :ping
358
+ match '/simple_content_access/enable', :to => 'upstream_subscriptions#enable_simple_content_access', :via => :put
359
+ match '/simple_content_access/disable', :to => 'upstream_subscriptions#disable_simple_content_access', :via => :put
352
360
  end
353
361
  end
354
362
  end
@@ -386,7 +394,6 @@ Katello::Engine.routes.draw do
386
394
  put :remove_docker_manifests, :action => :remove_content
387
395
  put :remove_content
388
396
  post :sync
389
- post :verify_checksum
390
397
  post :export
391
398
  post :upload_content
392
399
  put :import_uploads
@@ -416,7 +423,6 @@ Katello::Engine.routes.draw do
416
423
  collection do
417
424
  match '/bulk/destroy' => 'products_bulk_actions#destroy_products', :via => :put
418
425
  match '/bulk/sync' => 'products_bulk_actions#sync_products', :via => :put
419
- match '/bulk/verify_checksum' => 'products_bulk_actions#verify_checksum_products', :via => :put
420
426
  match '/bulk/sync_plan' => 'products_bulk_actions#update_sync_plans', :via => :put
421
427
  match '/bulk/http_proxy' => 'products_bulk_actions#update_http_proxy', :via => :put
422
428
  end
@@ -77,7 +77,6 @@ Foreman::Application.routes.draw do
77
77
  match '/bulk/environment_content_view' => 'hosts_bulk_actions#environment_content_view', :via => :put
78
78
  match '/bulk/release_version' => 'hosts_bulk_actions#release_version', :via => :put
79
79
  match '/bulk/traces' => 'hosts_bulk_actions#traces', :via => :post
80
- match '/bulk/resolve_traces' => 'hosts_bulk_actions#resolve_traces', :via => :put
81
80
  match '/bulk/available_incremental_updates' => 'hosts_bulk_actions#available_incremental_updates', :via => :post
82
81
  match '/bulk/module_streams' => 'hosts_bulk_actions#module_streams', :via => :post
83
82
  match '/subscriptions/' => 'host_subscriptions#create', :via => :post
@@ -115,9 +114,6 @@ Foreman::Application.routes.draw do
115
114
  end
116
115
 
117
116
  resources :traces, :only => [:index], :controller => :host_tracer do
118
- collection do
119
- put :resolve
120
- end
121
117
  end
122
118
  end
123
119
  end