katello 3.5.2 → 3.6.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 (490) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/katello/sync_management/sync_management.js +5 -2
  3. data/app/controllers/katello/api/rhsm/candlepin_dynflow_proxy_controller.rb +2 -0
  4. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +35 -16
  5. data/app/controllers/katello/api/v2/activation_keys_controller.rb +2 -2
  6. data/app/controllers/katello/api/v2/content_uploads_controller.rb +2 -2
  7. data/app/controllers/katello/api/v2/content_view_components_controller.rb +1 -0
  8. data/app/controllers/katello/api/v2/content_view_filters_controller.rb +1 -1
  9. data/app/controllers/katello/api/v2/content_view_histories_controller.rb +1 -1
  10. data/app/controllers/katello/api/v2/content_view_puppet_modules_controller.rb +1 -1
  11. data/app/controllers/katello/api/v2/content_view_versions_controller.rb +1 -1
  12. data/app/controllers/katello/api/v2/content_views_controller.rb +3 -3
  13. data/app/controllers/katello/api/v2/debs_controller.rb +19 -0
  14. data/app/controllers/katello/api/v2/docker_manifest_lists_controller.rb +20 -0
  15. data/app/controllers/katello/api/v2/environments_controller.rb +1 -1
  16. data/app/controllers/katello/api/v2/errata_controller.rb +24 -0
  17. data/app/controllers/katello/api/v2/file_units_controller.rb +4 -1
  18. data/app/controllers/katello/api/v2/gpg_keys_controller.rb +10 -4
  19. data/app/controllers/katello/api/v2/host_autocomplete_controller.rb +0 -1
  20. data/app/controllers/katello/api/v2/host_collections_controller.rb +1 -1
  21. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +1 -1
  22. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +13 -5
  23. data/app/controllers/katello/api/v2/organizations_controller.rb +2 -1
  24. data/app/controllers/katello/api/v2/package_groups_controller.rb +3 -2
  25. data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +1 -1
  26. data/app/controllers/katello/api/v2/products_controller.rb +3 -3
  27. data/app/controllers/katello/api/v2/repositories_controller.rb +28 -12
  28. data/app/controllers/katello/api/v2/repository_sets_controller.rb +21 -13
  29. data/app/controllers/katello/api/v2/root_controller.rb +0 -1
  30. data/app/controllers/katello/api/v2/subscriptions_controller.rb +1 -19
  31. data/app/controllers/katello/api/v2/sync_plans_controller.rb +1 -1
  32. data/app/controllers/katello/application_controller.rb +0 -18
  33. data/app/controllers/katello/concerns/api/v2/hosts_controller_extensions.rb +12 -13
  34. data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +17 -13
  35. data/app/controllers/katello/concerns/containers/steps_controller_extensions.rb +39 -37
  36. data/app/controllers/katello/concerns/hosts_controller_extensions.rb +14 -14
  37. data/app/controllers/katello/concerns/organizations_controller_extensions.rb +34 -33
  38. data/app/controllers/katello/concerns/smart_proxies_controller_extensions.rb +18 -17
  39. data/app/controllers/katello/products_controller.rb +1 -1
  40. data/app/controllers/katello/providers_controller.rb +11 -0
  41. data/app/controllers/katello/react_controller.rb +9 -0
  42. data/app/controllers/katello/sync_management_controller.rb +1 -1
  43. data/app/helpers/katello/concerns/hosts_and_hostgroups_helper_extensions.rb +10 -9
  44. data/app/helpers/katello/concerns/settings_helper_extensions.rb +42 -33
  45. data/app/helpers/katello/concerns/smart_proxy_helper_extensions.rb +1 -1
  46. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +1 -3
  47. data/app/helpers/katello/providers_helper.rb +2 -5
  48. data/app/lib/actions/candlepin/listen_on_candlepin_events.rb +5 -15
  49. data/app/lib/actions/katello/capsule_content/sync.rb +8 -0
  50. data/app/lib/actions/katello/content_view/incremental_updates.rb +1 -1
  51. data/app/lib/actions/katello/content_view_puppet_environment/clone.rb +2 -2
  52. data/app/lib/actions/katello/content_view_version/republish_repositories.rb +2 -5
  53. data/app/lib/actions/katello/event_queue/monitor.rb +10 -11
  54. data/app/lib/actions/katello/event_queue/suspended_action.rb +1 -1
  55. data/app/lib/actions/katello/host/register.rb +1 -1
  56. data/app/lib/actions/katello/host/update.rb +1 -3
  57. data/app/lib/actions/katello/organization/manifest_refresh.rb +1 -5
  58. data/app/lib/actions/katello/product/content_create.rb +11 -1
  59. data/app/lib/actions/katello/product/content_destroy.rb +8 -0
  60. data/app/lib/actions/katello/product/destroy.rb +2 -2
  61. data/app/lib/actions/katello/product/update.rb +0 -3
  62. data/app/lib/actions/katello/repository/bulk_metadata_generate.rb +15 -0
  63. data/app/lib/actions/katello/repository/check_matching_content.rb +10 -3
  64. data/app/lib/actions/katello/repository/clear.rb +4 -1
  65. data/app/lib/actions/katello/repository/clone_deb_content.rb +70 -0
  66. data/app/lib/actions/katello/repository/clone_to_environment.rb +4 -1
  67. data/app/lib/actions/katello/repository/clone_to_version.rb +19 -10
  68. data/app/lib/actions/katello/repository/clone_yum_content.rb +2 -0
  69. data/app/lib/actions/katello/repository/clone_yum_metadata.rb +1 -2
  70. data/app/lib/actions/katello/repository/create.rb +6 -2
  71. data/app/lib/actions/katello/repository/destroy.rb +1 -1
  72. data/app/lib/actions/katello/repository/export.rb +15 -0
  73. data/app/lib/actions/katello/repository/fetch_pxe_files.rb +49 -0
  74. data/app/lib/actions/katello/repository/filtered_index_content.rb +2 -0
  75. data/app/lib/actions/katello/repository/metadata_generate.rb +5 -1
  76. data/app/lib/actions/katello/repository/remove_content.rb +2 -0
  77. data/app/lib/actions/katello/repository/sync.rb +5 -6
  78. data/app/lib/actions/katello/repository/update.rb +14 -4
  79. data/app/lib/actions/katello/repository/upload_package_group.rb +0 -1
  80. data/app/lib/actions/katello/repository_set/disable_repository.rb +7 -7
  81. data/app/lib/actions/katello/repository_set/enable_repository.rb +17 -7
  82. data/app/lib/actions/katello/repository_set/scan_cdn.rb +8 -10
  83. data/app/lib/actions/pulp/consumer/abstract_content_action.rb +1 -1
  84. data/app/lib/actions/pulp/repository/copy_deb.rb +15 -0
  85. data/app/lib/actions/pulp/repository/copy_deb_component.rb +11 -0
  86. data/app/lib/actions/pulp/repository/copy_deb_release.rb +11 -0
  87. data/app/lib/actions/pulp/repository/copy_srpm.rb +16 -0
  88. data/app/lib/actions/pulp/repository/create.rb +38 -3
  89. data/app/lib/actions/pulp/repository/presenters/deb_presenter.rb +101 -0
  90. data/app/lib/actions/pulp/repository/remove_deb.rb +15 -0
  91. data/app/lib/actions/pulp/repository/remove_docker_blob.rb +11 -0
  92. data/app/lib/actions/pulp/repository/remove_docker_manifest_list.rb +11 -0
  93. data/app/lib/actions/pulp/repository/remove_docker_tag.rb +11 -0
  94. data/app/lib/actions/pulp/repository/sync.rb +2 -0
  95. data/app/lib/katello/api/v2/error_handling.rb +1 -1
  96. data/app/lib/katello/capsule_content.rb +1 -1
  97. data/app/lib/katello/concerns/renderer_extensions.rb +12 -10
  98. data/app/lib/katello/errors.rb +0 -4
  99. data/app/lib/katello/resources/candlepin.rb +2 -3
  100. data/app/lib/katello/util/cdn_var_substitutor.rb +2 -2
  101. data/app/lib/katello/util/docker_manifest_clause_generator.rb +1 -1
  102. data/app/lib/katello/util/package_clause_generator.rb +1 -1
  103. data/app/lib/katello/util/support.rb +1 -1
  104. data/app/models/katello/activation_key.rb +1 -1
  105. data/app/models/katello/authorization/content_view_history.rb +1 -0
  106. data/app/models/katello/authorization/content_view_version.rb +1 -1
  107. data/app/models/katello/authorization/pool.rb +2 -0
  108. data/app/models/katello/authorization/repository.rb +2 -0
  109. data/app/models/katello/candlepin/docker_repository_mapper.rb +77 -0
  110. data/app/models/katello/candlepin/repository_mapper.rb +143 -0
  111. data/app/models/katello/concerns/container_extensions.rb +14 -12
  112. data/app/models/katello/concerns/content_facet_host_extensions.rb +2 -2
  113. data/app/models/katello/concerns/docker_container_wizard_state_extensions.rb +6 -4
  114. data/app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb +8 -6
  115. data/app/models/katello/concerns/host_managed_extensions.rb +2 -13
  116. data/app/models/katello/concerns/location_extensions.rb +5 -1
  117. data/app/models/katello/concerns/organization_extensions.rb +22 -1
  118. data/app/models/katello/concerns/pulp_database_unit.rb +26 -5
  119. data/app/models/katello/concerns/redhat_extensions.rb +22 -21
  120. data/app/models/katello/concerns/smart_proxy_extensions.rb +11 -9
  121. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +8 -7
  122. data/app/models/katello/content.rb +26 -0
  123. data/app/models/katello/content_view.rb +18 -5
  124. data/app/models/katello/content_view_component.rb +1 -1
  125. data/app/models/katello/content_view_docker_filter.rb +15 -6
  126. data/app/models/katello/content_view_filter.rb +8 -2
  127. data/app/models/katello/content_view_puppet_environment.rb +12 -0
  128. data/app/models/katello/content_view_repository.rb +2 -1
  129. data/app/models/katello/content_view_version.rb +57 -15
  130. data/app/models/katello/deb.rb +50 -0
  131. data/app/models/katello/docker_manifest.rb +14 -8
  132. data/app/models/katello/docker_manifest_list.rb +39 -0
  133. data/app/models/katello/docker_manifest_list_manifest.rb +6 -0
  134. data/app/models/katello/docker_meta_tag.rb +3 -3
  135. data/app/models/katello/docker_tag.rb +30 -10
  136. data/app/models/katello/errata_status.rb +1 -1
  137. data/app/models/katello/erratum.rb +3 -4
  138. data/app/models/katello/file_unit.rb +2 -2
  139. data/app/models/katello/glue/candlepin/activation_key.rb +1 -1
  140. data/app/models/katello/glue/candlepin/content.rb +9 -34
  141. data/app/models/katello/glue/candlepin/owner.rb +0 -32
  142. data/app/models/katello/glue/candlepin/pool.rb +2 -3
  143. data/app/models/katello/glue/candlepin/product.rb +34 -52
  144. data/app/models/katello/glue/candlepin/repository.rb +31 -0
  145. data/app/models/katello/glue/provider.rb +16 -19
  146. data/app/models/katello/glue/pulp/repo.rb +89 -16
  147. data/app/models/katello/host/content_facet.rb +6 -6
  148. data/app/models/katello/host/info_provider.rb +2 -2
  149. data/app/models/katello/host/subscription_facet.rb +4 -4
  150. data/app/models/katello/kt_environment.rb +6 -2
  151. data/app/models/katello/package_group.rb +1 -1
  152. data/app/models/katello/pool.rb +13 -12
  153. data/app/models/katello/product.rb +12 -6
  154. data/app/models/katello/product_content.rb +36 -0
  155. data/app/models/katello/provider.rb +1 -1
  156. data/app/models/katello/puppet_module.rb +5 -5
  157. data/app/models/katello/repository.rb +103 -11
  158. data/app/models/katello/repository_deb.rb +7 -0
  159. data/app/models/katello/repository_docker_manifest_list.rb +7 -0
  160. data/app/models/katello/repository_srpm.rb +7 -0
  161. data/app/models/katello/rhsm_fact_importer.rb +2 -2
  162. data/app/models/katello/rhsm_fact_parser.rb +1 -1
  163. data/app/models/katello/rpm.rb +5 -5
  164. data/app/models/katello/srpm.rb +40 -0
  165. data/app/models/katello/subscription.rb +3 -2
  166. data/app/models/katello/sync_plan.rb +8 -5
  167. data/app/models/setting/content.rb +5 -3
  168. data/app/services/katello/product_content_finder.rb +1 -1
  169. data/app/services/katello/pulp/deb.rb +46 -0
  170. data/app/services/katello/pulp/docker_manifest_list.rb +7 -0
  171. data/app/services/katello/pulp/server.rb +4 -12
  172. data/app/services/katello/pulp/srpm.rb +17 -0
  173. data/app/views/foreman/unattended/finish-katello.erb +4 -4
  174. data/app/views/foreman/unattended/kickstart-katello-atomic.erb +3 -3
  175. data/app/views/foreman/unattended/kickstart-katello.erb +5 -9
  176. data/app/views/foreman/unattended/snippets/_subscription_manager_registration.erb +3 -3
  177. data/app/views/foreman/unattended/userdata-katello.erb +8 -8
  178. data/app/views/katello/api/v2/activation_keys/product_content.json.rabl +1 -2
  179. data/app/views/katello/api/v2/content_facet/base.json.rabl +6 -1
  180. data/app/views/katello/api/v2/content_view_versions/base.json.rabl +3 -0
  181. data/app/views/katello/api/v2/content_views/show.json.rabl +12 -0
  182. data/app/views/katello/api/v2/debs/base.json.rabl +10 -0
  183. data/app/views/katello/api/v2/debs/index.json.rabl +7 -0
  184. data/app/views/katello/api/v2/debs/show.json.rabl +3 -0
  185. data/app/views/katello/api/v2/docker_manifest_lists/index.json.rabl +7 -0
  186. data/app/views/katello/api/v2/docker_manifest_lists/show.json.rabl +12 -0
  187. data/app/views/katello/api/v2/docker_manifests/compare.json.rabl +10 -0
  188. data/app/views/katello/api/v2/docker_manifests/show.json.rabl +5 -1
  189. data/app/views/katello/api/v2/docker_tags/_base.json.rabl +4 -4
  190. data/app/views/katello/api/v2/docker_tags/compare.json.rabl +10 -0
  191. data/app/views/katello/api/v2/docker_tags/show.json.rabl +1 -1
  192. data/app/views/katello/api/v2/errata/_counts.json.rabl +1 -0
  193. data/app/views/katello/api/v2/errata/available_errata.rabl +7 -0
  194. data/app/views/katello/api/v2/file_units/compare.json.rabl +10 -0
  195. data/app/views/katello/api/v2/host_subscriptions/product_content.json.rabl +1 -2
  196. data/app/views/katello/api/v2/hostgroups_extensions/show.json.rabl +2 -1
  197. data/app/views/katello/api/v2/hosts_bulk_actions/applicable_errata.json.rabl +7 -0
  198. data/app/views/katello/api/v2/layouts/resource.json.erb +1 -1
  199. data/app/views/katello/api/v2/ostree_branches/compare.json.rabl +10 -0
  200. data/app/views/katello/api/v2/package_groups/compare.json.rabl +10 -0
  201. data/app/views/katello/api/v2/packages/compare.json.rabl +10 -0
  202. data/app/views/katello/api/v2/products/_product_content.json.rabl +9 -0
  203. data/app/views/katello/api/v2/products/base.json.rabl +3 -1
  204. data/app/views/katello/api/v2/products/show.json.rabl +6 -2
  205. data/app/views/katello/api/v2/puppet_modules/compare.json.rabl +10 -0
  206. data/app/views/katello/api/v2/repositories/base.json.rabl +5 -1
  207. data/app/views/katello/api/v2/repositories/show.json.rabl +2 -0
  208. data/app/views/katello/api/v2/repository_sets/show.json.rabl +15 -3
  209. data/app/views/katello/layouts/react.html.erb +15 -0
  210. data/app/views/katello/providers/redhat/_repo_sets.html.erb +5 -5
  211. data/app/views/katello/sync_management/index.html.erb +4 -0
  212. data/app/views/smart_proxies/pulp_status.html.erb +6 -6
  213. data/config/katello.yaml.example +0 -4
  214. data/config/routes.rb +3 -0
  215. data/config/routes/api/v2.rb +30 -3
  216. data/config/routes/overrides.rb +1 -0
  217. data/db/migrate/20131014135042_katello_tables.rb +1 -1
  218. data/db/migrate/20131014225132_add_users_fields.rb +1 -1
  219. data/db/migrate/20131016124255_add_foreign_keys_engine.rb +1 -1
  220. data/db/migrate/20131120225132_add_organization_fields.rb +1 -1
  221. data/db/migrate/20131216212502_add_quantity_to_katello_key_pools.rb +1 -1
  222. data/db/migrate/20131216212621_add_cp_id_to_katello_activation_keys.rb +1 -1
  223. data/db/migrate/20131218174203_drop_katello_key_pools_table.rb +1 -1
  224. data/db/migrate/20140110000001_update_environments_add_katello_id.rb +1 -1
  225. data/db/migrate/20140117160939_refactor_content_views.rb +1 -1
  226. data/db/migrate/20140206200439_create_content_view_puppet_modules.rb +1 -1
  227. data/db/migrate/20140212131812_create_content_view_package_filter_rules.rb +1 -1
  228. data/db/migrate/20140212143454_create_content_view_package_group_filter_rules.rb +1 -1
  229. data/db/migrate/20140212143642_create_content_view_erratum_filter_rules.rb +1 -1
  230. data/db/migrate/20140217145303_remove_changeset.rb +1 -1
  231. data/db/migrate/20140217160132_create_content_view_history.rb +1 -1
  232. data/db/migrate/20140222022712_remove_provider_discovery.rb +1 -1
  233. data/db/migrate/20140305101813_allow_null_for_repository_content_id.rb +1 -1
  234. data/db/migrate/20140306132108_create_content_view_puppet_environments.rb +1 -1
  235. data/db/migrate/20140310102051_repository_add_checksum_type.rb +1 -1
  236. data/db/migrate/20140318174203_drop_cdn_import_success_column.rb +1 -1
  237. data/db/migrate/20140325185413_create_content_view_foreign_keys.rb +1 -1
  238. data/db/migrate/20140404122011_drop_repositories_enabled_column.rb +1 -1
  239. data/db/migrate/20140411134235_update_content_view_description_type.rb +1 -1
  240. data/db/migrate/20140414214152_allow_null_content_view_to_activation_key.rb +1 -1
  241. data/db/migrate/20140418124032_add_next_version_to_katello_content_views.rb +1 -1
  242. data/db/migrate/20140422000001_update_products_add_organization.rb +1 -1
  243. data/db/migrate/20140423191446_add_anonymous_providers_to_orgs.rb +1 -1
  244. data/db/migrate/20140425155126_add_host_id_to_system.rb +1 -1
  245. data/db/migrate/20140429193743_add_release_version_to_activation_keys.rb +1 -1
  246. data/db/migrate/20140502164009_rename_system_groups_to_host_collections.rb +1 -1
  247. data/db/migrate/20140502174412_update_host_collections_foreign_keys.rb +1 -1
  248. data/db/migrate/20140514165842_create_capsule_lifecycle_environments.rb +1 -1
  249. data/db/migrate/20140531160506_package_filter_add_original_packages.rb +1 -1
  250. data/db/migrate/20140610083129_add_pulp_proxy_to_host.rb +1 -1
  251. data/db/migrate/20140610154745_content_view_puppet_environment_id.rb +1 -1
  252. data/db/migrate/20140610170142_add_uuid_to_content_view_package_group_filter_rule.rb +1 -1
  253. data/db/migrate/20140617100300_add_description_to_content_view_filter_rules.rb +1 -1
  254. data/db/migrate/20140623103442_drop_taxonomies_owner_auto_attach_all_systems_task_id_column.rb +1 -1
  255. data/db/migrate/20140624183938_add_foreign_keys_for_organizations.rb +1 -1
  256. data/db/migrate/20140624184401_remove_label_from_activation_key.rb +1 -1
  257. data/db/migrate/20140626055258_add_missing_foreign_keys.rb +1 -1
  258. data/db/migrate/20140626204657_add_unlimited_to_activation_keys.rb +1 -1
  259. data/db/migrate/20140626204902_add_unlimited_to_host_collection.rb +1 -1
  260. data/db/migrate/20140707203534_location_add_katello_default.rb +1 -1
  261. data/db/migrate/20140709150428_remove_deletion_task_id_from_taxonomies.rb +1 -1
  262. data/db/migrate/20140716211853_repo_rename_feed_to_url.rb +1 -1
  263. data/db/migrate/20140807175457_remove_hidden_column_from_user.rb +1 -1
  264. data/db/migrate/20140811141742_remove_delayed_jobs.rb +1 -1
  265. data/db/migrate/20140821084214_add_sync_plan_enabled_to_sync_plan.rb +1 -1
  266. data/db/migrate/20140928210618_add_description_to_content_view_versions.rb +1 -1
  267. data/db/migrate/20140930170628_add_errata.rb +1 -1
  268. data/db/migrate/20141001170628_add_system_repository.rb +1 -1
  269. data/db/migrate/20141003210742_add_docker_container_registry_url_to_providers.rb +1 -1
  270. data/db/migrate/20141015173220_add_docker_image_fields.rb +1 -1
  271. data/db/migrate/20141031150814_add_tag_repository_id_index.rb +1 -1
  272. data/db/migrate/20141112180709_add_auto_attach_to_activation_keys.rb +1 -1
  273. data/db/migrate/20141124182205_content_view_version_add_minor.rb +1 -1
  274. data/db/migrate/20141203123206_add_timestamps_to_repository_join_tables.rb +1 -1
  275. data/db/migrate/20141204203609_add_default_value_to_auto_attach.rb +1 -1
  276. data/db/migrate/20141209103005_disown_foreman_templates.rb +1 -1
  277. data/db/migrate/20141210173220_create_docker_tables.rb +1 -1
  278. data/db/migrate/20141215213720_track_version_components.rb +1 -1
  279. data/db/migrate/20141222151001_add_host_content_view_environment.rb +1 -1
  280. data/db/migrate/20150109012657_add_capsule_id_to_container.rb +1 -1
  281. data/db/migrate/20150114225023_add_upstream_name_to_repository.rb +1 -1
  282. data/db/migrate/20150119153452_update_promote_errata_email_description.rb +1 -1
  283. data/db/migrate/20150224083608_remove_docker_registry_url.rb +1 -1
  284. data/db/migrate/20150227213850_change_descriptions_to_text_fields.rb +1 -1
  285. data/db/migrate/20150423134004_add_content_host_id_to_smart_proxy.rb +1 -1
  286. data/db/migrate/20150505180030_change_errata_timestamps_to_dates.rb +1 -1
  287. data/db/migrate/20150507131145_update_composite_default_for_content_view.rb +1 -1
  288. data/db/migrate/20150513034751_add_ostree_branches.rb +1 -1
  289. data/db/migrate/20150602153753_remove_help_tips.rb +1 -1
  290. data/db/migrate/20150602153754_remove_search_histories.rb +1 -1
  291. data/db/migrate/20150602153755_remove_search_favorites.rb +1 -1
  292. data/db/migrate/20150602153756_remove_user_notices.rb +1 -1
  293. data/db/migrate/20150602153757_remove_notices.rb +1 -1
  294. data/db/migrate/20150603045418_remove_user_fields.rb +1 -1
  295. data/db/migrate/20150606021722_create_puppet_modules.rb +1 -1
  296. data/db/migrate/20150611140455_remove_default_and_custom_info.rb +1 -1
  297. data/db/migrate/20150613134559_add_rpm.rb +1 -1
  298. data/db/migrate/20150623135424_create_package_groups.rb +1 -1
  299. data/db/migrate/20150715142649_assign_content_host_to_smart_proxies.rb +1 -1
  300. data/db/migrate/20150717142559_add_distributions_to_repository.rb +1 -1
  301. data/db/migrate/20150813185339_create_subscriptions.rb +1 -1
  302. data/db/migrate/20150826165942_add_subscription_facet.rb +1 -1
  303. data/db/migrate/20150826170004_add_content_facet.rb +1 -1
  304. data/db/migrate/20150901213759_remove_distributors.rb +1 -1
  305. data/db/migrate/20150902164543_remove_apply_info_task_id_from_taxonomies.rb +1 -1
  306. data/db/migrate/20150908222711_drop_marketing_engineering_products.rb +1 -1
  307. data/db/migrate/20150928221648_update_location_katello_default.rb +1 -1
  308. data/db/migrate/20150930183738_migrate_content_hosts.rb +1 -1
  309. data/db/migrate/20151014144004_host_collection_to_hosts.rb +1 -1
  310. data/db/migrate/20151015152947_add_virt_only_to_katello_pools.rb +1 -1
  311. data/db/migrate/20151203230940_add_date_type_to_content_view_erratum_filter_rules.rb +1 -1
  312. data/db/migrate/20151219152536_rename_index_repository_errata.rb +1 -1
  313. data/db/migrate/20151219203225_rename_index_repository_puppet_module.rb +1 -1
  314. data/db/migrate/20160114200145_add_mirror_on_sync_to_repositories.rb +1 -1
  315. data/db/migrate/20160129192548_add_docker_v2_schema.rb +1 -1
  316. data/db/migrate/20160131182301_add_download_policy_to_katello_repositories.rb +1 -1
  317. data/db/migrate/20160203195736_remove_docker_image_schema.rb +1 -1
  318. data/db/migrate/20160211134035_remove_system_errata.rb +1 -1
  319. data/db/migrate/20160222143432_move_system_description_to_host.rb +1 -1
  320. data/db/migrate/20160224155909_add_registered_at_to_subscription_facet.rb +1 -1
  321. data/db/migrate/20160301070319_add_version_ostree_branches.rb +1 -1
  322. data/db/migrate/20160317171813_change_activation_key_column_names.rb +1 -1
  323. data/db/migrate/20160323065901_increase_cdn_length.rb +1 -1
  324. data/db/migrate/20160404132250_remove_katello_from_notification_name.rb +1 -1
  325. data/db/migrate/20160413230128_add_kickstart_repository_to_hosts_and_hostgroups.rb +1 -1
  326. data/db/migrate/20160426145517_move_host_description_to_host_comment.rb +1 -1
  327. data/db/migrate/20160505181337_rename_katello_settings.rb +1 -1
  328. data/db/migrate/20160520175340_add_host_applicable_package.rb +1 -1
  329. data/db/migrate/20160530184400_add_repo_id_indexes.rb +1 -1
  330. data/db/migrate/20160605160933_remove_jobs.rb +1 -1
  331. data/db/migrate/20160605162929_remove_system_smart_proxy.rb +1 -1
  332. data/db/migrate/20160613150922_add_event_queue.rb +1 -1
  333. data/db/migrate/20160617124149_remove_duplicate_view_filters.rb +1 -1
  334. data/db/migrate/20160619223332_fix_viewer_role.rb +1 -1
  335. data/db/migrate/20160627125310_delete_system.rb +1 -1
  336. data/db/migrate/20160701180402_add_sortable_version_to_puppet_modules.rb +1 -1
  337. data/db/migrate/20160722193256_add_verify_ssl_on_sync_to_repository.rb +1 -1
  338. data/db/migrate/20160727144242_add_registered_through_to_katello_subscription_facets.rb +1 -1
  339. data/db/migrate/20160728005028_add_latest_version_to_content_view_component.rb +1 -1
  340. data/db/migrate/20160808002834_add_files.rb +1 -1
  341. data/db/migrate/20160906181923_add_puppet_path_to_smart_proxy.rb +1 -1
  342. data/db/migrate/20160907231049_add_username_password_to_repository.rb +1 -1
  343. data/db/migrate/20160908234510_add_rpm_nvra.rb +1 -1
  344. data/db/migrate/20160923143611_add_action_to_content_view_histories.rb +1 -1
  345. data/db/migrate/20160924213020_change_katello_widget_names.rb +1 -1
  346. data/db/migrate/20160930121245_content_view_force_puppet_env.rb +1 -1
  347. data/db/migrate/20160930150810_add_smart_proxy_download_policy.rb +1 -1
  348. data/db/migrate/20161003130853_add_architecture_to_katello_content_view_package_filter_rule.rb +1 -1
  349. data/db/migrate/20161003204325_add_user_to_katello_subscription_facets.rb +1 -1
  350. data/db/migrate/20161014133811_move_content_view_version_description_to_histories.rb +2 -4
  351. data/db/migrate/20161021072346_fix_subscription_permissions.rb +1 -1
  352. data/db/migrate/20161026191118_fix_invalid_interfaces.rb +1 -1
  353. data/db/migrate/20161028153131_sub_facet_user_index_not_uniq.rb +1 -1
  354. data/db/migrate/20161031204903_add_tracer_support.rb +1 -1
  355. data/db/migrate/20161102194100_create_content_view_docker_filter_rules.rb +1 -1
  356. data/db/migrate/20161209162947_add_virt_who_to_katello_pools.rb +1 -1
  357. data/db/migrate/20161214151548_move_content_source_id_to_content_facets.rb +1 -1
  358. data/db/migrate/20170114051758_add_depth_to_repositories.rb +1 -1
  359. data/db/migrate/20170122204325_add_hypervisor_to_subscription_facets.rb +1 -1
  360. data/db/migrate/20170125152421_move_default_location_to_settings.rb +1 -1
  361. data/db/migrate/20170208215148_add_docker_repo_name.rb +1 -1
  362. data/db/migrate/20170220679403_remove_system_permissions.rb +1 -1
  363. data/db/migrate/20170222131211_change_pool_columns_to_dates.rb +1 -1
  364. data/db/migrate/20170321012632_fill_in_content_view_components.rb +1 -1
  365. data/db/migrate/20170523182831_create_docker_meta_tag.rb +1 -1
  366. data/db/migrate/20170714144125_add_deb.rb +34 -0
  367. data/db/migrate/20170718142148_create_katello_subscription_facet_pools.rb +1 -1
  368. data/db/migrate/20170720142145_add_deb_release_parameters_to_repositories.rb +7 -0
  369. data/db/migrate/20170821170915_add_index_to_installed_packages.rb +1 -1
  370. data/db/migrate/20170821170916_add_nvra_index_to_installed_packages.rb +1 -1
  371. data/db/migrate/20170822104447_add_katello_content_to_image.rb +1 -1
  372. data/db/migrate/20170913183848_add_errata_counts.rb +1 -1
  373. data/db/migrate/20171010170443_add_index_to_katello_content_facet_errata.rb +1 -1
  374. data/db/migrate/20171010172724_add_docker_manifest_list.rb +67 -0
  375. data/db/migrate/20171011175510_add_srpm.rb +38 -0
  376. data/db/migrate/20171014051810_remove_docker_manifest_name.rb +9 -0
  377. data/db/migrate/20171025163149_remove_use_pulp_oauth_setting.rb +5 -0
  378. data/db/migrate/20171112174357_create_katello_content.rb +13 -0
  379. data/db/migrate/20171112174358_create_katello_product_content.rb +16 -0
  380. data/db/migrate/20171114150937_cleanup_installed_packages.rb +1 -1
  381. data/db/migrate/20171114183353_add_hypervisor_id_to_katello_pools.rb +1 -1
  382. data/db/migrate/20171120144843_add_repository_ignore_proxy.rb +5 -0
  383. data/db/migrate/20171211124439_add_uuid_index_to_katello_subscription_facets.rb +1 -1
  384. data/db/migrate/20180103230812_set_errata_updated_date.rb +7 -0
  385. data/db/seeds.d/101-locations.rb +6 -4
  386. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-add-subscriptions.controller.js +1 -1
  387. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +1 -0
  388. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion_katello.js +6 -0
  389. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-packages-modal.controller.js +1 -4
  390. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-packages-modal.html +2 -2
  391. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-errata.controller.js +0 -2
  392. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-errata.html +8 -10
  393. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +5 -3
  394. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +13 -5
  395. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +1 -1
  396. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.routes.js +44 -0
  397. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-deb-repositories.controller.js +48 -0
  398. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-deb-repositories-list.controller.js +46 -0
  399. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +11 -7
  400. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-publish.controller.js +3 -0
  401. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/date-type-errata-filter.controller.js +4 -14
  402. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-repositories.controller.js +4 -0
  403. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-deb-repositories.html +87 -0
  404. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details.html +7 -0
  405. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-docker-repositories.html +6 -0
  406. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-publish.html +12 -1
  407. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-repositories.html +5 -0
  408. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-versions.html +10 -1
  409. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +13 -2
  410. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-versions.module.js +3 -1
  411. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-apt.html +25 -0
  412. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-deb.html +19 -0
  413. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-errata.html +2 -2
  414. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-yum.html +3 -0
  415. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version.html +16 -2
  416. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/deb.factory.js +28 -0
  417. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/debs.controller.js +34 -0
  418. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/debs.module.js +20 -0
  419. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/debs.routes.js +71 -0
  420. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/deb-content-views.controller.js +44 -0
  421. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/deb-repositories.controller.js +36 -0
  422. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/deb.controller.js +34 -0
  423. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/views/deb-content-views.html +41 -0
  424. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/views/deb-info.html +21 -0
  425. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/views/deb-repositories.html +52 -0
  426. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/views/deb.html +37 -0
  427. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/views/debs.html +43 -0
  428. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-manifest-lists/docker-manifest-list.factory.js +26 -0
  429. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-manifest-lists/docker-manifest-lists.module.js +19 -0
  430. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/docker-tag-details.controller.js +17 -3
  431. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/docker-tag-environments.controller.js +2 -11
  432. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/views/docker-tag-details.html +2 -2
  433. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/views/docker-tag-info.html +7 -8
  434. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/docker-tags.routes.js +1 -1
  435. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/views/docker-tags.html +1 -1
  436. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-errata.html +2 -2
  437. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/erratum-content-hosts.controller.js +11 -25
  438. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-content-hosts.html +3 -3
  439. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/errata.routes.js +1 -1
  440. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/incremental-update.service.js +2 -3
  441. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/views/apply-errata-confirm.html +6 -17
  442. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/files/file.factory.js +1 -1
  443. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/files/files.controller.js +2 -2
  444. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/organization-selector.controller.js +2 -1
  445. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branches.routes.js +1 -1
  446. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/packages.routes.js +1 -1
  447. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-manage-content.controller.js +17 -6
  448. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +69 -8
  449. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-debs.html +68 -0
  450. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-docker-manifest-lists.html +44 -0
  451. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-docker-manifests.html +13 -7
  452. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-packages.html +2 -2
  453. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-puppet-modules.html +2 -2
  454. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +42 -4
  455. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repositories.module.js +3 -1
  456. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repositories.routes.js +18 -0
  457. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +21 -2
  458. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/discovery.controller.js +2 -0
  459. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.controller.js +8 -0
  460. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/views/products.html +3 -3
  461. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-details.controller.js +1 -1
  462. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-import.html +1 -1
  463. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/new/new-sync-plan.controller.js +1 -0
  464. data/engines/bastion_katello/app/assets/stylesheets/bastion_katello/bastion_katello.scss +1 -0
  465. data/engines/bastion_katello/app/assets/stylesheets/bastion_katello/docker.scss +16 -0
  466. data/engines/bastion_katello/lib/bastion_katello/engine.rb +1 -0
  467. data/lib/katello/engine.rb +4 -6
  468. data/lib/katello/permission_creator.rb +14 -12
  469. data/lib/katello/permissions/host_permissions.rb +1 -0
  470. data/lib/katello/plugin.rb +83 -54
  471. data/lib/katello/prevent_json_parsing.rb +15 -0
  472. data/lib/katello/repository_types/deb.rb +1 -0
  473. data/lib/katello/tasks/clean_old_file_repos.rake +33 -0
  474. data/lib/katello/tasks/clean_published_repo_directories.rake +4 -4
  475. data/lib/katello/tasks/reimport.rake +8 -1
  476. data/lib/katello/tasks/repository.rake +3 -3
  477. data/lib/katello/tasks/rubocop.rake +1 -1
  478. data/lib/katello/tasks/test.rake +1 -0
  479. data/lib/katello/tasks/upgrades/3.6/import_product_content.rake +12 -0
  480. data/lib/katello/tasks/upgrades/3.6/republish_file_repos.rake +16 -0
  481. data/lib/katello/tasks/virt_who_report.rake +2 -2
  482. data/lib/katello/version.rb +1 -1
  483. data/locale/README +1 -0
  484. metadata +121 -30
  485. data/app/lib/actions/candlepin/owner/upstream_regenerate_certificates.rb +0 -17
  486. data/app/lib/actions/candlepin/product/update.rb +0 -32
  487. data/app/lib/actions/katello/event_queue/run_once_coordinator_lock.rb +0 -12
  488. data/app/models/katello/candlepin/content.rb +0 -252
  489. data/app/models/katello/candlepin/product_content.rb +0 -48
  490. data/lib/katello/params_parser_wrapper.rb +0 -16
