katello 3.1.0.1 → 3.2.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 (390) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -47
  3. data/app/assets/javascripts/katello/common/index.js +0 -1
  4. data/app/assets/javascripts/katello/providers/redhat/index.js +0 -1
  5. data/app/assets/stylesheets/katello/_katello_colors.scss +0 -2
  6. data/app/assets/stylesheets/katello/katello.scss +0 -2
  7. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +45 -42
  8. data/app/controllers/katello/api/v2/activation_keys_controller.rb +7 -19
  9. data/app/controllers/katello/api/v2/api_controller.rb +3 -3
  10. data/app/controllers/katello/api/v2/capsule_content_controller.rb +3 -3
  11. data/app/controllers/katello/api/v2/content_uploads_controller.rb +2 -2
  12. data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +29 -18
  13. data/app/controllers/katello/api/v2/content_view_filters_controller.rb +2 -2
  14. data/app/controllers/katello/api/v2/content_view_histories_controller.rb +1 -1
  15. data/app/controllers/katello/api/v2/content_view_puppet_modules_controller.rb +2 -2
  16. data/app/controllers/katello/api/v2/content_view_versions_controller.rb +10 -8
  17. data/app/controllers/katello/api/v2/content_views_controller.rb +5 -5
  18. data/app/controllers/katello/api/v2/environments_controller.rb +10 -9
  19. data/app/controllers/katello/api/v2/file_units_controller.rb +16 -0
  20. data/app/controllers/katello/api/v2/gpg_keys_controller.rb +4 -4
  21. data/app/controllers/katello/api/v2/host_autocomplete_controller.rb +2 -2
  22. data/app/controllers/katello/api/v2/host_collections_controller.rb +41 -13
  23. data/app/controllers/katello/api/v2/host_errata_controller.rb +12 -5
  24. data/app/controllers/katello/api/v2/host_packages_controller.rb +4 -4
  25. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +9 -9
  26. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +52 -13
  27. data/app/controllers/katello/api/v2/organizations_controller.rb +3 -3
  28. data/app/controllers/katello/api/v2/packages_controller.rb +1 -1
  29. data/app/controllers/katello/api/v2/ping_controller.rb +2 -2
  30. data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +2 -2
  31. data/app/controllers/katello/api/v2/products_controller.rb +6 -16
  32. data/app/controllers/katello/api/v2/repositories_bulk_actions_controller.rb +1 -1
  33. data/app/controllers/katello/api/v2/repositories_controller.rb +60 -21
  34. data/app/controllers/katello/api/v2/repository_sets_controller.rb +3 -3
  35. data/app/controllers/katello/api/v2/root_controller.rb +2 -2
  36. data/app/controllers/katello/api/v2/subscriptions_controller.rb +19 -10
  37. data/app/controllers/katello/api/v2/sync_controller.rb +3 -3
  38. data/app/controllers/katello/api/v2/sync_plans_controller.rb +2 -2
  39. data/app/controllers/katello/api/v2/uebercerts_controller.rb +1 -1
  40. data/app/controllers/katello/application_controller.rb +7 -7
  41. data/app/controllers/katello/auto_complete_search_controller.rb +1 -1
  42. data/app/controllers/katello/concerns/api/api_controller.rb +1 -1
  43. data/app/controllers/katello/concerns/api/v2/hostgroups_controller_extensions.rb +19 -16
  44. data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +8 -6
  45. data/app/controllers/katello/concerns/authorization/api/v2/content_views_controller.rb +10 -6
  46. data/app/controllers/katello/concerns/organizations_controller_extensions.rb +1 -1
  47. data/app/controllers/katello/concerns/smart_proxies_controller_extensions.rb +1 -1
  48. data/app/controllers/katello/errors_controller.rb +2 -2
  49. data/app/controllers/katello/organizations_controller.rb +1 -1
  50. data/app/controllers/katello/products_controller.rb +4 -4
  51. data/app/controllers/katello/providers_controller.rb +2 -2
  52. data/app/helpers/katello/application_helper.rb +0 -240
  53. data/app/helpers/katello/concerns/hosts_and_hostgroups_helper_extensions.rb +19 -0
  54. data/app/lib/actions/candlepin/import_pool_handler.rb +11 -6
  55. data/app/lib/actions/katello/capsule_content/create_repos.rb +3 -3
  56. data/app/lib/actions/katello/capsule_content/sync.rb +23 -9
  57. data/app/lib/actions/katello/content_view/add_to_environment.rb +1 -1
  58. data/app/lib/actions/katello/content_view/errata_mail.rb +2 -2
  59. data/app/lib/actions/katello/content_view/incremental_updates.rb +60 -1
  60. data/app/lib/actions/katello/content_view/remove.rb +2 -2
  61. data/app/lib/actions/katello/content_view_environment/destroy.rb +1 -1
  62. data/app/lib/actions/katello/content_view_environment/reassign_objects.rb +2 -2
  63. data/app/lib/actions/katello/content_view_puppet_environment/create.rb +3 -1
  64. data/app/lib/actions/katello/host/attach_subscriptions.rb +13 -6
  65. data/app/lib/actions/katello/host/destroy.rb +0 -19
  66. data/app/lib/actions/katello/host/generate_applicability.rb +8 -3
  67. data/app/lib/actions/katello/host/hypervisors.rb +17 -9
  68. data/app/lib/actions/katello/host/hypervisors_update.rb +19 -44
  69. data/app/lib/actions/katello/host/reassign.rb +14 -0
  70. data/app/lib/actions/katello/host/register.rb +3 -22
  71. data/app/lib/actions/katello/host/remove_subscriptions.rb +15 -2
  72. data/app/lib/actions/katello/host/update.rb +0 -6
  73. data/app/lib/actions/katello/organization/destroy.rb +2 -2
  74. data/app/lib/actions/katello/product/content_destroy.rb +7 -9
  75. data/app/lib/actions/katello/product/destroy.rb +23 -7
  76. data/app/lib/actions/katello/repository/clear.rb +1 -0
  77. data/app/lib/actions/katello/repository/clone_file_content.rb +17 -0
  78. data/app/lib/actions/katello/repository/clone_to_environment.rb +2 -0
  79. data/app/lib/actions/katello/repository/clone_to_version.rb +2 -0
  80. data/app/lib/actions/katello/repository/create.rb +2 -1
  81. data/app/lib/actions/katello/repository/destroy.rb +20 -10
  82. data/app/lib/actions/katello/repository/errata_mail.rb +2 -2
  83. data/app/lib/actions/katello/repository/filtered_index_content.rb +2 -0
  84. data/app/lib/actions/katello/repository/import_upload.rb +6 -2
  85. data/app/lib/actions/katello/repository/{refresh_repostiory.rb → refresh_repository.rb} +0 -0
  86. data/app/lib/actions/katello/repository/remove_content.rb +2 -0
  87. data/app/lib/actions/katello/repository/sync.rb +8 -12
  88. data/app/lib/actions/katello/repository_set/disable_repository.rb +6 -5
  89. data/app/lib/actions/katello/repository_set/enable_repository.rb +1 -1
  90. data/app/lib/actions/katello/repository_set/scan_cdn.rb +1 -1
  91. data/app/lib/actions/pulp/abstract_async_task.rb +1 -1
  92. data/app/lib/actions/pulp/consumer/unassociate_units.rb +20 -0
  93. data/app/lib/actions/pulp/repository/copy_files.rb +11 -0
  94. data/app/lib/actions/pulp/repository/create.rb +5 -1
  95. data/app/lib/actions/pulp/repository/presenters/file_presenter.rb +1 -1
  96. data/app/lib/actions/pulp/repository/refresh.rb +4 -2
  97. data/app/lib/actions/pulp/repository/remove_file.rb +15 -0
  98. data/app/lib/actions/pulp/repository/sync.rb +3 -1
  99. data/app/lib/actions/pulp/repository_group/export.rb +1 -1
  100. data/app/lib/katello/errors.rb +1 -1
  101. data/app/lib/katello/lazy_accessor.rb +1 -1
  102. data/app/lib/katello/resources/candlepin.rb +14 -0
  103. data/app/lib/katello/util/cdn_var_substitutor.rb +5 -2
  104. data/app/lib/katello/util/model.rb +1 -2
  105. data/app/lib/katello/util/package.rb +2 -2
  106. data/app/models/katello/activation_key.rb +0 -49
  107. data/app/models/katello/authorization/content_view_version.rb +7 -0
  108. data/app/models/katello/candlepin/content.rb +15 -3
  109. data/app/models/katello/concerns/container_extensions.rb +1 -2
  110. data/app/models/katello/concerns/content_facet_host_extensions.rb +11 -1
  111. data/app/models/katello/concerns/host_managed_extensions.rb +4 -13
  112. data/app/models/katello/concerns/hostgroup_extensions.rb +0 -2
  113. data/app/models/katello/concerns/medium_extensions.rb +2 -2
  114. data/app/models/katello/concerns/organization_extensions.rb +0 -5
  115. data/app/models/katello/concerns/pulp_database_unit.rb +5 -1
  116. data/app/models/katello/concerns/smart_proxy_extensions.rb +21 -1
  117. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +1 -2
  118. data/app/models/katello/content_view.rb +12 -6
  119. data/app/models/katello/content_view_component.rb +0 -3
  120. data/app/models/katello/content_view_environment.rb +2 -2
  121. data/app/models/katello/content_view_package_filter_rule.rb +13 -0
  122. data/app/models/katello/content_view_puppet_environment.rb +2 -2
  123. data/app/models/katello/content_view_repository.rb +2 -1
  124. data/app/models/katello/content_view_version.rb +9 -2
  125. data/app/models/katello/erratum.rb +1 -5
  126. data/app/models/katello/file_unit.rb +41 -0
  127. data/app/models/katello/glue/candlepin/activation_key.rb +2 -2
  128. data/app/models/katello/glue/candlepin/pool.rb +19 -14
  129. data/app/models/katello/glue/pulp/repo.rb +44 -10
  130. data/app/models/katello/host/content_facet.rb +6 -6
  131. data/app/models/katello/host/subscription_facet.rb +6 -8
  132. data/app/models/katello/kt_environment.rb +3 -5
  133. data/app/models/katello/package_group.rb +1 -3
  134. data/app/models/katello/pool.rb +7 -2
  135. data/app/models/katello/pool_with_quantities.rb +12 -0
  136. data/app/models/katello/product.rb +6 -0
  137. data/app/models/katello/provider.rb +1 -1
  138. data/app/models/katello/puppet_module.rb +1 -2
  139. data/app/models/katello/repository.rb +7 -3
  140. data/app/models/katello/repository_file.rb +9 -0
  141. data/app/models/katello/rpm.rb +1 -1
  142. data/app/models/katello/subscription_status.rb +1 -1
  143. data/app/models/katello/sync_plan.rb +2 -1
  144. data/app/models/katello/task_status.rb +3 -36
  145. data/app/models/setting/content.rb +4 -1
  146. data/app/overrides/add_activation_keys_input.rb +2 -2
  147. data/app/presenters/katello/activation_key_subscriptions_presenter.rb +10 -0
  148. data/app/services/katello/candlepin/consumer.rb +5 -1
  149. data/app/services/katello/pulp/file_unit.rb +13 -0
  150. data/app/views/dashboard/_errata_widget.html.erb +1 -1
  151. data/app/views/dashboard/_subscription_widget.html.erb +30 -8
  152. data/app/views/foreman/job_templates/install_errata.erb +1 -1
  153. data/app/views/katello/api/v2/activation_keys/product_content.json.rabl +1 -0
  154. data/app/views/katello/api/v2/capsule_content/sync_status.json.rabl +2 -2
  155. data/app/views/katello/api/v2/content_facet/base.json.rabl +2 -4
  156. data/app/views/katello/api/v2/{systems → content_facet}/erratum.json.rabl +0 -0
  157. data/app/views/katello/api/v2/content_facet/show.json.rabl +1 -1
  158. data/app/views/katello/api/v2/content_view_versions/base.json.rabl +5 -4
  159. data/app/views/katello/api/v2/environments/show.json.rabl +1 -1
  160. data/app/views/katello/api/v2/file_units/base.json.rabl +7 -0
  161. data/app/views/katello/api/v2/{systems → file_units}/index.json.rabl +1 -1
  162. data/app/views/katello/api/v2/file_units/show.json.rabl +3 -0
  163. data/app/views/katello/api/v2/host_errata/index.json.rabl +1 -1
  164. data/app/views/katello/api/v2/host_errata/show.json.rabl +1 -1
  165. data/app/views/katello/api/v2/package_groups/base.json.rabl +1 -1
  166. data/app/views/katello/api/v2/ping/show.json.rabl +1 -1
  167. data/app/views/katello/api/v2/repositories/base.json.rabl +2 -1
  168. data/app/views/katello/api/v2/repositories/show.json.rabl +1 -1
  169. data/app/views/katello/api/v2/subscription_facet/base.json.rabl +1 -1
  170. data/app/views/katello/api/v2/subscription_facet/base_with_root.json.rabl +0 -4
  171. data/app/views/katello/api/v2/subscription_facet/show.json.rabl +1 -5
  172. data/app/views/katello/api/v2/subscriptions/base.json.rabl +3 -3
  173. data/app/views/katello/api/v2/subscriptions/index.json.rabl +1 -0
  174. data/app/views/katello/api/v2/tasks/task_status_show.json.rabl +0 -1
  175. data/app/views/katello/providers/redhat/show.html.erb +1 -1
  176. data/app/views/katello/sync_management/_products.html.erb +5 -1
  177. data/app/views/overrides/activation_keys/_host_environment_select.html.erb +1 -9
  178. data/app/views/overrides/activation_keys/_host_synced_content_select.html.erb +1 -0
  179. data/config/routes/api/v2.rb +9 -2
  180. data/config/routes/overrides.rb +9 -0
  181. data/db/migrate/20150930183738_migrate_content_hosts.rb +1 -1
  182. data/db/migrate/20160617124149_remove_duplicate_view_filters.rb +38 -0
  183. data/db/migrate/20160627125310_delete_system.rb +7 -0
  184. data/db/migrate/20160722193256_add_verify_ssl_on_sync_to_repository.rb +9 -0
  185. data/db/migrate/20160727144242_add_registered_through_to_katello_subscription_facets.rb +5 -0
  186. data/db/migrate/20160808002834_add_files.rb +30 -0
  187. data/db/migrate/20160906181923_add_puppet_path_to_smart_proxy.rb +5 -0
  188. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/activation-keys.module.js +1 -0
  189. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-associations.controller.js +7 -6
  190. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-add-subscriptions.html +6 -2
  191. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-associations-content-hosts.html +4 -0
  192. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-details.html +101 -102
  193. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-subscriptions-list.html +3 -0
  194. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/new/views/activation-key-new.html +82 -83
  195. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/views/activation-keys.html +4 -0
  196. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +1 -0
  197. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.module.js +3 -1
  198. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsules/capsules.module.js +4 -1
  199. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/common.module.js +2 -0
  200. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/views/registration.html +1 -0
  201. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-action-subscriptions.controller.js +46 -72
  202. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-action.controller.js +1 -2
  203. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/bulk-actions-errata.html +5 -0
  204. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/bulk-actions-host-collections.html +5 -0
  205. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/bulk-actions-subscriptions.html +79 -33
  206. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.module.js +1 -0
  207. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-errata.controller.js +10 -0
  208. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-errata.html +27 -15
  209. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages.html +57 -45
  210. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-add-subscriptions.controller.js +5 -18
  211. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-base-subscriptions.controller.js +2 -3
  212. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +2 -1
  213. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-subscriptions.controller.js +3 -3
  214. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-add-subscriptions.html +4 -0
  215. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +117 -118
  216. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +13 -8
  217. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-subscriptions-list.html +5 -0
  218. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +5 -0
  219. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.module.js +1 -0
  220. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.routes.js +26 -0
  221. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-version-deletion-content-hosts.controller.js +11 -4
  222. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-version-deletion-environments.controller.js +1 -1
  223. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-version-deletion.controller.js +1 -1
  224. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/views/content-view-deletion.html +3 -3
  225. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/views/version-deletion-content-hosts.html +2 -2
  226. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/views/version-deletion-environments.html +2 -2
  227. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-file-repositories.controller.js +47 -0
  228. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +8 -0
  229. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-file-repositories-list.controller.js +45 -0
  230. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/errata-filter-details.html +4 -0
  231. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filters.html +3 -0
  232. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/package-filter-details.html +6 -6
  233. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/views/content-view-puppet-module-names.html +6 -0
  234. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/views/content-view-puppet-modules.html +4 -0
  235. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-composite-available-content-views.html +2 -1
  236. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-composite-content-views-list.html +2 -1
  237. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details.html +151 -140
  238. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-docker-repositories.html +1 -1
  239. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-file-repositories.html +118 -0
  240. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-ostree-repositories.html +1 -1
  241. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-repositories.html +1 -1
  242. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-versions.html +13 -2
  243. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +8 -0
  244. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-versions.module.js +1 -0
  245. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-details.html +8 -6
  246. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-file.html +22 -0
  247. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version.html +6 -16
  248. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/views/content-views.html +4 -0
  249. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-manifests/docker-manifests.module.js +6 -1
  250. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/views/docker-tags-details.html +59 -61
  251. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/docker-tags.module.js +3 -0
  252. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/views/docker-tags.html +4 -0
  253. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-content-views.html +5 -0
  254. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-docker.html +4 -0
  255. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-errata.html +4 -0
  256. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-ostree.html +4 -0
  257. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-packages.html +4 -0
  258. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-puppet-modules.html +4 -0
  259. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-repositories.html +4 -0
  260. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.module.js +1 -0
  261. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/errata-content-hosts.controller.js +1 -1
  262. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/errata-details-content-hosts.html +6 -2
  263. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/errata-details-repositories.html +4 -0
  264. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/errata-details.html +44 -45
  265. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/errata.module.js +2 -0
  266. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/views/errata.html +5 -0
  267. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details-info.controller.js +11 -0
  268. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js +1 -1
  269. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/views/gpg-key-details.html +52 -48
  270. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/views/gpg-key-info.html +1 -0
  271. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/views/gpg-key-products.html +1 -1
  272. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/views/gpg-key-repositories.html +1 -1
  273. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/gpg-keys.module.js +1 -0
  274. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/new/views/gpg-key-new.html +62 -63
  275. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/views/gpg-keys.html +6 -3
  276. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-add-hosts.html +4 -0
  277. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-details.html +85 -86
  278. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-hosts-list.html +4 -0
  279. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/host-collections.module.js +1 -0
  280. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/views/host-collection-new.html +16 -17
  281. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/views/host-collections.html +5 -0
  282. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-bulk-action.factory.js +28 -0
  283. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-erratum.factory.js +1 -0
  284. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js +1 -27
  285. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/hosts.module.js +3 -1
  286. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/organization.factory.js +0 -1
  287. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/organizations.module.js +4 -1
  288. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/ostree-branches-details-repositories.controller.js +60 -0
  289. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/ostree-branches-details.controller.js +31 -0
  290. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branches-details-info.html +23 -0
  291. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branches-details-repositories.html +83 -0
  292. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branches-details.html +43 -0
  293. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branches.controller.js +67 -0
  294. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branches.module.js +5 -1
  295. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branches.routes.js +53 -0
  296. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/views/ostree-branches-table-collapsed.html +19 -0
  297. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/views/ostree-branches-table-full.html +21 -0
  298. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/views/ostree-branches.html +19 -0
  299. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/package-groups/package-groups.module.js +7 -1
  300. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package-details.controller.js +17 -2
  301. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/packages-details-info.html +10 -0
  302. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/packages-details-repositories.html +4 -0
  303. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/packages-details.html +51 -52
  304. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/packages.module.js +3 -0
  305. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/views/packages.html +5 -0
  306. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/views/product-details.html +72 -73
  307. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/views/product-repositories.html +19 -7
  308. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/views/discovery-create.html +144 -145
  309. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/new/views/product-new.html +17 -18
  310. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.module.js +1 -0
  311. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/views/products.html +4 -0
  312. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/details/views/puppet-modules-details.html +44 -40
  313. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/puppet-modules.module.js +7 -1
  314. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/views/puppet-modules.html +4 -0
  315. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/details/repository-details-info.controller.js +11 -5
  316. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/details/views/repository-info.html +343 -324
  317. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/new/new-repository.controller.js +4 -4
  318. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/new/views/repository-new.html +10 -0
  319. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/repositories.module.js +1 -0
  320. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/settings/settings.module.js +2 -0
  321. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-associations-content-hosts.html +2 -2
  322. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-details.html +46 -47
  323. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-import.controller.js +10 -0
  324. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-import.html +1 -0
  325. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest.html +41 -42
  326. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptions-helper.service.js +15 -1
  327. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptions.module.js +1 -0
  328. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscriptions.html +4 -0
  329. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-details.html +54 -55
  330. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/sync-plans.module.js +1 -0
  331. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/views/sync-plans.html +4 -0
  332. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/tasks.module.js +3 -1
  333. data/engines/bastion_katello/lib/bastion_katello/engine.rb +1 -0
  334. data/lib/katello/engine.rb +11 -1
  335. data/lib/katello/permissions/host_permissions.rb +13 -1
  336. data/lib/katello/plugin.rb +20 -1
  337. data/lib/katello/tasks/reimport.rake +1 -0
  338. data/lib/katello/tasks/test.rake +8 -0
  339. data/lib/katello/tasks/unify_hosts.rake +91 -0
  340. data/lib/katello/tasks/upgrade_check.rake +3 -2
  341. data/lib/katello/tasks/upgrades/3.0/update_subscription_facet_backend_data.rake +2 -4
  342. data/lib/katello/version.rb +1 -1
  343. data/lib/proxy_api/pulp.rb +7 -0
  344. data/lib/proxy_api/pulp_node.rb +7 -0
  345. metadata +79 -67
  346. data/app/assets/javascripts/katello/common/jquery.jeditable.custominputs.js +0 -180
  347. data/app/assets/javascripts/katello/widgets/jquery.jeditable.helpers.js +0 -247
  348. data/app/assets/stylesheets/katello/widgets/_scrollpane.scss +0 -66
  349. data/app/controllers/katello/api/v2/systems_controller.rb +0 -213
  350. data/app/helpers/katello/activation_keys_helper.rb +0 -4
  351. data/app/helpers/katello/host_collection_events_helper.rb +0 -7
  352. data/app/helpers/katello/katello_form_builder.rb +0 -150
  353. data/app/helpers/katello/packages_helper.rb +0 -67
  354. data/app/helpers/katello/subscriptions_helper.rb +0 -32
  355. data/app/helpers/katello/system_events_helper.rb +0 -4
  356. data/app/helpers/katello/system_packages_helper.rb +0 -42
  357. data/app/lib/actions/katello/repository/incremental_import.rb +0 -61
  358. data/app/lib/actions/katello/subscription/subscribe.rb +0 -26
  359. data/app/lib/actions/katello/system/destroy.rb +0 -17
  360. data/app/lib/actions/katello/system/reassign.rb +0 -14
  361. data/app/models/katello/authorization/system.rb +0 -53
  362. data/app/models/katello/glue/candlepin/consumer.rb +0 -386
  363. data/app/models/katello/glue/pulp/consumer.rb +0 -171
  364. data/app/models/katello/hypervisor.rb +0 -15
  365. data/app/models/katello/system.rb +0 -283
  366. data/app/models/katello/system_activation_key.rb +0 -8
  367. data/app/models/katello/system_repository.rb +0 -8
  368. data/app/presenters/katello/activation_key_subscription_presenter.rb +0 -10
  369. data/app/views/katello/api/v2/errata/_applicable_errata.json.rabl +0 -3
  370. data/app/views/katello/api/v2/subscriptions/create.json.rabl +0 -3
  371. data/app/views/katello/api/v2/systems/_pool.json.rabl +0 -6
  372. data/app/views/katello/api/v2/systems/activate.json.rabl +0 -3
  373. data/app/views/katello/api/v2/systems/add_host_collections.json.rabl +0 -3
  374. data/app/views/katello/api/v2/systems/available_host_collections.json.rabl +0 -5
  375. data/app/views/katello/api/v2/systems/base.json.rabl +0 -35
  376. data/app/views/katello/api/v2/systems/enabled_repos.json.rabl +0 -3
  377. data/app/views/katello/api/v2/systems/events.json.rabl +0 -3
  378. data/app/views/katello/api/v2/systems/package.json.rabl +0 -5
  379. data/app/views/katello/api/v2/systems/package_profile.json.rabl +0 -7
  380. data/app/views/katello/api/v2/systems/pools.json.rabl +0 -7
  381. data/app/views/katello/api/v2/systems/regenerate_identity_certificates.json.rabl +0 -3
  382. data/app/views/katello/api/v2/systems/remove_host_collections.json.rabl +0 -3
  383. data/app/views/katello/api/v2/systems/show.json.rabl +0 -64
  384. data/app/views/katello/api/v2/systems/subscriptions.json.rabl +0 -8
  385. data/app/views/katello/api/v2/systems/upload_package_profile.json.rabl +0 -3
  386. data/db/seeds.d/105-roles_permissions.rb +0 -71
  387. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host.factory.js +0 -25
  388. data/lib/katello/permissions/content_host_permissions.rb +0 -30
  389. data/lib/katello/tasks/yard.rake +0 -9
  390. data/vendor/assets/stylesheets/katello/jquery.jscrollpane.css +0 -120
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 35fea87feca745a663c99cfee8c423caa5fbea9f
4
- data.tar.gz: 35ead4a4f11f53b7074e49df15d07870c5b409ee
3
+ metadata.gz: 996910969d6d4ff148a675b6b33a47798743ba85
4
+ data.tar.gz: 51a18935709cc696fe29b52ad02acbf2478f530e
5
5
  SHA512:
