katello 3.4.5 → 3.5.0.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -0
  3. data/app/assets/stylesheets/katello/katello.scss +7 -5
  4. data/app/controllers/katello/api/v2/activation_keys_controller.rb +3 -3
  5. data/app/controllers/katello/api/v2/api_controller.rb +8 -0
  6. data/app/controllers/katello/api/v2/capsule_content_controller.rb +6 -1
  7. data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +2 -1
  8. data/app/controllers/katello/api/v2/content_view_versions_controller.rb +1 -1
  9. data/app/controllers/katello/api/v2/content_views_controller.rb +1 -1
  10. data/app/controllers/katello/api/v2/host_collections_controller.rb +1 -1
  11. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +2 -2
  12. data/app/controllers/katello/api/v2/host_tracer_controller.rb +1 -1
  13. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +6 -6
  14. data/app/controllers/katello/api/v2/repositories_controller.rb +6 -7
  15. data/app/controllers/katello/api/v2/repository_sets_controller.rb +25 -4
  16. data/app/controllers/katello/concerns/api/v2/content_overrides_controller.rb +2 -4
  17. data/app/controllers/katello/concerns/api/v2/hostgroups_controller_extensions.rb +10 -27
  18. data/app/controllers/katello/concerns/api/v2/smart_proxies_controller_extensions.rb +10 -14
  19. data/app/controllers/katello/concerns/hosts_controller_extensions.rb +33 -0
  20. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +2 -1
  21. data/app/helpers/katello/organizations_helper.rb +1 -1
  22. data/app/helpers/katello/providers_helper.rb +1 -1
  23. data/app/lib/actions/candlepin/abstract_async_task.rb +1 -1
  24. data/app/lib/actions/candlepin/candlepin_listening_service.rb +17 -6
  25. data/app/lib/actions/candlepin/import_pool_handler.rb +21 -56
  26. data/app/lib/actions/candlepin/listen_on_candlepin_events.rb +1 -0
  27. data/app/lib/actions/candlepin/owner/import_products.rb +1 -3
  28. data/app/lib/actions/candlepin/product/content_create.rb +2 -0
  29. data/app/lib/actions/candlepin/product/content_update.rb +2 -0
  30. data/app/lib/actions/candlepin/product/create.rb +2 -10
  31. data/app/lib/actions/candlepin/product/create_unlimited_subscription.rb +8 -1
  32. data/app/lib/actions/katello/capsule_content/sync.rb +12 -3
  33. data/app/lib/actions/katello/host/attach_subscriptions.rb +1 -1
  34. data/app/lib/actions/katello/host/hypervisors_update.rb +2 -4
  35. data/app/lib/actions/katello/host/remove_subscriptions.rb +1 -1
  36. data/app/lib/actions/katello/organization/create.rb +2 -2
  37. data/app/lib/actions/katello/organization/manifest_refresh.rb +1 -2
  38. data/app/lib/actions/katello/product/content_create.rb +4 -4
  39. data/app/lib/actions/katello/product/create.rb +13 -11
  40. data/app/lib/actions/katello/repository/sync.rb +0 -1
  41. data/app/lib/actions/katello/repository/update.rb +2 -1
  42. data/app/lib/actions/pulp/consumer/generate_applicability.rb +5 -1
  43. data/app/lib/actions/pulp/repository/create.rb +1 -0
  44. data/app/lib/actions/pulp/repository/create_in_plan.rb +4 -4
  45. data/app/lib/actions/pulp/repository/sync.rb +1 -1
  46. data/app/lib/katello/http_resource.rb +1 -1
  47. data/app/lib/katello/lazy_accessor.rb +1 -1
  48. data/app/lib/katello/resources/candlepin.rb +2 -2
  49. data/app/lib/katello/util/data.rb +6 -0
  50. data/app/lib/katello/util/support.rb +1 -1
  51. data/app/models/katello/activation_key.rb +25 -7
  52. data/app/models/katello/concerns/host_managed_extensions.rb +60 -17
  53. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +31 -10
  54. data/app/models/katello/content_facet_applicable_rpm.rb +0 -2
  55. data/app/models/katello/content_facet_erratum.rb +0 -2
  56. data/app/models/katello/content_facet_repository.rb +0 -2
  57. data/app/models/katello/content_view.rb +3 -4
  58. data/app/models/katello/content_view_component.rb +1 -3
  59. data/app/models/katello/content_view_docker_filter_rule.rb +0 -2
  60. data/app/models/katello/content_view_environment.rb +2 -4
  61. data/app/models/katello/content_view_erratum_filter_rule.rb +0 -2
  62. data/app/models/katello/content_view_filter.rb +0 -2
  63. data/app/models/katello/content_view_package_filter_rule.rb +0 -2
  64. data/app/models/katello/content_view_package_group_filter_rule.rb +0 -2
  65. data/app/models/katello/content_view_puppet_environment.rb +0 -2
  66. data/app/models/katello/content_view_puppet_environment_puppet_module.rb +0 -2
  67. data/app/models/katello/content_view_puppet_module.rb +0 -2
  68. data/app/models/katello/content_view_repository.rb +0 -2
  69. data/app/models/katello/content_view_version.rb +0 -2
  70. data/app/models/katello/erratum_bugzilla.rb +0 -2
  71. data/app/models/katello/erratum_cve.rb +0 -2
  72. data/app/models/katello/erratum_package.rb +0 -2
  73. data/app/models/katello/ext/label_from_name.rb +1 -1
  74. data/app/models/katello/glue/candlepin/pool.rb +18 -11
  75. data/app/models/katello/glue/candlepin/product.rb +1 -2
  76. data/app/models/katello/glue/pulp/repo.rb +13 -6
  77. data/app/models/katello/glue/pulp/repos.rb +16 -16
  78. data/app/models/katello/gpg_key.rb +0 -2
  79. data/app/models/katello/host/content_facet.rb +21 -0
  80. data/app/models/katello/host/info_provider.rb +56 -0
  81. data/app/models/katello/host/subscription_facet.rb +5 -3
  82. data/app/models/katello/host_collection.rb +0 -2
  83. data/app/models/katello/host_collection_hosts.rb +0 -2
  84. data/app/models/katello/host_installed_package.rb +0 -2
  85. data/app/models/katello/host_tracer.rb +0 -2
  86. data/app/models/katello/key_host_collection.rb +0 -2
  87. data/app/models/katello/kt_environment.rb +0 -2
  88. data/app/models/katello/model.rb +1 -1
  89. data/app/models/katello/pool.rb +3 -3
  90. data/app/models/katello/product.rb +10 -3
  91. data/app/models/katello/provider.rb +0 -2
  92. data/app/models/katello/repository.rb +0 -2
  93. data/app/models/katello/repository_docker_manifest.rb +0 -2
  94. data/app/models/katello/repository_erratum.rb +0 -2
  95. data/app/models/katello/repository_file.rb +0 -2
  96. data/app/models/katello/repository_ostree_branch.rb +0 -2
  97. data/app/models/katello/repository_package_group.rb +0 -1
  98. data/app/models/katello/repository_puppet_module.rb +0 -2
  99. data/app/models/katello/repository_rpm.rb +0 -2
  100. data/app/models/katello/rpm.rb +2 -2
  101. data/app/models/katello/subscription_facet_activation_key.rb +0 -2
  102. data/app/models/katello/subscription_facet_pool.rb +6 -0
  103. data/app/models/katello/subscription_product.rb +0 -1
  104. data/app/models/katello/sync_plan.rb +0 -2
  105. data/app/models/katello/task_status.rb +2 -4
  106. data/app/models/setting/content.rb +2 -0
  107. data/app/services/katello/candlepin/consumer.rb +1 -2
  108. data/app/services/katello/candlepin/message_handler.rb +88 -0
  109. data/app/services/katello/repository_type_manager.rb +1 -1
  110. data/app/views/dashboard/_content_views_widget.html.erb +2 -2
  111. data/app/views/dashboard/_errata_widget.html.erb +3 -3
  112. data/app/views/foreman/smart_proxies/_content_sync.html.erb +25 -8
  113. data/app/views/foreman/unattended/kickstart-katello-atomic.erb +1 -1
  114. data/app/views/foreman/unattended/kickstart-katello.erb +1 -1
  115. data/app/views/katello/api/v2/common/_org_reference.json.rabl +1 -0
  116. data/app/views/katello/api/v2/content_facet/base.json.rabl +3 -14
  117. data/app/views/katello/api/v2/products/base.json.rabl +1 -1
  118. data/app/views/katello/api/v2/repositories/base.json.rabl +1 -1
  119. data/app/views/katello/api/v2/repository_sets/show.json.rabl +8 -1
  120. data/app/views/katello/api/v2/subscriptions/base.json.rabl +0 -7
  121. data/app/views/katello/api/v2/subscriptions/show.json.rabl +4 -37
  122. data/config/routes/overrides.rb +1 -0
  123. data/db/migrate/20140422000001_update_products_add_organization.rb +1 -1
  124. data/db/migrate/20140610154745_content_view_puppet_environment_id.rb +1 -1
  125. data/db/migrate/20140626204657_add_unlimited_to_activation_keys.rb +1 -1
  126. data/db/migrate/20140626204902_add_unlimited_to_host_collection.rb +1 -1
  127. data/db/migrate/20141209103005_disown_foreman_templates.rb +1 -1
  128. data/db/migrate/20150901213759_remove_distributors.rb +1 -1
  129. data/db/migrate/20150908222711_drop_marketing_engineering_products.rb +1 -1
  130. data/db/migrate/20150930183738_migrate_content_hosts.rb +20 -20
  131. data/db/migrate/20151014144004_host_collection_to_hosts.rb +5 -5
  132. data/db/migrate/20160114200145_add_mirror_on_sync_to_repositories.rb +1 -1
  133. data/db/migrate/20160131182301_add_download_policy_to_katello_repositories.rb +1 -1
  134. data/db/migrate/20160222143432_move_system_description_to_host.rb +2 -2
  135. data/db/migrate/20160404132250_remove_katello_from_notification_name.rb +1 -1
  136. data/db/migrate/20160426145517_move_host_description_to_host_comment.rb +1 -1
  137. data/db/migrate/20160617124149_remove_duplicate_view_filters.rb +4 -4
  138. data/db/migrate/20160619223332_fix_viewer_role.rb +4 -4
  139. data/db/migrate/20160701180402_add_sortable_version_to_puppet_modules.rb +1 -1
  140. data/db/migrate/20160924213020_change_katello_widget_names.rb +1 -1
  141. data/db/migrate/20161014133811_move_content_view_version_description_to_histories.rb +2 -2
  142. data/db/migrate/20161026191118_fix_invalid_interfaces.rb +1 -1
  143. data/db/migrate/20170321012632_fill_in_content_view_components.rb +3 -3
  144. data/db/migrate/20170718142148_create_katello_subscription_facet_pools.rb +15 -0
  145. data/db/migrate/20170821170915_add_index_to_installed_packages.rb +5 -0
  146. data/db/migrate/20170821170916_add_nvra_index_to_installed_packages.rb +5 -0
  147. data/db/migrate/20170913183848_add_errata_counts.rb +23 -0
  148. data/db/seeds.d/101-locations.rb +2 -2
  149. data/db/seeds.d/102-organizations.rb +3 -3
  150. data/db/seeds.d/103-provisioning_templates.rb +29 -31
  151. data/db/seeds.d/104-proxy.rb +10 -12
  152. data/db/seeds.d/106-mail_notifications.rb +30 -32
  153. data/db/seeds.d/107-enable_dynflow.rb +3 -4
  154. data/db/seeds.d/108-subcription-bookmarks.rb +12 -10
  155. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/activation-keys.routes.js +1 -1
  156. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/new/views/activation-key-new.html +1 -1
  157. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/architectures/architecture.factory.js +15 -0
  158. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/architectures/architectures.module.js +14 -0
  159. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +1 -0
  160. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion_katello.js +3 -0
  161. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.controller.js +2 -2
  162. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-repository-sets-modal.controller.js +107 -0
  163. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-repository-sets-modal.html +113 -0
  164. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts-helper.service.js +13 -0
  165. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +25 -4
  166. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details-info.controller.js +4 -4
  167. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +15 -12
  168. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-repository-sets.html +1 -1
  169. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +11 -5
  170. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/views/version-deletion-activation-keys.html +15 -12
  171. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/views/version-deletion-content-hosts.html +16 -12
  172. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/apply-errata.controller.js +9 -6
  173. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/views/errata-counts.html +6 -12
  174. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/views/errata.html +4 -1
  175. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-bulk-action.factory.js +1 -0
  176. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/views/packages.html +5 -2
  177. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +20 -2
  178. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +9 -1
  179. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +22 -3
  180. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +17 -1
  181. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.controller.js +1 -1
  182. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.module.js +1 -0
  183. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/repository-set.factory.js +16 -0
  184. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-details.controller.js +4 -0
  185. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-details.html +0 -19
  186. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-info.html +31 -0
  187. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptions.routes.js +1 -1
  188. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/views/tasks-table.html +6 -3
  189. data/lib/katello/permissions/host_permissions.rb +1 -0
  190. data/lib/katello/plugin.rb +7 -5
  191. data/lib/katello/tasks/clean_installed_packages.rake +54 -0
  192. data/lib/katello/tasks/import_subscriptions.rake +8 -0
  193. data/lib/katello/tasks/{setup.rake → reset.rake} +10 -0
  194. data/lib/katello/tasks/test.rake +18 -0
  195. data/lib/katello/version.rb +1 -1
  196. data/vendor/assets/stylesheets/katello/{jquery-ui-1.8.11.custom.css → jquery-ui-1.8.11.custom.css.scss} +0 -0
  197. data/vendor/assets/stylesheets/katello/{jquery.loadmask.css → jquery.loadmask.css.scss} +0 -0
  198. data/vendor/assets/stylesheets/katello/{jquery.treeTable.scss → jquery.treeTable.css.scss} +0 -0
  199. data/vendor/assets/stylesheets/katello/{ui.spinner.css → ui.spinner.css.scss} +0 -0
  200. metadata +43 -21
  201. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-activation-keys.controller.js +0 -30
  202. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-content-hosts.controller.js +0 -45
  203. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-activation-keys.html +0 -48
  204. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-content-hosts.html +0 -62
  205. data/lib/katello/tasks/upgrades/2.4/import_subscriptions.rake +0 -12
  206. data/lib/katello/tasks/upgrades/3.3/import_subscriptions.rake +0 -12