@@ -0,0 +1,31 @@
1
+ module Katello
2
+ module Glue::Candlepin::Repository
3
+ CANDLEPIN_DOCKER_TYPE = "containerimage".freeze
4
+ CANDLEPIN_OSTREE_TYPE = "ostree".freeze
5
+
6
+ def self.included(base)
7
+ base.send :include, InstanceMethods
8
+ # required for GPG key url generation
9
+ base.send :include, Rails.application.routes.url_helpers
10
+ end
11
+
12
+ module InstanceMethods
13
+ def should_update_content?
14
+ (self.gpg_key_id_was.nil? && !self.gpg_key_id.nil? && self.content.gpgUrl == '') ||
15
+ (!self.gpg_key_id_was.nil? && self.gpg_key_id.nil? && self.content.gpgUrl != '')
16
+ end
17
+
18
+ def yum_gpg_key_url
19
+ # if the repo has a gpg key return a url to access it
20
+ if (gpg_key && gpg_key.content.present?)
21
+ host = Facter.value(:fqdn) || SETTINGS[:fqdn]
22
+ gpg_key_content_api_repository_url(self, :host => host + "/katello", :protocol => 'https')
23
+ end
24
+ end
25
+
26
+ def custom_content_label
27
+ "#{organization.label} #{product.label} #{label}".gsub(/\s/, "_")
28
+ end
29
+ end
30
+ end
31
+ end
@@ -53,24 +53,6 @@ module Katello
53
53
  sync_times.last
