katello 3.5.0.rc1 → 3.5.0.rc2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of katello might be problematic. Click here for more details.

Files changed (218) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/katello/containers/container.js +6 -6
  3. data/app/assets/javascripts/katello/hosts/host_and_hostgroup_edit.js +2 -1
  4. data/app/assets/javascripts/katello/sync_management/sync_management.js +8 -6
  5. data/app/controllers/katello/api/v2/activation_keys_controller.rb +23 -16
  6. data/app/controllers/katello/api/v2/api_controller.rb +7 -2
  7. data/app/controllers/katello/api/v2/capsule_content_controller.rb +10 -2
  8. data/app/controllers/katello/api/v2/content_uploads_controller.rb +5 -5
  9. data/app/controllers/katello/api/v2/content_view_components_controller.rb +9 -9
  10. data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +14 -16
  11. data/app/controllers/katello/api/v2/content_view_filters_controller.rb +8 -8
  12. data/app/controllers/katello/api/v2/content_view_puppet_modules_controller.rb +7 -7
  13. data/app/controllers/katello/api/v2/content_view_versions_controller.rb +12 -12
  14. data/app/controllers/katello/api/v2/content_views_controller.rb +5 -5
  15. data/app/controllers/katello/api/v2/errata_controller.rb +2 -2
  16. data/app/controllers/katello/api/v2/gpg_keys_controller.rb +2 -2
  17. data/app/controllers/katello/api/v2/host_collections_controller.rb +7 -7
  18. data/app/controllers/katello/api/v2/host_errata_controller.rb +4 -4
  19. data/app/controllers/katello/api/v2/host_packages_controller.rb +5 -5
  20. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +9 -4
  21. data/app/controllers/katello/api/v2/host_tracer_controller.rb +1 -1
  22. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +9 -1
  23. data/app/controllers/katello/api/v2/organizations_controller.rb +17 -3
  24. data/app/controllers/katello/api/v2/packages_controller.rb +2 -2
  25. data/app/controllers/katello/api/v2/products_controller.rb +3 -3
  26. data/app/controllers/katello/api/v2/repositories_controller.rb +11 -11
  27. data/app/controllers/katello/api/v2/repository_sets_controller.rb +1 -10
  28. data/app/controllers/katello/concerns/api/v2/hosts_controller_extensions.rb +1 -1
  29. data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +3 -3
  30. data/app/helpers/katello/providers_helper.rb +4 -1
  31. data/app/lib/actions/candlepin/abstract.rb +1 -0
  32. data/app/lib/actions/katello/host/hypervisors_update.rb +1 -0
  33. data/app/lib/actions/katello/host/update_release_version.rb +29 -0
  34. data/app/lib/actions/katello/product/create.rb +3 -6
  35. data/app/lib/actions/katello/product/reindex_subscriptions.rb +1 -1
  36. data/app/lib/actions/katello/repository/scheduled_sync.rb +15 -0
  37. data/app/lib/actions/katello/repository/upload_files.rb +4 -0
  38. data/app/lib/actions/middleware/keep_session_id.rb +29 -0
  39. data/app/lib/katello/resources/candlepin.rb +22 -5
  40. data/app/lib/katello/validators/hostgroup_kickstart_repository_validator.rb +30 -0
  41. data/app/models/katello/activation_key.rb +3 -33
  42. data/app/models/katello/candlepin/product_content.rb +1 -14
  43. data/app/models/katello/concerns/content_facet_host_extensions.rb +5 -1
  44. data/app/models/katello/concerns/content_view_filter_rule_common.rb +13 -0
  45. data/app/models/katello/concerns/hostgroup_extensions.rb +1 -0
  46. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +2 -1
  47. data/app/models/katello/content_view_docker_filter_rule.rb +2 -1
  48. data/app/models/katello/content_view_erratum_filter_rule.rb +2 -1
  49. data/app/models/katello/content_view_package_filter_rule.rb +2 -1
  50. data/app/models/katello/content_view_package_group_filter_rule.rb +2 -1
  51. data/app/models/katello/erratum.rb +4 -5
  52. data/app/models/katello/glue/candlepin/owner.rb +32 -0
  53. data/app/models/katello/glue/pulp/repos.rb +1 -1
  54. data/app/models/katello/host/subscription_facet.rb +16 -0
  55. data/app/models/katello/repository.rb +2 -2
  56. data/app/models/katello/subscription.rb +4 -1
  57. data/app/models/katello/subscription_status.rb +8 -4
  58. data/app/presenters/katello/product_content_presenter.rb +7 -2
  59. data/app/services/katello/candlepin/consumer.rb +0 -28
  60. data/app/services/katello/product_content_finder.rb +37 -0
  61. data/app/views/foreman/smart_proxies/_content_sync.html.erb +0 -2
  62. data/app/views/katello/api/v2/activation_keys/base.json.rabl +34 -0
  63. data/app/views/katello/api/v2/activation_keys/index.json.rabl +4 -1
  64. data/app/views/katello/api/v2/activation_keys/product_content.json.rabl +3 -3
  65. data/app/views/katello/api/v2/activation_keys/show.json.rabl +2 -38
  66. data/app/views/katello/api/v2/common/releases.json.rabl +7 -0
  67. data/config/routes/api/v2.rb +1 -0
  68. data/config/routes/overrides.rb +1 -0
  69. data/db/migrate/20171010170443_add_index_to_katello_content_facet_errata.rb +5 -0
  70. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/activation-key.factory.js +1 -1
  71. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-add-host-collections.controller.js +8 -8
  72. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-add-subscriptions.controller.js +5 -4
  73. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-copy.controller.js +3 -6
  74. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-details.controller.js +7 -10
  75. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-host-collections.controller.js +7 -6
  76. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-repository-sets.controller.js +5 -5
  77. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-subscriptions.controller.js +5 -4
  78. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-host-collections-table.html +1 -3
  79. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.controller.js +7 -5
  80. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.factory.js +1 -1
  81. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsules/capsule.factory.js +1 -1
  82. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/api-error-handler.service.js +6 -16
  83. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-environment-modal.controller.js +4 -4
  84. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +5 -5
  85. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-host-collections-modal.controller.js +5 -5
  86. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-packages-modal.controller.js +5 -5
  87. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-release-version-modal.controller.js +62 -0
  88. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-repository-sets-modal.controller.js +4 -4
  89. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-subscriptions-modal.controller.js +4 -4
  90. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-release-version-modal.html +56 -0
  91. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-subscriptions-modal.html +1 -1
  92. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-modal-helper.service.js +11 -0
  93. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +10 -9
  94. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages.controller.js +6 -4
  95. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-traces.controller.js +0 -2
  96. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-add-host-collections.controller.js +3 -6
  97. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-add-subscriptions.controller.js +5 -4
  98. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-base-subscriptions.controller.js +5 -4
  99. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details-info.controller.js +0 -3
  100. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +8 -9
  101. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-host-collections.controller.js +10 -8
  102. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-repository-sets.controller.js +5 -5
  103. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-subscriptions.controller.js +5 -4
  104. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-repository-sets.html +0 -2
  105. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +6 -0
  106. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-view.factory.js +1 -1
  107. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-deletion.controller.js +3 -3
  108. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-version-deletion-confirm.controller.js +5 -5
  109. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/content-view-component.factory.js +3 -3
  110. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +6 -6
  111. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-promotion.controller.js +5 -5
  112. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-publish.controller.js +3 -3
  113. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-versions.controller.js +6 -6
  114. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/available-errata-filter.controller.js +5 -5
  115. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/available-package-group-filter.controller.js +5 -5
  116. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/date-type-errata-filter.controller.js +11 -5
  117. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/docker-tag-filter.controller.js +6 -6
  118. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js +4 -4
  119. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/errata-filter-list.controller.js +5 -5
  120. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-repositories.controller.js +6 -6
  121. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter.factory.js +1 -1
  122. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filters.controller.js +4 -4
  123. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/new-filter.controller.js +3 -3
  124. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/package-filter.controller.js +6 -6
  125. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/package-group-list-filter.controller.js +5 -5
  126. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/rule.factory.js +1 -1
  127. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/content-view-history.factory.js +1 -1
  128. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-module-versions.controller.js +5 -5
  129. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-module.factory.js +1 -1
  130. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-modules.controller.js +5 -5
  131. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version.factory.js +1 -1
  132. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-manifests/docker-manifest.factory.js +1 -1
  133. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/docker-tag-details.controller.js +0 -3
  134. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/views/docker-tag-details.html +0 -2
  135. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/docker-tags.factory.js +1 -1
  136. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/environment.controller.js +5 -7
  137. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environment.factory.js +1 -1
  138. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/new-environment.controller.js +3 -6
  139. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/views/new-environment.html +0 -2
  140. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/apply-errata.controller.js +9 -4
  141. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/erratum-content-hosts.controller.js +0 -3
  142. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/erratum.factory.js +1 -1
  143. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/views/apply-errata-confirm.html +0 -2
  144. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/files/details/file.controller.js +0 -3
  145. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/files/file.factory.js +1 -1
  146. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details-info.controller.js +6 -5
  147. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js +4 -6
  148. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/gpg-key.factory.js +1 -1
  149. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/new/new-gpg-key.controller.js +6 -9
  150. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-add-hosts.controller.js +3 -3
  151. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-copy.controller.js +3 -6
  152. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-details.controller.js +13 -22
  153. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-hosts.controller.js +6 -5
  154. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +3 -3
  155. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/host-collection.factory.js +1 -1
  156. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-bulk-action.factory.js +2 -1
  157. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-erratum.factory.js +1 -1
  158. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-package.factory.js +1 -1
  159. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-subscription.factory.js +1 -1
  160. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-traces.factory.js +1 -1
  161. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js +1 -1
  162. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/organization.factory.js +7 -5
  163. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branch.factory.js +1 -1
  164. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/package-groups/package-group.factory.js +1 -1
  165. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/package.factory.js +1 -1
  166. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/product-bulk-action.factory.js +1 -1
  167. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/products-bulk-advanced-sync-modal.controller.js +5 -5
  168. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/products-bulk-sync-plan-modal.controller.js +6 -6
  169. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-details-info.controller.js +5 -8
  170. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-details.controller.js +6 -6
  171. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-repositories.controller.js +15 -14
  172. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-advanced-sync.controller.js +6 -3
  173. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +9 -9
  174. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-manage-content.controller.js +5 -4
  175. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details.controller.js +7 -7
  176. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-advanced-sync.html +0 -2
  177. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +0 -2
  178. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-docker-manifests.html +0 -2
  179. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-files.html +0 -2
  180. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-ostree-branches.html +0 -2
  181. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-packages.html +0 -2
  182. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-puppet-modules.html +0 -2
  183. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +5 -8
  184. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +0 -2
  185. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository.factory.js +2 -2
  186. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +0 -20
  187. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/views/product-info.html +0 -1
  188. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/discovery-create.controller.js +4 -6
  189. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/discovery.controller.js +5 -8
  190. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/views/discovery-base.html +0 -2
  191. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/new/product-form.controller.js +3 -3
  192. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/product.factory.js +1 -1
  193. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.controller.js +7 -7
  194. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/details/puppet-module.controller.js +0 -3
  195. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/puppet-module.factory.js +1 -1
  196. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/repository-set.factory.js +1 -1
  197. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/settings/setting.factory.js +1 -1
  198. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-details.controller.js +0 -3
  199. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-details.html +0 -2
  200. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-import.controller.js +9 -9
  201. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-import.html +0 -2
  202. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptions.factory.js +4 -4
  203. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-add-products.controller.js +6 -8
  204. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-details-info.controller.js +5 -6
  205. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-details.controller.js +5 -5
  206. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-products.controller.js +8 -8
  207. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-info.html +0 -2
  208. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-products.html +0 -2
  209. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/new/new-sync-plan.controller.js +4 -4
  210. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/sync-plan.factory.js +1 -1
  211. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task.factory.js +2 -2
  212. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/tasks.module.js +3 -3
  213. data/lib/katello/permission_creator.rb +3 -2
  214. data/lib/katello/permissions/host_permissions.rb +1 -0
  215. data/lib/katello/permissions/organization_permissions.rb +1 -0
  216. data/lib/katello/tasks/clean_installed_packages.rake +20 -3
  217. data/lib/katello/version.rb +1 -1
  218. metadata +17 -6