@@ -1,5 +1,5 @@
1
1
  class MoveHostDescriptionToHostComment < ActiveRecord::Migration
2
- class Host < ActiveRecord::Base
2
+ class Host < ApplicationRecord
3
3
  self.table_name = "hosts"
4
4
  end
5
5
 
@@ -1,8 +1,8 @@
1
1
  class RemoveDuplicateViewFilters < ActiveRecord::Migration
2
- class Role < ActiveRecord::Base
2
+ class Role < ApplicationRecord
3
3
  end
4
4
 
5
- class Filter < ActiveRecord::Base
5
+ class Filter < ApplicationRecord
6
6
  belongs_to :role
7
7
  has_many :filterings, :dependent => :destroy
8
8
  has_many :permissions, :through => :filterings
@@ -10,12 +10,12 @@ class RemoveDuplicateViewFilters < ActiveRecord::Migration
10
10
  scope :unlimited, -> { where(:search => nil, :taxonomy_search => nil) }
11
11
  end
12
12
 
13
- class Filtering < ActiveRecord::Base
13
+ class Filtering < ApplicationRecord
14
14
  belongs_to :filter
15
15
  belongs_to :permission
16
16
  end
17
17
 
18
- class Permission < ActiveRecord::Base
18
+ class Permission < ApplicationRecord
19
19
  has_many :filterings, :dependent => :destroy