54
54
  end
55
55
 
56
- def owner_regenerate_upstream_certificates(upstream)
57
- if !upstream['idCert'] || !upstream['idCert']['cert'] || !upstream['idCert']['key']
58
- Rails.logger.error "Upstream identity certificate not available"
59
- fail _("Upstream identity certificate not available")
60
- end
61
-
62
- # Default to Red Hat
63
- url = upstream['apiUrl'] || 'https://subscription.rhn.redhat.com/subscription/consumers/'
64
-
65
- # TODO: wait until ca_path is supported
66
- # https://github.com/L2G/rest-client-fork/pull/8
67
- #ca_file = '/etc/candlepin/certs/upstream/subscription.rhn.stage.redhat.com.crt'
68
- ca_file = nil
69
-
70
- Resources::Candlepin::UpstreamConsumer.update("#{url}#{upstream['uuid']}/certificates", upstream['idCert']['cert'],
71
- upstream['idCert']['key'], ca_file, {})
72
- end
73
-
74
56
  def owner_upstream_update(upstream, _options)
75
57
  if !upstream['idCert'] || !upstream['idCert']['cert'] || !upstream['idCert']['key']
76
58
  Rails.logger.error "Upstream identity certificate not available"
@@ -141,9 +123,24 @@ module Katello
141
123
  ::Foreman::Logging.logger('katello/manifest_import_logger')