@@ -25,12 +25,12 @@ module Katello
25
25
  api :GET, "/sync_plans/:sync_plan_id/products", N_("List of Products for sync plan")
26
26
  api :GET, "/organizations/:organization_id/sync_plans/:sync_plan_id/products", N_("List of Products for sync plan")
27
27
  param :organization_id, :number, :desc => N_("Filter products by organization"), :required => true
28
- param :subscription_id, :identifier, :desc => N_("Filter products by subscription")
28
+ param :subscription_id, :number, :desc => N_("Filter products by subscription")
29
29
  param :name, String, :desc => N_("Filter products by name")
30
30
  param :enabled, :bool, :desc => N_("Filter products by enabled or disabled")
31
31
  param :custom, :bool, :desc => N_("Filter products by custom")
32
32
  param :include_available_content, :bool, :desc => N_("Whether to include available content attribute in results")
33
- param :sync_plan_id, :identifier, :desc => N_("Filter products by sync plan id")
33
+ param :sync_plan_id, :number, :desc => N_("Filter products by sync plan id")
34
34
  param :available_for, String, :desc => N_("Interpret specified object to return only Products that can be associated with specified object. Only 'sync_plan' is supported."),
35
35
  :required => false
36
36
  param_group :search, Api::V2::ApiController
@@ -102,7 +102,7 @@ module Katello
102
102
  end