20
20
  has_many :filters, :through => :filterings
21
21
  end
@@ -1,9 +1,9 @@
1
1
  class FixViewerRole < ActiveRecord::Migration
2
- class Role < ActiveRecord::Base
2
+ class Role < ApplicationRecord
3
3
  has_many :filters
4
4
  end
5
5
 
6
- class Filter < ActiveRecord::Base
6
+ class Filter < ApplicationRecord
7
7
  belongs_to :role
8
8
  has_many :filterings, :dependent => :destroy
9
9
  has_many :permissions, :through => :filterings
@@ -16,12 +16,12 @@ class FixViewerRole < ActiveRecord::Migration
16
16
  end
17
17
  end
18
18
 
19
- class Filtering < ActiveRecord::Base
19
+ class Filtering < ApplicationRecord
20
20
  belongs_to :filter
21
21
  belongs_to :permission
22
22
  end
23
23
 
24
- class Permission < ActiveRecord::Base
24
+ class Permission < ApplicationRecord
25
25
  end
26
26
 
27
27
  def change
@@ -1,5 +1,5 @@
1
1
  class AddSortableVersionToPuppetModules < ActiveRecord::Migration
2
- class PuppetModule < ActiveRecord::Base
2
+ class PuppetModule < ApplicationRecord
3
3
  self.table_name = "katello_puppet_modules"