142
124
  end
143
125
 
126
+ def update_product_content_from_cp(katello_and_cp_ids)
127
+ katello_and_cp_ids.each do |id_pair|
128
+ attrs = Resources::Candlepin::Product.get(self.organization.label, id_pair.second, %w(productContent)).first
129
+ product_content_attrs = attrs.delete(:productContent) || []
130
+ product = ::Katello::Product.find(id_pair.first)
131
+ Glue::Candlepin::Product.import_product_content(product, product_content_attrs)
132
+ end
133
+ end
134
+
144
135
  # TODO: break up method
145
136
  def import_products_from_cp # rubocop:disable MethodLength
146
- product_in_katello_ids = self.organization.providers.redhat.first.products.pluck("cp_id")
137
+ db_and_cp_ids = self.organization.providers.redhat.first.products.pluck(:id, :cp_id)
138
+
139
+ # this method only imports products which are not already in Katello
140
+ # no need for a full import on them - just update the product content
141
+ update_product_content_from_cp(db_and_cp_ids)
142
+
143
+ product_in_katello_ids = db_and_cp_ids.map(&:second)
147
144
  products_in_candlepin_ids = []
148
145
 
149
146
  marketing_to_engineering_product_ids_mapping.each do |marketing_product_id, engineering_product_ids|