6
- metadata.gz: 91d46c94fbf1850d9815a988286be141c062bec7b04b99694b77fc9b506b477950193ce336870d78c36c32c3e45e86262ec21349bc0552ef13a4576a16618025
7
- data.tar.gz: f02a8e8f1bd40272f0ec90ae03bebf6e1cec45a3170af7a45311ab8af4d0581ad4741d46820634afababdc8d9705544147458e34419916d4f4bc81bc1c7f4359
6
+ metadata.gz: 99084c79da2747ace8491c61e5878abc7b157bd1091df4b68808f905e44eabd9faa0b8ba10c04bcf2263f8f5e158fa4f6b9f37c21d5e8c15ae3524d0eae96615
7
+ data.tar.gz: 4dad440d277ac638c6ef7809c8f981c1528a9eed57695bc1751cffd54dbcea8f00a0ec79dd3c84371d00f7113519a7444e4566b95b43506da19d490c35fe056d
data/README.md CHANGED
@@ -1,6 +1,10 @@
1
- # Katello [![Dependency Status](https://gemnasium.com/Katello/katello.svg)](https://gemnasium.com/Katello/katello)
1
+ # Katello
2
2
 
3
- Full documentation is at http://katello.github.io/katello
3
+ [![Build Status](http://ci.theforeman.org/buildStatus/icon?job=test_katello)](http://ci.theforeman.org/job/test_katello)
4
+ [![Code Climate](https://codeclimate.com/github/Katello/katello/badges/gpa.svg)](https://codeclimate.com/github/Katello/katello)
5
+ [![Dependency Status](https://gemnasium.com/Katello/katello.svg)](https://gemnasium.com/Katello/katello)
6
+
7
+ Full documentation is at http://www.katello.org
4
8
 
5
9
  ## About
6
10
 
@@ -66,54 +70,11 @@ See the [developer documentation](http://www.katello.org/developers/index.html).
66
70
  ## Contact & Resources
67
71
 
68
72
  * [Katello.org](http://katello.org)
69
- * [Wiki](https://fedorahosted.org/katello/wiki)
70
73
  * [Foreman User Mailing List](https://groups.google.com/forum/?fromgroups#!forum/foreman-users)
71
74
  * [Foreman Developer mailing list](https://groups.google.com/forum/?fromgroups#!forum/foreman-dev)
72
75
  * [IRC Freenode](http://freenode.net/using_the_network.shtml): #theforeman-dev
73
- * [Twitter](https://twitter.com/Katello_Project)
74
76
 
75
77
  ## Documentation
76
78
 
77
- Documentation is generated with [YARD](http://yardoc.org/) and hosted at <http://katello.github.io/katello/>.
78
- This documentation is intended for developers, user documentation can be found on
79
- [wiki](https://fedorahosted.org/katello/). Developer documentation contains:
80
-
81
- - code documentation
82
- - high level guides to architectures and implementation details
83
- - how-tos
84
-
85
- *Note: older developer guides can be found on our wiki, they are being migrated.*
86
-
87
- ### How to
88
-
89
- - to see YARD documentation start Katello server and find the link on "About" page or go directly to
90
- <http://path.to.katello/url_prefix/yard/docs/katello/frames>
91
-
92
- - if it fails run `bundle exec yard doc --no-cache` first, which will rebuild whole documentation
93
-
94
- - see {file:doc/YARDDocumentation.md}
95
-
96
- ## Current documentation
97
-
98
- - {file:doc/YARDDocumentation.md}
99
- - {file:doc/Graphs.md}
100
-
101
- ### Debugging
102
-
103
- - {file:doc/how_to/add_praise.md Enabling Praise} - raise/exception investigation
104
-
105
- ### Packaging
106
-
107
- - {file:doc/how_to/package_new_gem.md How to package new gem}
108
-
109
- ### Other
110
-
111
- - {file:doc/katellodb.html DB schema documentation}
112
- - Original Rails generated README {file:doc/RailsReadme}, we may do certain things differently
113
-
114
- - we use `doc` directory for storing markdown guides instead of a generated documentation
115
-
116
- ### Source
117
-
118
- - {Katello::Configuration}
119
- - {Notifications}
79
+ Most of our documentation (both for users and developers) can be found at
80
+ [Katello.org](http://www.katello.org).
@@ -3,5 +3,4 @@
3
3
  //= require "katello/common/katello"
4
4
  //= require "katello/common/menu"
5
5
  //= require "katello/common/spin.min"
6
- //= require "katello/common/jquery.jeditable.custominputs"
7
6
  //= require "katello/common/katello_object"
@@ -1,4 +1,3 @@
1
1
  //= require "katello/jquery.treeTable"
2
- //= require "katello/widgets/jquery.jeditable.helpers"
3
2
  //= require "katello/widgets/tabs"
4
3
  //= require "katello/providers/provider_redhat"
@@ -68,8 +68,6 @@ $global_permission_color: #f6891f;
68
68
 
69
69
  $path-border_color: #d3d3d3;
70
70
 
71
- $jScrollPane-bar_color: #8B8B9F;
72
-
73
71
  $border_color: #d7d7d7;
74
72
  $table-border_color: $border_color;
75
73
 
@@ -4,14 +4,12 @@
4
4
 
5
5
  @import "katello/fancyqueries";
6
6
  @import "katello/widgets/chosen";
7
- @import "katello/widgets/scrollpane";
8
7
  @import "katello/widgets/tabs";
9
8
  @import "katello/katello_sprites";
10
9
 
11
10
  @import "katello/jquery.loadmask";
12
11
  @import "katello/jquery-ui-1.8.11.custom";
13
12
  @import "katello/jquery.treeTable";
14
- @import "katello/jquery.jscrollpane";
15
13
  @import "katello/ui.spinner";
16
14
 
17
15
  @import "katello/contents";
@@ -2,26 +2,26 @@ module Katello
2
2
  class Api::Rhsm::CandlepinProxiesController < Api::V2::ApiController
3
3
  include Katello::Authentication::ClientAuthentication
4
4
 
5
- before_filter :disable_strong_params
5
+ before_action :disable_strong_params
6
6
 
7
7
  wrap_parameters false
8
8
 
9
- around_filter :repackage_message
10
- before_filter :find_host, :only => [:consumer_show, :consumer_destroy, :consumer_checkin, :enabled_repos,
9
+ around_action :repackage_message
10
+ before_action :find_host, :only => [:consumer_show, :consumer_destroy, :consumer_checkin, :enabled_repos,
11
11
  :upload_package_profile, :regenerate_identity_certificates, :facts,
12
12
  :available_releases, :serials]
13
- before_filter :authorize, :only => [:consumer_create, :list_owners, :rhsm_index]
14
- before_filter :authorize_client_or_user, :only => [:consumer_show, :upload_package_profile, :regenerate_identity_certificates]
15
- before_filter :authorize_client_or_admin, :only => [:hypervisors_update]
16
- before_filter :authorize_proxy_routes, :only => [:get, :post, :put, :delete]
17
- before_filter :authorize_client, :only => [:consumer_destroy, :consumer_checkin,
13
+ before_action :authorize, :only => [:consumer_create, :list_owners, :rhsm_index]
14
+ before_action :authorize_client_or_user, :only => [:consumer_show, :upload_package_profile, :regenerate_identity_certificates]
15
+ before_action :authorize_client_or_admin, :only => [:hypervisors_update]
16
+ before_action :authorize_proxy_routes, :only => [:get, :post, :put, :delete]
17
+ before_action :authorize_client, :only => [:consumer_destroy, :consumer_checkin,
18
18
  :enabled_repos, :facts, :available_releases]
19
19
 
20
- before_filter :add_candlepin_version_header
20
+ before_action :add_candlepin_version_header
21
21
 
22
- before_filter :proxy_request_path, :proxy_request_body
23
- before_filter :set_organization_id, :except => :hypervisors_update
24
- before_filter :find_hypervisor_environment_and_content_view, :only => [:hypervisors_update]
22
+ before_action :proxy_request_path, :proxy_request_body
23
+ before_action :set_organization_id, :except => :hypervisors_update
24
+ before_action :find_hypervisor_organization, :only => [:hypervisors_update]
25
25
 
26
26
  def repackage_message
27
27
  yield
@@ -113,8 +113,9 @@ module Katello
113
113
  def hypervisors_update
114
114
  login = User.consumer? ? User.anonymous_api_admin.login : User.current.login
115
115
  task = User.as(login) do
116
- sync_task(::Actions::Katello::Host::Hypervisors, @environment, @content_view,
117
- params.except(:controller, :action, :format))
116
+ params['owner'] = @organization.label #override owner label if
117
+ params['env'] = nil #hypervisors don't need an environment
118
+ sync_task(::Actions::Katello::Host::Hypervisors, params.except(:controller, :action, :format))
118
119
  end
119
120
  render :json => task.output[:results]
120
121
  end
@@ -182,7 +183,6 @@ module Katello
182
183
 
183
184
  result = nil
184
185
  User.as_anonymous_admin do
185
- @host.content_host.save_bound_repos_by_path!(paths.compact)
186
186
  result = @host.content_facet.update_repositories_by_paths(paths.compact)
187
187
  end
188
188
 
@@ -195,9 +195,11 @@ module Katello
195
195
  host = Katello::Host::SubscriptionFacet.find_or_create_host(params[:facts]['network.hostname'],
196
196
  content_view_environment.environment.organization, rhsm_params)
197
197
 
198
- sync_task(::Actions::Katello::Host::Register, host, System.new, rhsm_params, content_view_environment)
198
+ sync_task(::Actions::Katello::Host::Register, host, rhsm_params, content_view_environment)
199
199
  host.reload
200
200
 
201
+ update_host_registered_through(host, request.headers)
202
+
201
203
  render :json => Resources::Candlepin::Consumer.get(host.subscription_facet.uuid)
202
204
  end
203
205
 
@@ -205,7 +207,11 @@ module Katello
205
207
  #param :id, String, :desc => N_("UUID of the consumer"), :required => true
206
208
  def consumer_destroy
207
209
  User.as_anonymous_admin do
208
- sync_task(::Actions::Katello::Host::Unregister, @host)
210
+ if Setting['unregister_delete_host']
211
+ sync_task(::Actions::Katello::Host::Destroy, @host)
212
+ else
213
+ sync_task(::Actions::Katello::Host::Unregister, @host)
214
+ end
209
215
  end
210
216
  render :text => _("Deleted consumer '%s'") % params[:id], :status => 204
211
217
  end
@@ -221,7 +227,9 @@ module Katello
221
227
  host = Katello::Host::SubscriptionFacet.find_or_create_host(params[:facts]['network.hostname'],
222
228
  activation_keys.first.organization, rhsm_params)
223
229
 
224
- sync_task(::Actions::Katello::Host::Register, host, System.new, rhsm_params, nil, activation_keys)
230
+ sync_task(::Actions::Katello::Host::Register, host, rhsm_params, nil, activation_keys)
231
+
232
+ update_host_registered_through(host, request.headers)
225
233
  host.reload
226
234
 
227
235
  render :json => Resources::Candlepin::Consumer.get(host.subscription_facet.uuid)
@@ -243,8 +251,9 @@ module Katello
243
251
 
244
252
  def facts
245
253
  User.as_anonymous_admin do
246
- sync_task(::Actions::Katello::Host::Update, @host, rhsm_params)
254
+ sync_task(::Actions::Katello::Host::Update, @host, rhsm_params.except(:facts))
247
255
  Katello::Host::SubscriptionFacet.update_facts(@host, rhsm_params[:facts]) unless rhsm_params[:facts].nil?
256
+ update_host_registered_through(@host, request.headers)
248
257
  end
249
258
  render :json => {:content => _("Facts successfully updated.")}, :status => 200
250
259
  end
@@ -255,6 +264,12 @@ module Katello
255
264
  render :json => Katello::Resources::Candlepin::Consumer.serials(@host.subscription_facet.uuid)
256
265
  end
257
266
 
267
+ def get_parent_host(headers)
268
+ hostnames = headers["HTTP_X_FORWARDED_SERVER"]
269
+ host = hostnames.split(",")[0] if hostnames
270
+ host || Facter.value(:fqdn) || SETTINGS[:fqdn]
271
+ end
272
+
258
273
  private
259
274
 
260
275
  def disable_strong_params
@@ -297,31 +312,14 @@ module Katello
297
312
  environment
298
313
  end
299
314
 
300
- # Hypervisors are restricted to the content host's environment and content view
301
- def find_hypervisor_environment_and_content_view
315
+ def find_hypervisor_organization
302
316
  if User.consumer?
303
- @host = find_host(User.current.uuid)
304
- @organization = @host.content_facet.content_view.organization
305
- @environment = @host.content_facet.lifecycle_environment
306
- @content_view = @host.content_facet.content_view
307
- params[:owner] = @organization.label
308
- params[:env] = @content_view.cp_environment_label(@environment)
309
- else
317
+ host = find_host(User.current.uuid)
318
+ @organization = host.organization
319
+ elsif params[:owner]
310
320
  @organization = Organization.find_by(:label => params[:owner])
311
- deny_access unless @organization
312
- if params[:env] == 'Library'
313
- @environment = @organization.library
314
- deny_access unless @environment && @environment.readable?
315
- @content_view = @environment.default_content_view
316
- deny_access unless @content_view && @content_view.readable?
317
- else
318
- (env_name, cv_name) = params[:env].split('/')
319
- @environment = @organization.kt_environments.find_by(:label => env_name)
320
- deny_access unless @environment && @environment.readable?
321
- @content_view = @environment.content_views.find_by(:label => cv_name)
322
- deny_access unless @content_view && @content_view.readable?
323
- end
324
321
  end
322
+ deny_access unless @organization
325
323
  end
326
324
 
327
325
  def find_organization
@@ -347,7 +345,7 @@ module Katello
347
345
  def find_activation_keys
348
346
  organization = find_organization
349
347
 
350
- if ak_names = params[:activation_keys]
348
+ if (ak_names = params[:activation_keys])
351
349
  ak_names = ak_names.split(",")
352
350
  activation_keys = ak_names.map do |ak_name|
353
351
  activation_key = organization.activation_keys.find_by(:name => ak_name)
@@ -432,6 +430,11 @@ module Katello
432
430
  authorized
433
431
  end
434
432
 
433
+ def update_host_registered_through(host, headers)
434
+ parent_host = get_parent_host(headers)
435
+ host.subscription_facet.update_attribute(:registered_through, parent_host)
436
+ end
437
+
435
438
  # rubocop:disable MethodLength
436
439
  def authorize_proxy_routes
437
440
  deny_access unless (authenticate || authenticate_client)
@@ -2,15 +2,15 @@ module Katello
2
2
  class Api::V2::ActivationKeysController < Api::V2::ApiController
3
3
  include Katello::Concerns::FilteredAutoCompleteSearch
4
4
 
5
- before_filter :verify_presence_of_organization_or_environment, :only => [:index]
6
- before_filter :find_environment, :only => [:index, :create, :update]
7
- before_filter :find_optional_organization, :only => [:index, :create, :show]
8
- before_filter :find_content_view, :only => [:index]
9
- before_filter :find_activation_key, :only => [:show, :update, :destroy, :available_releases, :copy, :product_content,
5
+ before_action :verify_presence_of_organization_or_environment, :only => [:index]
6
+ before_action :find_environment, :only => [:index, :create, :update]
7
+ before_action :find_optional_organization, :only => [:index, :create, :show]
8
+ before_action :find_content_view, :only => [:index]
9
+ before_action :find_activation_key, :only => [:show, :update, :destroy, :available_releases, :copy, :product_content,
10
10
  :available_host_collections, :add_host_collections, :remove_host_collections,
11
11
  :content_override, :add_subscriptions, :remove_subscriptions,
12
12
  :subscriptions]
13
- before_filter :authorize
13
+ before_action :authorize
14
14
 
15
15
  wrap_parameters :include => (ActivationKey.attribute_names + %w(host_collection_ids service_level auto_attach content_view_environment))
16
16
 
@@ -103,7 +103,7 @@ module Katello
103
103
  respond_for_show(:resource => @new_activation_key)
104
104
  end
105
105
 
106
- api :GET, "/activation_keys/:id/host_collections/available", N_("List host collections the system does not belong to")
106
+ api :GET, "/activation_keys/:id/host_collections/available", N_("List host collections the activation key does not belong to")
107
107
  param_group :search, Api::V2::ApiController
108
108
  param :name, String, :desc => N_("host collection name to filter by")
109
109
  def available_host_collections
@@ -216,18 +216,6 @@ module Katello
216
216
  activation_keys
217
217
  end
218
218
 
219
- api :GET, "/activation_keys/:id/subscriptions", N_("List an activation key's subscriptions")
220
- param :activation_key_id, String, :desc => N_("Activation key ID"), :required => true
221
- def subscriptions
222
- subscriptions = @activation_key.get_key_pools.map { |sub| ActivationKeySubscriptionPresenter.new(sub) }
223
- collection = subscriptions.map(&:subscription)
224
- @collection = { :results => collection,
225
- :total => collection.count,
226
- :page => 1,
227
- :per_page => collection.count,
228
- :subtotal => collection.count }
229
- end
230
-
231
219
  def find_activation_key
232
220
  @activation_key = ActivationKey.find(params[:id])
233
221
  fail HttpErrors::NotFound, _("Couldn't find activation key '%s'") % params[:id] if @activation_key.nil?
@@ -8,7 +8,7 @@ module Katello
8
8
  # support for session (thread-local) variables must be the last filter in this class
9
9
  include Foreman::ThreadSession::Cleaner
10
10
 
11
- skip_before_filter :setup_has_many_params # TODO: get this working #8862
11
+ skip_before_action :setup_has_many_params # TODO: get this working #8862
12
12
 
13
13
  resource_description do
14
14
  api_version 'v2'
@@ -20,7 +20,7 @@ module Katello
20
20
  param :page, :number, :desc => N_("Page number, starting at 1")
21
21
  param :per_page, :number, :desc => N_("Number of results per page to return")
22
22
  param :order, String, :desc => N_("Sort field and order, eg. 'name DESC'")
23
- param :full_results, :bool, :desc => N_("Whether or not to show all results")
23
+ param :full_result, :bool, :desc => N_("Whether or not to show all results")
24
24
  param :sort, Hash, :desc => N_("Hash version of 'order' param") do
25
25
  param :by, String, :desc => N_("Field to sort the results on")
26
26
  param :order, String, :desc => N_("How to order the sorted results (e.g. ASC for ascending)")
@@ -68,7 +68,7 @@ module Katello
68
68
  query = query.order("#{query.table_name}.id DESC") unless group #secondary order to ensure sort is deterministic
69
69
  query = query.includes(includes) if includes.length > 0
70
70
 
71
- if params[:full_result]
71
+ if ::Foreman::Cast.to_bool(params[:full_result])
72
72
  params[:per_page] = total
73
73
  else
74
74
  query = query.paginate(paginate_options)
@@ -4,9 +4,9 @@ module Katello
4
4
  api_base_url "/katello/api"
5
5
  end
6
6
 
7
- before_filter :find_capsule
8
- before_filter :find_environment, :only => [:add_lifecycle_environment, :remove_lifecycle_environment]
9
- before_filter :find_optional_organization, :only => [:sync_status]
7
+ before_action :find_capsule
8
+ before_action :find_environment, :only => [:add_lifecycle_environment, :remove_lifecycle_environment]
9
+ before_action :find_optional_organization, :only => [:sync_status]
10
10
 
11
11
  def_param_group :lifecycle_environments do
12
12
  param :id, Integer, :desc => N_('Id of the capsule'), :required => true
@@ -1,7 +1,7 @@
1
1
  module Katello
2
2
  class Api::V2::ContentUploadsController < Api::V2::ApiController
3
- before_filter :find_repository
4
- skip_before_filter :check_content_type, :only => [:update]
3
+ before_action :find_repository
4
+ skip_before_action :check_content_type, :only => [:update]
5
5
 
6
6
  include ::Foreman::Controller::FilterParameters
7
7
  filter_parameters :content
@@ -1,7 +1,7 @@
1
1
  module Katello
2
2
  class Api::V2::ContentViewFilterRulesController < Api::V2::ApiController
3
- before_filter :find_filter
4
- before_filter :find_rule, :except => [:index, :create]
3
+ before_action :find_filter
4
+ before_action :find_rule, :except => [:index, :create]
5
5
 
6
6
  api :GET, "/content_view_filters/:content_view_filter_id/rules", N_("List filter rules")
7
7
  param :content_view_filter_id, :identifier, :desc => N_("filter identifier"), :required => true
@@ -19,7 +19,7 @@ module Katello
19
19
  api :POST, "/content_view_filters/:content_view_filter_id/rules",
20
20
  N_("Create a filter rule. The parameters included should be based upon the filter type.")
21
21
  param :content_view_filter_id, :identifier, :desc => N_("filter identifier"), :required => true
22
- param :name, String, :desc => N_("package or package group: name")
22
+ param :name, [String, Array], :desc => N_("package and package group names")
23
23
  param :version, String, :desc => N_("package: version")
24
24
  param :min_version, String, :desc => N_("package: minimum version")
25
25
  param :max_version, String, :desc => N_("package: maximum version")
@@ -32,19 +32,23 @@ module Katello
32
32
  def create
33
33
  rule_clazz = ContentViewFilter.rule_class_for(@filter)
34
34
 
35
- if rule_params.key?(:errata_ids)
36
- rules = []
37
- rule_params[:errata_ids].each do |errata_id|
38
- rules << rule_clazz.create!({:errata_id => errata_id}.merge(:filter => @filter))
39
- end
40
- else
41
- rule = rule_clazz.create!(rule_params.merge(:filter => @filter))
35
+ rules = (rule_params[:name] || []).map do |name|
36
+ rule_clazz.create!(rule_params.except(:name).merge(:filter => @filter, name: name))
37
+ end
38
+
39
+ rules += (rule_params[:errata_ids] || []).map do |errata_id|
40
+ rule_clazz.create!(rule_params.except(:errata_ids)
41
+ .merge(filter: @filter, errata_id: errata_id))
42
42
  end
43
43
 
44
- if rules && rule.nil?
44
+ if rules.empty?
45
+ rules = [rule_clazz.create!(rule_params.merge(:filter => @filter))]
46
+ end
47
+
48
+ if rules.many?
45
49
  respond_for_index(:collection => {:results => rules}, :template => 'index')
46
50
  else
47
- respond :resource => rule
51
+ respond resource: rules.first
48
52
  end
49
53
  end
50
54
 
@@ -69,6 +73,7 @@ module Katello
69
73
  param :types, Array, :desc => N_("erratum: types (enhancement, bugfix, security)")
70
74
  def update
71
75
  update_params = rule_params
76
+ update_params[:name] = update_params[:name].first if update_params[:name]
72
77
 
73
78
  if @rule.filter.content_type == ContentViewPackageFilter::CONTENT_TYPE
74
79
  update_params[:version] = "" unless rule_params[:version]
@@ -100,15 +105,21 @@ module Katello
100
105
  end
101
106
 
102
107
  def rule_params
103
- if params[:content_view_filter_rule][:errata_ids].is_a?(Hash)
104
- ids = process_errata_ids(params[:content_view_filter_rule][:errata_ids])
105
- params[:content_view_filter_rule][:errata_ids] = ids
108
+ unless @rule_params
109
+ if params[:content_view_filter_rule][:errata_ids].is_a?(Hash)
110
+ ids = process_errata_ids(params[:content_view_filter_rule][:errata_ids])
111
+ params[:content_view_filter_rule][:errata_ids] = ids
112
+ end
113
+
114
+ if params[:name]
115
+ params[:content_view_filter_rule][:name] = params[:name] = [params[:name]].flatten
116
+ end
106
117
  end
107
118
 
108
- params.fetch(:content_view_filter_rule, {}).
109
- permit(:uuid, :name, :version, :min_version, :max_version,
119
+ @rule_params ||= params.fetch(:content_view_filter_rule, {}).
120
+ permit(:uuid, :version, :min_version, :max_version,
110
121
  :errata_id, :start_date, :end_date, :date_type,
111
- :types => [], :errata_ids => [])
122
+ :types => [], :errata_ids => [], name: [])
112
123
  end
113
124
 
114
125
  def process_errata_ids(select_all_params)