4
4
  end
5
5
 
@@ -1,5 +1,5 @@
1
1
  class ChangeKatelloWidgetNames < ActiveRecord::Migration
2
- class Widget < ActiveRecord::Base
2
+ class Widget < ApplicationRecord
3
3
  self.table_name = "widgets"
4
4
  end
5
5
 
@@ -1,11 +1,11 @@
1
1
  class MoveContentViewVersionDescriptionToHistories < ActiveRecord::Migration
2
- class FakeContentViewVersion < ActiveRecord::Base
2
+ class FakeContentViewVersion < ApplicationRecord
3
3
  self.table_name = 'katello_content_view_versions'
4
4
  has_many :history, :class_name => "CVHistory", :inverse_of => :content_view_version,
5
5
  :dependent => :destroy, :foreign_key => :katello_content_view_version_id
6
6
  end
7
7
 
8
- class CVHistory < ActiveRecord::Base
8
+ class CVHistory < ApplicationRecord
9
9
  self.table_name = 'katello_content_view_histories'
10
10
  belongs_to :content_view_version, :class_name => "FakeContentViewVersion", :foreign_key => :katello_content_view_version_id, :inverse_of => :history
11
11
  SUCCESSFUL = 'successful'.freeze
@@ -1,5 +1,5 @@
1
1
  class FixInvalidInterfaces < ActiveRecord::Migration