@@ -101,6 +101,10 @@ module Katello
101
101
  end
102
102
  end
103
103
 
104
+ def srpm_count
105
+ pulp_repo_facts['content_unit_counts']['srpm']
106
+ end
107
+
104
108
  def uri
105
109
  uri = URI.parse(SETTINGS[:katello][:pulp][:url])
106
110
  "https://#{uri.host}/pulp/repos/#{relative_path}"
@@ -140,6 +144,8 @@ module Katello
140
144
  importer = Runcible::Models::YumImporter.new
141
145
  when Repository::PUPPET_TYPE
142
146
  importer = Runcible::Models::PuppetImporter.new
147
+ when Repository::DEB_TYPE
148
+ importer = Runcible::Models::DebImporter.new
143
149
  end
144
150
  end
145
151
 
@@ -159,7 +165,7 @@ module Katello
159
165
  when Repository::YUM_TYPE
160
166
  Runcible::Models::YumImporter.new(yum_importer_values(capsule))
161
167
  when Repository::FILE_TYPE
162
- Runcible::Models::IsoImporter.new(importer_ssl_options(capsule).merge(:feed => importer_feed_url(capsule)))
168
+ Runcible::Models::IsoImporter.new(importer_connection_options(capsule).merge(:feed => importer_feed_url(capsule)))
163
169
  when Repository::PUPPET_TYPE