103
103
 
104
104
  api :POST, "/products/:id/sync", N_("Sync all repositories for a product")
105
- param :id, :identifier, :required => true, :desc => "product ID"
105
+ param :id, :number, :required => true, :desc => "product ID"
106
106
  def sync
107
107
  syncable_repos = @product.library_repositories.has_url.syncable
108
108
  if syncable_repos.empty?
@@ -171,20 +171,20 @@ module Katello
171
171
  end
172
172
 
173
173
  api :PUT, "/repositories/:id/republish", N_("Forces a republish of the specified repository, regenerating metadata and symlinks on the filesystem.")
174
- param :id, :identifier, :desc => N_("Repository identifier"), :required => true
174
+ param :id, :number, :desc => N_("Repository identifier"), :required => true
175
175
  def republish
176
176
  task = async_task(::Actions::Katello::Repository::MetadataGenerate, @repository, :force => true)
177
177
  respond_for_async :resource => task
178
178
  end
179
179
 
180
180
  api :GET, "/repositories/:id", N_("Show a repository")
181
- param :id, :identifier, :required => true, :desc => N_("repository ID")
181
+ param :id, :number, :required => true, :desc => N_("repository ID")
182
182
  def show
183
183
  respond_for_show(:resource => @repository)
184
184
  end