2
- class FakeNic < ActiveRecord::Base
2
+ class FakeNic < ApplicationRecord
3
3
  self.table_name = 'nics'
4
4
 
5
5
  def type
@@ -1,18 +1,18 @@
1
1
  class FillInContentViewComponents < ActiveRecord::Migration
2
- class FakeContentView < ActiveRecord::Base
2
+ class FakeContentView < ApplicationRecord
3
3
  self.table_name = 'katello_content_views'
4
4
 
5
5
  has_many :content_view_components, :class_name => "FakeContentViewVersion", :dependent => :destroy,
6
6
  :inverse_of => :composite_content_view, :foreign_key => :composite_content_view_id
7
7
  end
8
8
 
9
- class FakeContentViewVersion < ActiveRecord::Base
9
+ class FakeContentViewVersion < ApplicationRecord
10
10
  self.table_name = 'katello_content_view_versions'
11
11
 
12
12
  has_many :content_view_components, :inverse_of => :content_view_version, :dependent => :destroy, :class_name => 'FakeContentViewComponent'
13
13
  end
14
14
 
15
- class FakeContentViewComponent < ActiveRecord::Base
15
+ class FakeContentViewComponent < ApplicationRecord
16
16
  self.table_name = 'katello_content_view_components'
17
17
 
18
18
  belongs_to :content_view_version, :class_name => "FakeContentViewVersion",
@@ -0,0 +1,15 @@
1
+ class CreateKatelloSubscriptionFacetPools < ActiveRecord::Migration
2
+ def change
3
+ create_table :katello_subscription_facet_pools do |t|
4
+ t.column :subscription_facet_id, :integer, required: true
5
+ t.column :pool_id, :integer, required: true
6
+ end
7
+ add_index "katello_subscription_facet_pools", [:pool_id, :subscription_facet_id], :unique => true,
8
+ :name => "index_katello_sub_facet_pools_on_sfid_poolid"
9
+
10
+ add_foreign_key "katello_subscription_facet_pools", "katello_pools",
11
+ :name => "katello_sub_facet_pools_pool_id_fk", :column => "pool_id"
12
+ add_foreign_key "katello_subscription_facet_pools", "katello_subscription_facets",
13
+ :name => "katello_sub_facet_pools_sf_id_fk", :column => "subscription_facet_id"
14
+ end
15
+ end
@@ -0,0 +1,5 @@
1
+ class AddIndexToInstalledPackages < ActiveRecord::Migration
2
+ def change
3
+ add_index :katello_installed_packages, [:name, :nvra]
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddNvraIndexToInstalledPackages < ActiveRecord::Migration
2
+ def change
3
+ add_index :katello_installed_packages, [:nvra]
4
+ end
5
+ end
@@ -0,0 +1,23 @@
1
+ class AddErrataCounts < ActiveRecord::Migration
2
+ def up
3
+ add_column :katello_content_facets, :installable_security_errata_count, :integer, :null => false, :default => 0
4
+ add_column :katello_content_facets, :installable_enhancement_errata_count, :integer, :null => false, :default => 0
5
+ add_column :katello_content_facets, :installable_bugfix_errata_count, :integer, :null => false, :default => 0
6
+
7
+ add_column :katello_content_facets, :applicable_rpm_count, :integer, :null => false, :default => 0
8
+ add_column :katello_content_facets, :upgradable_rpm_count, :integer, :null => false, :default => 0
9
+
10
+ Katello::Host::ContentFacet.find_each do |content_facet|
11
+ content_facet.update_applicability_counts
12
+ end
13
+ end
14
+
15
+ def down
16
+ remove_column :katello_content_facets, :installable_security_errata_count
17
+ remove_column :katello_content_facets, :installable_enhancement_errata_count
18
+ remove_column :katello_content_facets, :installable_bugfix_errata_count
19
+
20
+ remove_column :katello_content_facets, :applicable_rpm_count
21
+ remove_column :katello_content_facets, :upgradable_rpm_count
22
+ end
23
+ end
@@ -5,8 +5,8 @@
5
5
  #