164
170
  Runcible::Models::PuppetImporter.new(puppet_importer_values(capsule))
165
171
  when Repository::DOCKER_TYPE
@@ -167,12 +173,14 @@ module Katello
167
173
  options[:upstream_name] = capsule.default_capsule? ? self.docker_upstream_name : self.container_repository_name
168
174
  options[:feed] = docker_feed_url(capsule)
169
175
  options[:enable_v1] = false
170
- Runcible::Models::DockerImporter.new(importer_ssl_options(capsule).merge(options))
176
+ Runcible::Models::DockerImporter.new(importer_connection_options(capsule).merge(options))
171
177
  when Repository::OSTREE_TYPE
172
- options = importer_ssl_options(capsule)
178
+ options = importer_connection_options(capsule)
173
179
  options[:depth] = capsule.default_capsule? ? compute_ostree_upstream_sync_depth : ostree_capsule_sync_depth
174
180
  options[:feed] = self.importer_feed_url(capsule)
175
181
  Runcible::Models::OstreeImporter.new(options)
182
+ when Repository::DEB_TYPE
183
+ Runcible::Models::DebImporter.new(deb_importer_values(capsule))
176
184
  else
177
185
  fail _("Unexpected repo type %s") % self.content_type
178
186
  end
@@ -207,7 +215,11 @@ module Katello
207
215
  :download_policy => new_download_policy,
208
216
  :remove_missing => capsule.default_capsule? ? self.mirror_on_sync? : true
209
217
  }
210
- config.merge(importer_ssl_options(capsule))
218
+ config.merge(importer_connection_options(capsule))
219
+ end
220
+
221
+ def proxy_host_value
222
+ self.ignore_global_proxy ? "" : nil
211
223
  end
212
224
 
213
225
  def puppet_importer_values(capsule)
@@ -215,10 +227,20 @@ module Katello
215
227
  :feed => self.importer_feed_url(capsule),
216
228
  :remove_missing => capsule.default_capsule? ? self.mirror_on_sync? : true
217
229
  }
218
- config.merge(importer_ssl_options(capsule))
230
+ config.merge(importer_connection_options(capsule))
231
+ end
232
+
233
+ def deb_importer_values(capsule)
234
+ config = {
235
+ feed: self.importer_feed_url(capsule),
236
+ releases: self.deb_releases,
237
+ components: self.deb_components,
238
+ architectures: self.deb_architectures
239
+ }
240
+ config.merge(importer_connection_options(capsule))
219
241
  end
220
242
 
221
- def importer_ssl_options(capsule = SmartProxy.default_capsule!)
243
+ def importer_connection_options(capsule = SmartProxy.default_capsule!)
222
244
  if !capsule.default_capsule?
223
245
  ueber_cert = ::Cert::Certs.ueber_cert(organization)