185
185
 
186
186
  api :POST, "/repositories/:id/sync", N_("Sync a repository")
187
- param :id, :identifier, :required => true, :desc => N_("repository ID")
187
+ param :id, :number, :required => true, :desc => N_("repository ID")
188
188
  param :source_url, String, :desc => N_("temporarily override feed URL for sync"), :required => false
189
189
  param :incremental, :bool, :desc => N_("perform an incremental import"), :required => false
190
190
  param :skip_metadata_check, :bool, :desc => N_("Force sync even if no upstream changes are detected. Only used with yum repositories."), :required => false
@@ -212,7 +212,7 @@ module Katello
212
212
  end
213
213
 
214
214
  api :POST, "/repositories/:id/export", N_("Export a repository")
215
- param :id, :identifier, :desc => N_("Repository identifier"), :required => true
215
+ param :id, :number, :desc => N_("Repository identifier"), :required => true
216
216
  param :export_to_iso, :bool, :desc => N_("Export to ISO format"), :required => false
217
217
  param :iso_mb_size, :number, :desc => N_("maximum size of each ISO in MB"), :required => false
218
218
  param :since, Date, :desc => N_("Optional date of last export (ex: 2010-01-01T12:00:00Z)"), :required => false
@@ -241,7 +241,7 @@ module Katello
241
241
 
242
242
  api :PUT, "/repositories/:id", N_("Update a repository")
243
243
  param :name, String, :desc => N_("New name for the repository")
244
- param :id, :identifier, :required => true, :desc => N_("repository ID")
244
+ param :id, :number, :required => true, :desc => N_("repository ID")
245
245
  param :gpg_key_id, :number, :desc => N_("ID of a gpg key that will be assigned to this repository")
246
246
  param :unprotected, :bool, :desc => N_("true if this repository can be published via HTTP")
247
247
  param :checksum_type, String, :desc => N_("checksum of the repository, currently 'sha1' & 'sha256' are supported.'")