6
6
 
7
7
  if Location.exists? &&
8
- !Setting[:default_location_subscribed_hosts].present? ||
9
- !Setting[:default_location_puppet_content].present?
8
+ Setting[:default_location_subscribed_hosts].blank? ||
9
+ Setting[:default_location_puppet_content].blank?
10
10
  # Create a new location to be used as the Katello Default.
11
11
  default_location = Location.where(:name => ENV['SEED_LOCATION']).first_or_create
12
12
  if Setting[:default_location_subscribed_hosts].empty?
@@ -5,9 +5,9 @@
5
5
  #
6
6
 
7
7
  Organization.all.each do |org|
8
- User.current = User.anonymous_admin
9
- ForemanTasks.sync_task(::Actions::Katello::Organization::Create, org) unless org.library
10
- User.current = nil
8
+ User.as(::User.anonymous_api_admin.login) do
9
+ ForemanTasks.sync_task(::Actions::Katello::Organization::Create, org) unless org.library
10
+ end
11
11
  end
12
12
 
13
13
  if ENV['SEED_ORGANIZATION']
@@ -4,41 +4,39 @@
4
4
  # !!! PLEASE KEEP THIS SCRIPT IDEMPOTENT !!!
5
5
  #
6
6
 
7
- ::User.current = ::User.anonymous_api_admin
7
+ User.as(::User.anonymous_api_admin.login) do
8
+ # Provisioning Templates
8
9
 
9
- # Provisioning Templates
10
-
11
- kinds = [:provision, :finish, :user_data].inject({}) do |hash, kind|
12
- hash[kind] = TemplateKind.find_by(:name => kind)
13
- hash
14
- end
10
+ kinds = [:provision, :finish, :user_data].inject({}) do |hash, kind|
11
+ hash[kind] = TemplateKind.find_by(:name => kind)
12
+ hash
13
+ end
15
14
 
16
- templates = [{:name => "Katello Kickstart Default", :source => "kickstart-katello.erb", :template_kind => kinds[:provision]},
17
- {:name => "Katello Kickstart Default User Data", :source => "userdata-katello.erb", :template_kind => kinds[:user_data]},
18
- {:name => "Katello Kickstart Default Finish", :source => "finish-katello.erb", :template_kind => kinds[:finish]},
19
- {:name => "subscription_manager_registration", :source => "snippets/_subscription_manager_registration.erb", :snippet => true},
20
- {:name => "Katello Atomic Kickstart Default", :source => "kickstart-katello-atomic.erb", :template_kind => kinds[:provision]}]
15
+ templates = [{:name => "Katello Kickstart Default", :source => "kickstart-katello.erb", :template_kind => kinds[:provision]},
16
+ {:name => "Katello Kickstart Default User Data", :source => "userdata-katello.erb", :template_kind => kinds[:user_data]},
17
+ {:name => "Katello Kickstart Default Finish", :source => "finish-katello.erb", :template_kind => kinds[:finish]},
18
+ {:name => "subscription_manager_registration", :source => "snippets/_subscription_manager_registration.erb", :snippet => true},
19
+ {:name => "Katello Atomic Kickstart Default", :source => "kickstart-katello-atomic.erb", :template_kind => kinds[:provision]}]
21
20
 
22
- templates.each do |template|
23
- template[:template] = File.read(File.join(Katello::Engine.root, "app/views/foreman/unattended", template.delete(:source)))
24
- ProvisioningTemplate.where(:name => template["name"]).first_or_create do |pt|
25
- pt.vendor = "Katello"
26
- pt.default = true
27
- pt.locked = true
28
- pt.name = template[:name]
29
- pt.template = template[:template]
30
- pt.template_kind = template[:template_kind] if template[:template_kind]
31
- pt.snippet = template[:snippet] if template[:snippet]
21
+ templates.each do |template|
22
+ template[:template] = File.read(File.join(Katello::Engine.root, "app/views/foreman/unattended", template.delete(:source)))
23
+ ProvisioningTemplate.where(:name => template["name"]).first_or_create do |pt|
24
+ pt.vendor = "Katello"
25
+ pt.default = true
26
+ pt.locked = true
27
+ pt.name = template[:name]
28
+ pt.template = template[:template]
29
+ pt.template_kind = template[:template_kind] if template[:template_kind]
30
+ pt.snippet = template[:snippet] if template[:snippet]
31
+ end
32
+ ProvisioningTemplate.find_by(name: template[:name]).update_attributes!(:template => template[:template])
32
33
  end