224
246
  importer_options = {
@@ -230,13 +252,15 @@ module Katello
230
252
  importer_options = {
231
253
  :ssl_client_cert => self.product.certificate,
232
254
  :ssl_client_key => self.product.key,
233
- :ssl_ca_cert => Katello::Repository.feed_ca_cert(url)
255
+ :ssl_ca_cert => Katello::Repository.feed_ca_cert(url),
256
+ :proxy_host => self.proxy_host_value
234
257
  }
235
258
  else
236
259
  importer_options = {
237
260
  :ssl_client_cert => nil,
238
261
  :ssl_client_key => nil,
239
- :ssl_ca_cert => nil
262
+ :ssl_ca_cert => nil,
263
+ :proxy_host => self.proxy_host_value
240
264
  }
241
265
  end
242
266
  unless self.is_a?(::Katello::ContentViewPuppetEnvironment)
@@ -264,8 +288,7 @@ module Katello
264
288
  distributors = [yum_dist, export_dist]
265
289
  distributors << clone_dist if capsule.default_capsule?
266
290
  when Repository::FILE_TYPE
267
- dist = Runcible::Models::IsoDistributor.new(true, true)
268
- dist.auto_publish = true
291
+ dist = Runcible::Models::IsoDistributor.new(self.relative_path, self.unprotected, true, auto_publish: true)
269
292
  distributors = [dist]
270
293
  when Repository::PUPPET_TYPE
271
294
  capsule ||= SmartProxy.default_capsule!
@@ -295,6 +318,15 @@ module Katello
295
318
 
296
319
  dist = Runcible::Models::OstreeDistributor.new(options)
297
320
  distributors = [dist]
321
+ when Repository::DEB_TYPE
322
+ options = {
323
+ id: self.pulp_id,
324
+ auto_publish: true
325
+ }
326
+ http = self.unprotected
327
+ https = true
328
+ dist = Runcible::Models::DebDistributor.new(self.relative_path, http, https, options)
329
+ distributors = [dist]
298
330
  else
299
331
  fail _("Unexpected repo type %s") % self.content_type
300
332
  end
@@ -314,6 +346,8 @@ module Katello
314
346
  Runcible::Models::DockerImporter::ID
315
347
  when Repository::OSTREE_TYPE
316
348
  Runcible::Models::OstreeImporter::ID
349
+ when Repository::DEB_TYPE
350
+ Runcible::Models::DebImporter::ID
317
351
  else
318
352
  fail _("Unexpected repo type %s") % self.content_type
319
353
  end
@@ -390,8 +424,9 @@ module Katello
390
424
 
391
425
  def pulp_update_needed?
392
426
  changeable_attributes = %w(url unprotected checksum_type docker_upstream_name download_policy mirror_on_sync verify_ssl_on_sync
393
- upstream_username upstream_password ostree_upstream_sync_policy ostree_upstream_sync_depth)
427
+ upstream_username upstream_password ostree_upstream_sync_policy ostree_upstream_sync_depth ignore_global_proxy)
394
428
  changeable_attributes << "name" if docker?
429
+ changeable_attributes += %w(deb_releases deb_components deb_architectures) if deb?
395
430
  changeable_attributes.any? { |key| previous_changes.key?(key) }
396
431
  end
397
432
 
@@ -573,6 +608,8 @@ module Katello
573
608
  "ostree"
574
609
  when Repository::FILE_TYPE
575
610
  "iso"
611
+ when Repository::DEB_TYPE
612
+ "deb"
576
613
  end
577
614
  end
578
615
 
@@ -622,6 +659,10 @@ module Katello
622
659
  self.content_type == Repository::OSTREE_TYPE
623
660
  end
624
661
 
662
+ def deb?
663
+ self.content_type == Repository::DEB_TYPE
664
+ end
665
+
625
666
  def published?
626
667
  distributors.map { |dist| dist['last_publish'] }.compact.any?
627
668
  end
@@ -652,7 +693,7 @@ module Katello
652
693
  return false if last_sync.nil?
653
694
  return true if last_publish.nil?
654
695
 
655
- DateTime.parse(last_sync) >= DateTime.parse(last_publish)
696
+ Time.parse(last_sync) >= Time.parse(last_publish)
656
697
  end
657
698
 
658
699
  def last_sync_task
@@ -723,31 +764,63 @@ module Katello
723
764
  if docker?
724
765
  "#{pulp_uri.host.downcase}:#{Setting['pulp_docker_registry_port']}/#{container_repository_name}"
725
766
  elsif file?
726
- "#{scheme}://#{pulp_uri.host.downcase}/pulp/isos/#{pulp_id}/"
767
+ "#{scheme}://#{pulp_uri.host.downcase}/pulp/isos/#{relative_path}/"
727
768
  elsif puppet?
728
769
  "#{scheme}://#{pulp_uri.host.downcase}/pulp/puppet/#{pulp_id}/"
729
770
  elsif ostree?
730
771
  "#{scheme}://#{pulp_uri.host.downcase}/pulp/ostree/web/#{relative_path}"
772
+ elsif deb?
773
+ "#{scheme}://#{pulp_uri.host.downcase}/pulp/deb/#{relative_path}"
731
774
  else
732
775
  "#{scheme}://#{pulp_uri.host.downcase}/pulp/repos/#{relative_path}/"
733
776
  end
734
777
  end
735
778
 
736
- def index_content(full_index = false)
737
- if self.yum?
779
+ def index_yum_content(full_index = false)
780
+ if self.master?
738
781
  Katello::Rpm.import_for_repository(self, full_index)
782
+ Katello::Srpm.import_for_repository(self, full_index)
739
783
  Katello::Erratum.import_for_repository(self)
740
784
  Katello::PackageGroup.import_for_repository(self)
741
785
  self.import_distribution_data
786
+ else
787
+ index_linked_repo
788
+ end
789
+ end
790
+
791
+ def index_linked_repo
792
+ if (base_repo = self.target_repository)
793
+ Rpm.copy_repository_associations(base_repo, self)
794
+ Erratum.copy_repository_associations(base_repo, self)
795
+ PackageGroup.copy_repository_associations(base_repo, self)
796
+ self.update_attributes!(
797
+ :distribution_version => base_repo.distribution_version,
798
+ :distribution_arch => base_repo.distribution_arch,
799
+ :distribution_family => base_repo.distribution_family,
800
+ :distribution_variant => base_repo.distribution_variant,
801
+ :distribution_uuid => base_repo.distribution_uuid,
802
+ :distribution_bootable => base_repo.distribution_bootable
803
+ )
804
+ else
805
+ Rails.logger.error("Cannot index #{self.id}, no target repository found.")
806
+ end
807
+ end
808
+
809
+ def index_content(full_index = false)
810
+ if self.yum?
811
+ index_yum_content(full_index)
742
812
  elsif self.docker?
743
813
  Katello::DockerManifest.import_for_repository(self)
744
- Katello::DockerTag.import_for_repository(self, true)
814
+ Katello::DockerManifestList.import_for_repository(self)
815
+ Katello::DockerTag.import_for_repository(self)
745
816
  elsif self.puppet?
746
817
  Katello::PuppetModule.import_for_repository(self)
747
818
  elsif self.ostree?
748
819
  Katello::OstreeBranch.import_for_repository(self)
749
820
  elsif self.file?
750
821
  Katello::FileUnit.import_for_repository(self)
822
+ elsif self.deb?
823
+ Katello::Deb.import_for_repository(self)
751
824
  end
752
825
  true
753
826
  end
@@ -9,14 +9,14 @@ module Katello
9
9
  belongs_to :lifecycle_environment, :inverse_of => :content_facets, :class_name => "Katello::KTEnvironment"
10
10
  belongs_to :content_source, :class_name => "::SmartProxy", :foreign_key => :content_source_id, :inverse_of => :content_facets
11
11
 