@@ -261,7 +261,7 @@ module Katello
261
261
  end
262
262
 
263
263
  api :DELETE, "/repositories/:id", N_("Destroy a custom repository")
264
- param :id, :identifier, :required => true
264
+ param :id, :number, :required => true
265
265
  def destroy
266
266
  sync_task(::Actions::Katello::Repository::Destroy, @repository)
267
267
  respond_for_destroy
@@ -290,7 +290,7 @@ module Katello
290
290
  Rails.logger.info("Sync_complete called for #{repo.name}, running after_sync.")
291
291
 
292
292
  unless repo.dynflow_handled_last_sync?(task_id)
293
- async_task(::Actions::Katello::Repository::Sync, repo, task_id)
293
+ async_task(::Actions::Katello::Repository::ScheduledSync, repo, task_id)
294
294
  end
295
295
  render :json => {}
296
296
  end
@@ -300,7 +300,7 @@ module Katello
300
300
  api :PUT, "/repositories/:id/remove_puppet_modules"
301
301
  api :PUT, "/repositories/:id/remove_content"
302
302
  desc "Remove content from a repository"
303
- param :id, :identifier, :required => true, :desc => "repository ID"
303
+ param :id, :number, :required => true, :desc => "repository ID"
304
304
  param 'ids', Array, :required => true, :desc => "Array of content ids to remove"
305
305
  param 'sync_capsule', :bool, :desc => N_("Whether or not to sync an external capsule after upload. Default: true")
306
306
  def remove_content
@@ -310,7 +310,7 @@ module Katello
310
310
  end
311
311
 
312
312
  api :POST, "/repositories/:id/upload_content", N_("Upload content into the repository")
313
- param :id, :identifier, :required => true, :desc => N_("repository ID")
313
+ param :id, :number, :required => true, :desc => N_("repository ID")
314
314
  param :content, File, :required => true, :desc => N_("Content files to upload. Can be a single file or array of files.")
315
315
  def upload_content
316
316
  fail Katello::Errors::InvalidRepositoryContent, _("Cannot upload Docker content.") if @repository.docker?
@@ -336,7 +336,7 @@ module Katello
336
336
  end
337
337
 
338
338
  api :PUT, "/repositories/:id/import_uploads", N_("Import uploads into a repository")
339
- param :id, :identifier, :required => true, :desc => N_("Repository id")
339
+ param :id, :number, :required => true, :desc => N_("Repository id")
340
340
  param :upload_ids, Array, :desc => N_("Array of upload ids to import"), :deprecated => true
341
341
  param :async, :bool, desc: N_("Do not wait for the ImportUpload action to finish. Default: false")
342
342
  param 'publish_repository', :bool, :desc => N_("Whether or not to regenerate the repository on disk. Default: true")
@@ -385,7 +385,7 @@ module Katello
385
385
  # we don't want to authenticate, authorize etc, trying to distinguish between a yum request and normal api request
386
386
  # might not always be 100% bullet proof, and its more important that yum can fetch the key.
387
387
  api :GET, "/repositories/:id/gpg_key_content", N_("Return the content of a repo gpg key, used directly by yum")
388
- param :id, :identifier, :required => true
388
+ param :id, :number, :required => true
389
389
  def gpg_key_content
390
390
  if @repository.gpg_key && @repository.gpg_key.content.present?
391
391
  render(:plain => @repository.gpg_key.content, :layout => false)
@@ -18,7 +18,7 @@ module Katello
18
18
  def index
19
19
  collection = {}
20
20
  if @product.nil?
21
- collection[:results] = available_repository_sets
21
+ collection[:results] = @organization.enabled_product_content
22
22
  else
23
23
  collection[:results] = @product.displayable_product_contents
24
24
  end
@@ -108,14 +108,5 @@ module Katello
108
108
  def substitutions
109
109
  params.slice(:basearch, :releasever)
110
110
  end
111
-
112
- def available_repository_sets
113
- repository_sets = @organization.products.enabled.uniq.flat_map do |product|
114
- product.available_content
115
- end
116
- repository_sets.uniq.sort_by do |repository_set|
117
- repository_set.content.name.downcase
118
- end
119
- end
120
111
  end
121
112
  end
@@ -13,7 +13,7 @@ module Katello
13
13
  end
14
14
 