33
- ProvisioningTemplate.find_by(name: template[:name]).update_attributes!(:template => template[:template])
34
- end
35
34
 
36
- # Ensure all default templates are seeded into the first org and loc
37
- ProvisioningTemplate.where(:default => true).each do |template|
38
- template.organizations << Organization.first unless template.organizations.include?(Organization.first) || Organization.count.zero?
39
- if Location.exists? && !template.location_ids.include?(Location.default_location_ids)
40
- template.location_ids << Location.default_location_ids
35
+ # Ensure all default templates are seeded into the first org and loc
36
+ ProvisioningTemplate.where(:default => true).each do |template|
37
+ template.organizations << Organization.first unless template.organizations.include?(Organization.first) || Organization.count.zero?
38
+ if Location.exists? && !template.location_ids.include?(Location.default_location_ids)
39
+ template.location_ids << Location.default_location_ids
40
+ end
41
41
  end
42
42
  end
43
-
44
- ::User.current = nil
@@ -9,17 +9,15 @@ def format_errors(model = nil)
9
9
  model.errors.full_messages.join(';')
10
10
  end
11
11
 
12
- ::User.current = ::User.anonymous_api_admin
12
+ User.as(::User.anonymous_api_admin.login) do
13
+ # Proxy features
14
+ feature = Feature.where(:name => 'Pulp').first_or_create
15
+ if feature.nil? || feature.errors.any?
16
+ fail "Unable to create proxy feature: #{format_errors feature}"
17
+ end
13
18
 
14
- # Proxy features
15
- feature = Feature.where(:name => 'Pulp').first_or_create
16
- if feature.nil? || feature.errors.any?
17
- fail "Unable to create proxy feature: #{format_errors feature}"
19
+ ["Pulp", "Pulp Node"].each do |input|
20
+ f = Feature.where(:name => input).first_or_create
21
+ fail "Unable to create proxy feature: #{format_errors f}" if f.nil? || f.errors.any?
22
+ end
18
23
  end
19
-
20
- ["Pulp", "Pulp Node"].each do |input|
21
- f = Feature.where(:name => input).first_or_create
22
- fail "Unable to create proxy feature: #{format_errors f}" if f.nil? || f.errors.any?
23
- end
24
-
25
- ::User.current = nil
@@ -3,40 +3,38 @@
3
3
  #
4
4
  # !!! PLEASE KEEP THIS SCRIPT IDEMPOTENT !!!
5
5
  #
6
- ::User.current = ::User.anonymous_api_admin
6
+ User.as(::User.anonymous_api_admin.login) do
7
+ # The notification names are used as humanized labels. These need to be
8
+ # translated as well as the description
9
+ N_('Host errata advisory')
10
+ N_('Sync errata')
11
+ N_('Promote errata')
7
12
 
8
- # The notification names are used as humanized labels. These need to be
9
- # translated as well as the description
10
- N_('Host errata advisory')
11
- N_('Sync errata')
12
- N_('Promote errata')
13
+ # Mail Notifications
14
+ notifications = [
15
+ {:name => :host_errata_advisory,
16
+ :description => N_('A summary of available and applicable errata for your hosts'),
17
+ :mailer => 'Katello::ErrataMailer',
18
+ :method => 'host_errata',
19
+ :subscription_type => 'report'
20
+ },
13
21
 
14
- # Mail Notifications
15
- notifications = [
16
- {:name => :host_errata_advisory,
17
- :description => N_('A summary of available and applicable errata for your hosts'),
18
- :mailer => 'Katello::ErrataMailer',
19
- :method => 'host_errata',
20
- :subscription_type => 'report'
21
- },
22
+ {:name => :sync_errata,
23
+ :description => N_('A summary of new errata after a repository is synchronized'),
24
+ :mailer => 'Katello::ErrataMailer',
25
+ :method => 'sync_errata',
26
+ :subscription_type => 'alert'
27
+ },
22
28
 
23
- {:name => :sync_errata,
24
- :description => N_('A summary of new errata after a repository is synchronized'),
25
- :mailer => 'Katello::ErrataMailer',
26
- :method => 'sync_errata',
27
- :subscription_type => 'alert'
28
- },
29
+ {:name => :promote_errata,
30
+ :description => N_('A post-promotion summary of hosts with installable errata'),
31
+ :mailer => 'Katello::ErrataMailer',
32
+ :method => 'promote_errata',
33
+ :subscription_type => 'alert'
34
+ }
35
+ ]
29
36
 
30
- {:name => :promote_errata,
31
- :description => N_('A post-promotion summary of hosts with installable errata'),
32
- :mailer => 'Katello::ErrataMailer',
33
- :method => 'promote_errata',
34
- :subscription_type => 'alert'
35
- }
36
- ]
37
-
38
- notifications.each do |notification|
39
- ::MailNotification.where(name: notification[:name]).first_or_create!(notification)
37
+ notifications.each do |notification|
38
+ ::MailNotification.where(name: notification[:name]).first_or_create!(notification)
39
+ end
40
40
  end