12
- has_many :applicable_errata, :through => :content_facet_errata, :class_name => "Katello::Erratum", :source => :erratum
13
12
  has_many :content_facet_errata, :class_name => "Katello::ContentFacetErratum", :dependent => :destroy, :inverse_of => :content_facet
13
+ has_many :applicable_errata, :through => :content_facet_errata, :class_name => "Katello::Erratum", :source => :erratum
14
14
 
15
- has_many :bound_repositories, :through => :content_facet_repositories, :class_name => "Katello::Repository", :source => :repository
16
15
  has_many :content_facet_repositories, :class_name => "Katello::ContentFacetRepository", :dependent => :destroy, :inverse_of => :content_facet
16
+ has_many :bound_repositories, :through => :content_facet_repositories, :class_name => "Katello::Repository", :source => :repository
17
17
 
18
- has_many :applicable_rpms, :through => :content_facet_applicable_rpms, :class_name => "Katello::Rpm", :source => :rpm
19
18
  has_many :content_facet_applicable_rpms, :class_name => "Katello::ContentFacetApplicableRpm", :dependent => :destroy, :inverse_of => :content_facet
19
+ has_many :applicable_rpms, :through => :content_facet_applicable_rpms, :class_name => "Katello::Rpm", :source => :rpm
20
20
 
21
21
  validates :content_view, :presence => true, :allow_blank => false
22
22
  validates :lifecycle_environment, :presence => true, :allow_blank => false
@@ -52,7 +52,7 @@ module Katello
52
52
  else
53
53
  self.bound_repositories.pluck(:id)
54
54
  end
55
- self.applicable_errata.in_repositories(repos).uniq
55
+ self.applicable_errata.in_repositories(repos)
56
56
  end
57
57
 
58
58
  def installable_rpms(env = nil, content_view = nil)
@@ -61,7 +61,7 @@ module Katello
61
61
  else
62
62
  self.bound_repositories.pluck(:id)
63
63
  end
64
- self.applicable_rpms.in_repositories(repos).uniq
64
+ self.applicable_rpms.in_repositories(repos)
65
65
  end
66
66
 
67
67
  def errata_counts
@@ -148,7 +148,7 @@ module Katello
148
148
  def self.with_non_installable_errata(errata)
149
149
  subquery = Katello::Erratum.select("#{Katello::Erratum.table_name}.id").ids_installable_for_hosts
150
150
  .where("#{Katello::ContentFacetRepository.table_name}.content_facet_id = #{Katello::Host::ContentFacet.table_name}.id").to_sql
151
- self.joins(:applicable_errata).where("#{Katello::Erratum.table_name}.id" => errata).where("#{Katello::Erratum.table_name}.id NOT IN (#{subquery})").uniq
151
+ self.joins(:applicable_errata).where("#{Katello::Erratum.table_name}.id" => errata).where("#{Katello::Erratum.table_name}.id NOT IN (#{subquery})").distinct
152
152
  end
153
153
 
154
154
  def self.with_applicable_errata(errata)
@@ -28,7 +28,7 @@ module Katello
28
28
  'label' => host.content_view.try(:label),
29
29
  'latest-version' => host.content_view.try(:latest_version),
30
30
  'version' => content_version.try(:version),
31
- 'published' => content_version.try(:created_at),
31
+ 'published' => content_version.try(:created_at).try(:time),
32
32
  'components' => content_view_components
33
33
  }
34
34
 
@@ -43,7 +43,7 @@ module Katello
43
43
  cv_label = cv.component_version.content_view.label
44
44
  components[cv_label] = {}
45
45
  components[cv_label]['version'] = cv.component_version.try(:version)
46
- components[cv_label]['published'] = cv.component_version.try(:created_at)
46
+ components[cv_label]['published'] = cv.component_version.try(:created_at).try(:time)
47
47
  end
48
48
  components
49
49
  end
@@ -7,11 +7,11 @@ module Katello
7
7
  belongs_to :user, :inverse_of => :subscription_facets, :class_name => "::User"
8
8
  belongs_to :hypervisor_host, :class_name => "::Host::Managed", :foreign_key => "hypervisor_host_id"
9
9
 
10
- has_many :activation_keys, :through => :subscription_facet_activation_keys, :class_name => "Katello::ActivationKey"
11
10
  has_many :subscription_facet_activation_keys, :class_name => "Katello::SubscriptionFacetActivationKey", :dependent => :destroy, :inverse_of => :subscription_facet
11
+ has_many :activation_keys, :through => :subscription_facet_activation_keys, :class_name => "Katello::ActivationKey"
12
12
 
13
- has_many :pools, :through => :subscription_facet_pools, :class_name => "Katello::Pool"
14
13
  has_many :subscription_facet_pools, :class_name => "Katello::SubscriptionFacetPool", :dependent => :destroy, :inverse_of => :subscription_facet
14
+ has_many :pools, :through => :subscription_facet_pools, :class_name => "Katello::Pool"
15
15
  validates :host, :presence => true, :allow_blank => false
16
16
 
17
17
  DEFAULT_TYPE = 'system'.freeze
@@ -140,7 +140,7 @@ module Katello
140
140
  def self.update_facts(host, rhsm_facts)
141
141
  return if host.build? || rhsm_facts.nil?
142
142
  rhsm_facts[:_type] = RhsmFactName::FACT_TYPE
143
- rhsm_facts[:_timestamp] = DateTime.now.to_s
143
+ rhsm_facts[:_timestamp] = Time.now.to_s
144
144
  host.import_facts(rhsm_facts)
145
145
  end
146
146
 
@@ -192,7 +192,7 @@ module Katello
192
192
 
193
193
  def self.find_host(facts, organization)
194
194
  host_name = propose_existing_hostname(facts)
195
- hosts = ::Host.unscoped.where(:name => host_name)
195
+ hosts = ::Host.where(:name => host_name)
196
196
 
197
197
  return nil if hosts.empty? #no host exists
198
198
  if hosts.where("organization_id = #{organization.id} OR organization_id is NULL").empty? #not in the correct org
@@ -58,7 +58,7 @@ module Katello
58
58
  :dependent => :destroy, :inverse_of => :lifecycle_environment
59
59
 
60
60
  # RAILS3458: before_destroys before associations. see http://tinyurl.com/rails3458
61
- before_destroy :deletable?, :prepend => true
61
+ before_destroy :assert_deletable, :prepend => true
62
62
 
63
63
  scope(:not_in_capsule,
64
64
  lambda do |capsule|
@@ -80,7 +80,7 @@ module Katello
80
80
  end
81
81
 
82
82
  def default_content_view
83
- self.default_content_view_version.try(:content_view, nil)
83
+ self.default_content_view_version.try(:content_view)
84
84
  end
85
85
 
86
86
  def default_content_view_version
@@ -140,6 +140,10 @@ module Katello
140
140
  self.promoting.exists?
141
141
  end
142
142
 
143
+ def assert_deletable
144
+ throw :abort unless deletable?
145
+ end
146
+
143
147
  def deletable?
144
148
  return true if self.organization.nil? || self.organization.being_deleted?
145
149
 
@@ -4,8 +4,8 @@ module Katello
4
4
 
5
5
  CONTENT_TYPE = "package_group".freeze
6
6
 
7
- has_many :repositories, :through => :repository_package_groups, :class_name => "Katello::Repository"
8
7
  has_many :repository_package_groups, :class_name => "Katello::RepositoryPackageGroup", :dependent => :destroy, :inverse_of => :package_group
8
+ has_many :repositories, :through => :repository_package_groups, :class_name => "Katello::Repository"
9
9
 
10
10
  scoped_search :on => :name, :complete_value => true
11
11
  scoped_search :on => :uuid, :rename => :id, :complete_value => true