15
15
  api :PUT, "/hosts/:host_id/host_collections", N_("Alter a hosts host collections")
16
- param :host_id, :identifier, :required => true, :desc => N_("The id of the host to alter")
16
+ param :host_id, :number, :required => true, :desc => N_("The id of the host to alter")
17
17
  param :host_collection_ids, Array, :required => true, :desc => N_("List of host collection ids to update")
18
18
  def host_collections
19
19
  @host.host_collection_ids = params[:host_collection_ids]
@@ -21,8 +21,8 @@ module Katello
21
21
  api :GET, "/content_view_filters/:content_view_filter_id/:resource_id", N_("List :resource_id")
22
22
  api :GET, "/repositories/:repository_id/:resource_id", N_("List :resource_id")
23
23
  param :organization_id, :number, :desc => N_("organization identifier")
24
- param :content_view_version_id, :identifier, :desc => N_("content view version identifier")
25
- param :content_view_filter_id, :identifier, :desc => N_("content view filter identifier")
24
+ param :content_view_version_id, :number, :desc => N_("content view version identifier")
25
+ param :content_view_filter_id, :number, :desc => N_("content view filter identifier")
26
26
  param :repository_id, :number, :desc => N_("repository identifier")
27
27
  param :environment_id, :number, :desc => N_("environment identifier")
28
28
  param :ids, Array, :desc => N_("ids to filter content by")
@@ -51,7 +51,7 @@ module Katello
51
51
 
52
52
  api :GET, "/compare/", N_("List :resource_id")
53
53
  param :content_view_version_ids, Array, :desc => N_("content view versions to compare")
54
- param :repository_id, :identifier, :desc => N_("Library repository id to restrict comparisons to")
54
+ param :repository_id, :number, :desc => N_("Library repository id to restrict comparisons to")
55
55
  def compare
56
56
  fail _("No content_view_version_ids provided") if params[:content_view_version_ids].empty?
57
57
  @versions = ContentViewVersion.readable.where(:id => params[:content_view_version_ids])
@@ -20,8 +20,11 @@ module Katello
20
20
  tabs = {}.with_indifferent_access
21
21
  redhat_repo_tabs.each { |tab| tabs[tab[:id]] = tab }
22
22
 
23
+ product_content = provider.organization.filtered_product_content
24
+
23
25
  provider.products.each do |product|
24
- product.displayable_product_contents.each do |prod_content|
26
+ selected_contents = product_content.select { |pc| pc.product_id == product.id }.select(&:displayable?)
27
+ selected_contents.each do |prod_content|
25
28
  name = prod_content.content.name
26
29
  if prod_content.content_type == ::Katello::Repository::CANDLEPIN_OSTREE_TYPE
27
30
  key = :ostree
@@ -4,6 +4,7 @@ module Actions
4
4
  middleware.use ::Actions::Middleware::RemoteAction
5
5
  middleware.use ::Actions::Middleware::PropagateCandlepinErrors
6
6
  middleware.use ::Actions::Middleware::CandlepinServicesCheck
7
+ middleware.use ::Actions::Middleware::KeepSessionId
7
8
  end
8
9
  end
9
10
  end
@@ -40,6 +40,7 @@ module Actions
40
40
  host.subscription_facet.uuid = hypervisor_json[:uuid]
41
41
  host.subscription_facet.import_database_attributes(host.subscription_facet.candlepin_consumer.consumer_attributes)
42
42
  host.subscription_facet.save!
43
+ host.subscription_facet.update_subscription_status
43
44
  host.save!
44
45
  end
45
46
 
@@ -0,0 +1,29 @@
1
+ module Actions
2
+ module Katello
3
+ module Host
4
+ class UpdateReleaseVersion < Actions::EntryAction
5
+ def plan(host, release_version)
6
+ plan_self(:hostname => host.name)
7
+ if host.content_facet && host.subscription_facet
8
+ if release_version.present? && !host.content_facet.available_releases.include?(release_version)
9
+ fail _("Host %{name} cannot be assigned release version %{release_version}.") % { :name => host.name, :release_version => release_version }
10
+ else
11
+ host.subscription_facet.release_version = release_version
12
+ end
13
+ plan_action(Actions::Katello::Host::Update, host)
14
+ else
15
+ fail _("Host %s has not been registered with subscription-manager.") % host.name
16
+ end
17
+ end
18
+
19
+ def humanized_name
20
+ if input.try(:[], :hostname).nil?
21
+ _("Update release version for host")
22
+ else
23
+ _("Update release version for host %s") % input[:hostname]
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -32,13 +32,10 @@ module Actions
32
32
  end