41
-
42
- ::User.current = nil
@@ -3,7 +3,6 @@
3
3
  #
4
4
  # !!! PLEASE KEEP THIS SCRIPT IDEMPOTENT !!!
5
5
  #
6
- ::User.current = ::User.anonymous_api_admin
7
-
8
- Setting.find_by(:name => "dynflow_enable_console").update_attributes!(:value => true) if Rails.env.development?
9
- ::User.current = nil
6
+ User.as(::User.anonymous_api_admin.login) do
7
+ Setting.find_by(:name => "dynflow_enable_console").update_attributes!(:value => true) if Rails.env.development?
8
+ end
@@ -4,16 +4,18 @@
4
4
  # !!! PLEASE KEEP THIS SCRIPT IDEMPOTENT !!!
5
5
  #
6
6
 
7
- Bookmark.without_auditing do
8
- bookmarks = [
9
- {:name => "list hypervisors", :query => 'hypervisor = true', :controller => "hosts"},
10
- {:name => "future", :query => 'starts > Today', :controller => "katello_subscriptions"},
11
- {:name => "expiring soon", :query => 'expires 30 days from now', :controller => "katello_subscriptions"}
12
- ]
7
+ User.as_anonymous_admin do
8
+ Bookmark.without_auditing do
9
+ bookmarks = [
10
+ {:name => "list hypervisors", :query => 'hypervisor = true', :controller => "hosts"},
11
+ {:name => "future", :query => 'starts > Today', :controller => "katello_subscriptions"},
12
+ {:name => "expiring soon", :query => 'expires 30 days from now', :controller => "katello_subscriptions"}
13
+ ]
13
14
 
14
- bookmarks.each do |input|
15
- next if audit_modified? Bookmark, input[:name], :controller => input[:controller]
16
- b = Bookmark.find_or_create_by({ :public => true }.merge(input))
17
- fail "Unable to create bookmark: #{format_errors b}" if b.nil? || b.errors.any?
15
+ bookmarks.each do |input|
16
+ next if SeedHelper.audit_modified? Bookmark, input[:name], :controller => input[:controller]
17
+ b = Bookmark.find_or_create_by({ :public => true }.merge(input))
18
+ fail "Unable to create bookmark: #{format_errors b}" if b.nil? || b.errors.any?
19
+ end
18
20
  end
19
21
  end
@@ -1,6 +1,6 @@
1
1
  angular.module('Bastion.activation-keys').config(['$stateProvider', function ($stateProvider) {
2
2
  $stateProvider.state('activation-keys', {
3
- url: '/activation_keys',
3
+ url: '/activation_keys?search',
4
4
  permission: 'view_activation_keys',
5
5
  template: '<div ui-view></div>',
6
6
  views: {
@@ -70,7 +70,7 @@
70
70
  </span>
71
71
 
72
72
  <div bst-form-buttons
73
- on-cancel="transitionTo('activation-keys ')"
73
+ on-cancel="transitionTo('activation-keys')"
74
74
  on-save="save(activationKey)"
75
75
  working="working">
76
76
  </div>
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @ngdoc service
3
+ * @name Bastion.architectures.factory:Architecture
4
+ *
5
+ * @requires BastionResource
6
+ *
7
+ * @description
8
+ * Provides a BastionResource for architectures.
9
+ */
10
+ angular.module('Bastion.architectures').factory('Architecture',
11
+ ['BastionResource', function (BastionResource) {
12
+ var resource = BastionResource('/api/v2/architectures/');
13
+ return resource;
14
+ }]
15
+ );