33
33
 
34
34
  def run
35
- ::Katello::Repository.ensure_sync_notification
36
- end
37
-
38
- def finalize
39
35
  product = ::Katello::Product.find(input[:product][:id])
40
- product.cp_id = input[:cp_id]
41
- product.save!
36
+ product.update_attributes!(:cp_id => input[:cp_id])
37
+
38
+ ::Katello::Repository.ensure_sync_notification
42
39
  end
43
40
 
44
41
  def humanized_name
@@ -15,7 +15,7 @@ module Actions
15
15
  plan_self(id: product.id, subscription_id: subscription_id)
16
16
  end
17
17
 
18
- def finalize
18
+ def run
19
19
  product = ::Katello::Product.find_by!(:id => input[:id])
20
20
  product.import_subscription(input[:subscription_id])
21
21
  end
@@ -0,0 +1,15 @@
1
+ module Actions
2
+ module Katello
3
+ module Repository
4
+ class ScheduledSync < Sync
5
+ def humanized_name
6
+ _("Scheduled Synchronization")
7
+ end
8
+
9
+ def resource_locks
10
+ :link
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -43,6 +43,10 @@ module Actions
43
43
  delete_tmp_files(input[:tmp_files])
44
44
  end
45
45
 
46
+ def rescue_strategy
47
+ Dynflow::Action::Rescue::Skip
48
+ end
49
+
46
50
  private
47
51
 
48
52
  def tmp_dir
@@ -0,0 +1,29 @@
1
+ module Actions
2
+ module Middleware
3
+ class KeepSessionId < Dynflow::Middleware
4
+ def plan(*args)
5
+ pass(*args).tap do
6
+ action.input[:session_id] = ::Logging.mdc['request']
7
+ end
8
+ end
9
+
10
+ def run(*args)
11
+ with_session_id { pass(*args) }
12
+ end
13
+
14
+ def finalize
15
+ with_session_id { pass }
16
+ end
17
+
18
+ private
19
+
20
+ def with_session_id(&_block)
21
+ original_session_id = ::Logging.mdc['request']
22
+ ::Logging.mdc['request'] = action.input[:session_id]
23
+ yield
24
+ ensure
25
+ ::Logging.mdc['request'] = original_session_id
26
+ end
27
+ end
28
+ end
29
+ end
@@ -50,6 +50,14 @@ module Katello
50
50
  self.consumer_key = cfg[:oauth_key]
51
51
  self.ca_cert_file = cfg[:ca_cert_file]
52
52
 
53
+ class << self
54
+ def process_response(response)
55
+ debug_level = response.code >= 400 ? :error : :debug
56
+ logger.send(debug_level, "Candlepin request #{response.headers[:x_candlepin_request_uuid]} returned with code #{response.code}")
57
+ super
58
+ end
59
+ end
60
+
53
61
  def self.logger
54
62
  ::Foreman::Logging.logger('katello/cp_rest')
55
63
  end
@@ -65,9 +73,14 @@ module Katello
65
73
  cp_oauth_header = User.cp_oauth_header
66
74
  end
67
75
 
68
- {'accept' => 'application/json',
69
- 'accept-language' => I18n.locale,
70
- 'content-type' => 'application/json'}.merge(cp_oauth_header)
76
+ headers = {'accept' => 'application/json',
77
+ 'accept-language' => I18n.locale,
78
+ 'content-type' => 'application/json'}
79
+
80
+ request_id = ::Logging.mdc['request']
81
+ headers['X-Correlation-ID'] = request_id.split('-')[0] if request_id
82
+
83
+ headers.merge!(cp_oauth_header)
71
84
  end
72
85
 
73
86
  def self.name_to_key(a_name)
@@ -386,6 +399,10 @@ module Katello
386
399
  self.post(path, {:import => File.new(path_to_file, 'rb')}, self.default_headers.except('content-type'))
387
400
  end
388
401
 
402
+ def product_content(organization_name)
403
+ Product.all(organization_name, [:id, :productContent])
404
+ end
405
+
389
406
  def destroy_imports(organization_name, wait_until_complete = false)
390
407
  response_json = self.delete(join_path(path(organization_name), 'imports'), self.default_headers)
391
408
  response = JSON.parse(response_json).with_indifferent_access
@@ -641,8 +658,8 @@ module Katello
641
658
 
642
659
  class Product < CandlepinResource
643
660
  class << self
644
- def all(owner_label)
645
- JSON.parse(Candlepin::CandlepinResource.get(path(owner_label), self.default_headers).body)
661
+ def all(owner_label, included = [])
662
+ JSON.parse(Candlepin::CandlepinResource.get(path(owner_label) + "?#{included_list(included)}", self.default_headers).body)
646
663
  end
647
664
 
648
665
  def find_for_stacking_id(owner_key, stacking_id)
@@ -0,0 +1,30 @@
1
+ module Katello
2
+ module Validators
3
+ class HostgroupKickstartRepositoryValidator < ActiveModel::Validator
4
+ def validate(hostgroup)
5
+ # check content source first, otherwise it's meaningless to proceed
6
+ if hostgroup.content_source && hostgroup.lifecycle_environment
7
+ valid = hostgroup.content_source.lifecycle_environments.include?(hostgroup.lifecycle_environment)
8
+ hostgroup.errors.add(:base, _("The selected content source and lifecycle environment do not match")) && return unless valid
9
+ end
10
+
11
+ return unless hostgroup.kickstart_repository_id
12
+
13
+ msg = if hostgroup.content_source.blank?
14
+ hostgroup.errors.add(:base, _("Please select a content source before assigning a kickstart repository"))
15
+ elsif hostgroup.operatingsystem.blank?
16
+ _("Please select an operating system before assigning a kickstart repository")
17
+ elsif !hostgroup.operatingsystem.is_a?(Redhat)
18
+ _("Kickstart repositories can only be assigned to hosts in the Red Hat family")
19
+ elsif hostgroup.architecture.blank?
20
+ _("Please select an architecture before assigning a kickstart repository")
21
+ elsif hostgroup.operatingsystem.kickstart_repos(hostgroup).none? { |repo| repo[:id] == hostgroup.kickstart_repository_id }
22
+ _("The selected kickstart repository is not part of the assigned content view, lifecycle environment,
23
+ content source, operating system, and architecture")
24
+ end
25
+
26
+ hostgroup.errors.add(:base, msg) if msg
27
+ end
28
+ end
29
+ end
30
+ end
@@ -20,6 +20,8 @@ module Katello
20
20
  has_many :subscription_facet_activation_keys, :class_name => "Katello::SubscriptionFacetActivationKey", :dependent => :destroy
21
21
  has_many :subscription_facets, :through => :subscription_facet_activation_keys
22
22
 
23
+ alias_method :lifecycle_environment, :environment
24
+
23
25
  before_validation :set_default_content_view, :unless => :persisted?
24
26
 
25
27
  validates_lengths_from_database
@@ -90,39 +92,7 @@ module Katello
90
92
  end
91
93
 
92
94
  def products
93
- all_products = []
94
-
95
- self.pools.each do |pool|
96
- if pool.subscription
97
- all_products << pool.subscription.products
98
- else
99
- Rails.logger.error("Pool #{pool.id} is missing its subscription id.")
100
- end
101
- end
102
- all_products.uniq.flatten
103
- end
104
-
105
- def all_products
106
- organization.products.enabled.uniq
107
- end
108
-
109
- def available_content(content_access_mode_all = false, content_access_mode_env = false)
110
- if content_access_mode_env
111
- return [] unless environment_id && content_view_id
112
- version = ContentViewVersion.in_environment(environment_id).where(:content_view_id => content_view_id).first
113
- content_view_version_id = version.id
114
- end
115
-
116
- if content_access_mode_all
117
- content = all_products.flat_map do |product|
118
- product.available_content(content_view_version_id)
119
- end
120
- else
121
- content = products.flat_map do |product|
122
- product.available_content(content_view_version_id)
123
- end
124
- end
125
- content.uniq
95
+ Katello::Product.joins(:subscriptions => {:pools => :activation_keys}).where("#{Katello::ActivationKey.table_name}.id" => self.id).enabled.uniq
126
96
  end
127
97
 
128
98
  def valid_content_override_label?(content_label)