katello 3.0.2 → 3.1.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 (215) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/katello/sync_management/sync_management.js +14 -5
  3. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +4 -4
  4. data/app/controllers/katello/api/v2/activation_keys_controller.rb +2 -0
  5. data/app/controllers/katello/api/v2/api_controller.rb +1 -1
  6. data/app/controllers/katello/api/v2/content_uploads_controller.rb +1 -1
  7. data/app/controllers/katello/api/v2/content_view_puppet_modules_controller.rb +2 -12
  8. data/app/controllers/katello/api/v2/content_view_versions_controller.rb +4 -4
  9. data/app/controllers/katello/api/v2/content_views_controller.rb +2 -4
  10. data/app/controllers/katello/api/v2/environments_controller.rb +0 -16
  11. data/app/controllers/katello/api/v2/host_contents_controller.rb +9 -0
  12. data/app/controllers/katello/api/v2/host_errata_controller.rb +1 -1
  13. data/app/controllers/katello/api/v2/host_packages_controller.rb +1 -1
  14. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +25 -6
  15. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +3 -2
  16. data/app/controllers/katello/api/v2/repositories_controller.rb +6 -3
  17. data/app/controllers/katello/api/v2/sync_plans_controller.rb +2 -1
  18. data/app/controllers/katello/api/v2/systems_controller.rb +1 -13
  19. data/app/controllers/katello/application_controller.rb +15 -18
  20. data/app/controllers/katello/concerns/api/v2/hosts_controller_extensions.rb +11 -7
  21. data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +1 -1
  22. data/app/controllers/katello/concerns/authorization/api/v2/content_views_controller.rb +1 -1
  23. data/app/controllers/katello/concerns/organizations_controller_extensions.rb +1 -1
  24. data/app/controllers/katello/concerns/smart_proxies_controller_extensions.rb +2 -2
  25. data/app/helpers/katello/application_helper.rb +1 -1
  26. data/app/helpers/katello/concerns/settings_helper_extensions.rb +3 -2
  27. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +1 -1
  28. data/app/helpers/katello/katello_form_builder.rb +1 -1
  29. data/app/helpers/katello/katello_url_helper.rb +2 -2
  30. data/app/lib/actions/candlepin/candlepin_listening_service.rb +3 -3
  31. data/app/lib/actions/candlepin/consumer/remove_subscription.rb +6 -0
  32. data/app/lib/actions/candlepin/import_pool_handler.rb +2 -1
  33. data/app/lib/actions/katello/capsule_content/create_repos.rb +1 -1
  34. data/app/lib/actions/katello/capsule_content/sync.rb +4 -5
  35. data/app/lib/actions/katello/content_view/errata_mail.rb +1 -1
  36. data/app/lib/actions/katello/content_view/presenters/incremental_updates_presenter.rb +1 -1
  37. data/app/lib/actions/katello/content_view/promote.rb +8 -3
  38. data/app/lib/actions/katello/content_view/publish.rb +8 -3
  39. data/app/lib/actions/katello/content_view/remove.rb +2 -2
  40. data/app/lib/actions/katello/content_view_version/incremental_update.rb +1 -1
  41. data/app/lib/actions/katello/host/erratum/applicable_errata_install.rb +1 -1
  42. data/app/lib/actions/katello/host/generate_applicability.rb +1 -1
  43. data/app/lib/actions/katello/host/hypervisors_update.rb +23 -5
  44. data/app/lib/actions/katello/host/register.rb +2 -11
  45. data/app/lib/actions/katello/host/remove_subscriptions.rb +1 -1
  46. data/app/lib/actions/katello/host/update.rb +1 -1
  47. data/app/lib/actions/katello/host/update_content_view.rb +5 -1
  48. data/app/lib/actions/katello/repository/errata_mail.rb +1 -1
  49. data/app/lib/actions/katello/repository/export.rb +1 -1
  50. data/app/lib/actions/katello/repository/sync.rb +2 -0
  51. data/app/lib/actions/pulp/abstract_async_task.rb +1 -1
  52. data/app/lib/actions/pulp/abstract_async_task_group.rb +76 -0
  53. data/app/lib/actions/pulp/consumer/create.rb +1 -1
  54. data/app/lib/actions/pulp/repos/update.rb +2 -1
  55. data/app/lib/actions/pulp/repository/associate_importer.rb +4 -0
  56. data/app/lib/actions/pulp/repository/import_upload.rb +0 -4
  57. data/app/lib/actions/pulp/repository/refresh.rb +7 -18
  58. data/app/lib/actions/pulp/repository/regenerate_applicability.rb +2 -2
  59. data/app/lib/actions/pulp/repository/sync.rb +1 -1
  60. data/app/lib/actions/pulp/repository/update_importer.rb +4 -0
  61. data/app/lib/katello/api/v2/error_handling.rb +1 -1
  62. data/app/lib/katello/bulk_actions.rb +7 -8
  63. data/app/lib/katello/capsule_content.rb +11 -11
  64. data/app/lib/katello/errors.rb +2 -0
  65. data/app/lib/katello/glue/queue.rb +1 -1
  66. data/app/lib/katello/resources/candlepin.rb +3 -3
  67. data/app/lib/katello/resources/cdn.rb +1 -1
  68. data/app/lib/katello/util/cdn_var_substitutor.rb +1 -1
  69. data/app/lib/katello/util/package.rb +1 -1
  70. data/app/lib/katello/util/package_filter.rb +4 -4
  71. data/app/lib/katello/util/search.rb +3 -3
  72. data/app/lib/katello/validators/content_view_puppet_module_validator.rb +20 -14
  73. data/app/models/katello/activation_key.rb +4 -4
  74. data/app/models/katello/concerns/content_facet_host_extensions.rb +2 -2
  75. data/app/models/katello/concerns/host_managed_extensions.rb +6 -2
  76. data/app/models/katello/concerns/operatingsystem_extensions.rb +2 -2
  77. data/app/models/katello/concerns/organization_extensions.rb +5 -1
  78. data/app/models/katello/concerns/smart_proxy_extensions.rb +2 -13
  79. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +27 -2
  80. data/app/models/katello/content_view.rb +5 -5
  81. data/app/models/katello/content_view_erratum_filter_rule.rb +3 -3
  82. data/app/models/katello/content_view_filter.rb +3 -3
  83. data/app/models/katello/content_view_history.rb +4 -4
  84. data/app/models/katello/content_view_repository.rb +1 -1
  85. data/app/models/katello/erratum.rb +14 -10
  86. data/app/models/katello/glue.rb +0 -2
  87. data/app/models/katello/glue/candlepin/consumer.rb +4 -4
  88. data/app/models/katello/glue/candlepin/content.rb +2 -2
  89. data/app/models/katello/glue/candlepin/pool.rb +6 -0
  90. data/app/models/katello/glue/candlepin/product.rb +1 -1
  91. data/app/models/katello/glue/provider.rb +1 -1
  92. data/app/models/katello/glue/pulp/consumer.rb +3 -3
  93. data/app/models/katello/glue/pulp/repo.rb +26 -31
  94. data/app/models/katello/glue/pulp/repos.rb +1 -1
  95. data/app/models/katello/host/content_facet.rb +6 -1
  96. data/app/models/katello/host/subscription_facet.rb +1 -8
  97. data/app/models/katello/host_collection.rb +1 -82
  98. data/app/models/katello/hypervisor.rb +1 -1
  99. data/app/models/katello/kt_environment.rb +3 -2
  100. data/app/models/katello/package_group.rb +2 -2
  101. data/app/models/katello/ping.rb +4 -4
  102. data/app/models/katello/provider.rb +8 -1
  103. data/app/models/katello/pulp_sync_status.rb +7 -7
  104. data/app/models/katello/pulp_task_status.rb +1 -1
  105. data/app/models/katello/repository.rb +6 -6
  106. data/app/models/katello/rhsm_fact_parser.rb +0 -9
  107. data/app/models/katello/sync_plan.rb +14 -21
  108. data/app/models/katello/system.rb +6 -12
  109. data/app/models/katello/task_status.rb +3 -24
  110. data/app/models/setting/{katello.rb → content.rb} +10 -2
  111. data/app/overrides/add_about_page.rb +3 -3
  112. data/app/overrides/add_organization_attributes.rb +2 -2
  113. data/app/overrides/add_subscription_status.rb +1 -1
  114. data/app/services/katello/candlepin/consumer.rb +8 -8
  115. data/app/services/katello/pulp/consumer.rb +1 -1
  116. data/app/services/katello/pulp/consumer_group.rb +3 -3
  117. data/app/services/katello/pulp/docker_manifest.rb +1 -1
  118. data/app/services/katello/pulp/erratum.rb +1 -1
  119. data/app/services/katello/pulp/ostree_branch.rb +1 -1
  120. data/app/services/katello/pulp/package_group.rb +1 -1
  121. data/app/services/katello/pulp/puppet_module.rb +1 -1
  122. data/app/services/katello/pulp/rpm.rb +3 -3
  123. data/app/services/katello/puppet_class_importer_extensions.rb +1 -1
  124. data/app/views/dashboard/_subscription_status_widget.html.erb +1 -1
  125. data/app/views/foreman/smart_proxies/_content_sync.html.erb +1 -1
  126. data/app/views/foreman/unattended/finish-katello.erb +2 -2
  127. data/app/views/foreman/unattended/kickstart-katello.erb +2 -2
  128. data/app/views/foreman/unattended/userdata-katello.erb +2 -0
  129. data/app/views/katello/api/v2/common/_syncable.json.rabl +1 -1
  130. data/app/views/katello/api/v2/errata/show.json.rabl +2 -2
  131. data/app/views/katello/api/v2/{systems/releases.json.rabl → host_subscriptions/available_release_versions.json.rabl} +0 -0
  132. data/app/views/katello/api/v2/products/base.json.rabl +0 -19
  133. data/app/views/katello/api/v2/products/show.json.rabl +21 -2
  134. data/app/views/katello/api/v2/subscription_facet/base_with_root.json.rabl +2 -1
  135. data/app/views/katello/api/v2/subscriptions/show.json.rabl +19 -17
  136. data/config/katello.yml +242 -0
  137. data/config/routes/api/v2.rb +7 -6
  138. data/config/routes/overrides.rb +10 -5
  139. data/db/migrate/20140117160939_refactor_content_views.rb +4 -4
  140. data/db/migrate/20140318174203_drop_cdn_import_success_column.rb +1 -1
  141. data/db/migrate/20140404122011_drop_repositories_enabled_column.rb +1 -1
  142. data/db/migrate/20140610083129_add_pulp_proxy_to_host.rb +1 -1
  143. data/db/migrate/20140930170628_add_errata.rb +1 -1
  144. data/db/migrate/20141222151001_add_host_content_view_environment.rb +1 -1
  145. data/db/migrate/20150602153756_remove_user_notices.rb +1 -1
  146. data/db/migrate/20150602153757_remove_notices.rb +2 -2
  147. data/db/migrate/20150930183738_migrate_content_hosts.rb +1 -1
  148. data/db/migrate/20160203195736_remove_docker_image_schema.rb +3 -1
  149. data/db/migrate/20160505181337_rename_katello_settings.rb +9 -0
  150. data/db/migrate/20160520175340_add_host_applicable_package.rb +8 -0
  151. data/db/migrate/20160605160933_remove_jobs.rb +25 -0
  152. data/db/migrate/20160605162929_remove_system_smart_proxy.rb +5 -0
  153. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-associations.controller.js +14 -5
  154. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-associations-content-hosts.html +8 -8
  155. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-action-packages.controller.js +16 -4
  156. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/bulk-actions-packages.html +27 -2
  157. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts-helper.service.js +17 -19
  158. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +1 -2
  159. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages.controller.js +1 -0
  160. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages.html +2 -0
  161. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details-info.controller.js +3 -3
  162. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +1 -1
  163. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +4 -4
  164. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-provisioning-info.html +1 -1
  165. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-subscriptions.html +2 -2
  166. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts-table-collapsed.html +1 -1
  167. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts-table-full.html +1 -1
  168. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +1 -1
  169. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-versions.controller.js +0 -1
  170. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js +1 -1
  171. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/views/gpg-key-details.html +6 -6
  172. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/gpg-keys.controller.js +3 -3
  173. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/gpg-keys.module.js +7 -7
  174. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/new/new-gpg-key.controller.js +1 -1
  175. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/new/views/gpg-key-new.html +2 -2
  176. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/views/gpg-keys.html +1 -1
  177. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-subscription.factory.js +2 -1
  178. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/katello-features.run.js +5 -5
  179. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/check-current-organization.run.js +2 -2
  180. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js +2 -1
  181. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-associations-content-hosts.controller.js +1 -1
  182. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-associations-content-hosts.html +1 -1
  183. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-import.controller.js +3 -0
  184. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/new/views/new-sync-plan-form.html +1 -0
  185. data/engines/bastion_katello/lib/bastion_katello/version.rb +1 -1
  186. data/lib/katello.rb +0 -1
  187. data/lib/katello/engine.rb +12 -8
  188. data/lib/katello/permissions/content_host_permissions.rb +1 -1
  189. data/lib/katello/tasks/clean_backend_objects.rake +5 -6
  190. data/lib/katello/tasks/delete_orphaned_content.rake +1 -1
  191. data/lib/katello/tasks/jenkins.rake +1 -3
  192. data/lib/katello/tasks/jshint.rake +28 -29
  193. data/lib/katello/tasks/jsroutes.rake +2 -2
  194. data/lib/katello/tasks/regenerate_repo_metadata.rake +3 -5
  195. data/lib/katello/tasks/reindex.rake +17 -16
  196. data/lib/katello/tasks/rubocop.rake +1 -3
  197. data/lib/katello/tasks/setup.rake +3 -4
  198. data/lib/katello/tasks/test.rake +8 -23
  199. data/lib/katello/tasks/upgrades/2.4/import_distributions.rake +1 -2
  200. data/lib/katello/tasks/upgrades/2.4/import_package_groups.rake +1 -2
  201. data/lib/katello/tasks/upgrades/2.4/import_puppet_modules.rake +1 -2
  202. data/lib/katello/tasks/upgrades/2.4/import_rpms.rake +1 -1
  203. data/lib/katello/tasks/upgrades/2.4/import_subscriptions.rake +1 -2
  204. data/lib/katello/tasks/upgrades/3.0/add_export_distributor.rake +1 -1
  205. data/lib/katello/tasks/upgrades/3.0/update_subscription_facet_backend_data.rake +1 -1
  206. data/lib/katello/tasks/yard.rake +2 -2
  207. data/lib/katello/version.rb +1 -1
  208. metadata +14 -15
  209. data/app/models/katello/job.rb +0 -197
  210. data/app/models/katello/job_task.rb +0 -10
  211. data/app/views/katello/api/v2/systems_bulk_actions/applicable_errata.json.rabl +0 -7
  212. data/app/views/katello/api/v2/systems_bulk_actions/available_incremental_updates.json.rabl +0 -21
  213. data/app/views/katello/api/v2/systems_bulk_actions/erratum.json.rabl +0 -7
  214. data/app/views/katello/api/v2/systems_bulk_actions/job.json.rabl +0 -1
  215. data/db/migrate/20160619223332_fix_viewer_role.rb +0 -41
@@ -155,6 +155,7 @@ Katello::Engine.routes.draw do
155
155
  api_resources :activation_keys, :only => [:index]
156
156
  api_resources :content_views, :only => [:index, :create]
157
157
  api_resources :environments, :only => [:index, :show, :create, :update, :destroy] do
158
+ api_resources :repositories, :only => [:index]
158
159
  collection do
159
160
  get :paths
160
161
  get :auto_complete_search
@@ -239,14 +240,9 @@ Katello::Engine.routes.draw do
239
240
  end
240
241
 
241
242
  api_resources :systems, :only => [:index, :show, :create, :update, :destroy] do
242
- member do
243
- get :releases
244
- end
245
243
  collection do
246
244
  get :auto_complete_search
247
245
  end
248
- api_resources :activation_keys, :only => [:index]
249
- api_resources :host_collections, :only => [:index]
250
246
  api_resources :products, :only => [:index]
251
247
  end
252
248
 
@@ -344,7 +340,9 @@ Katello::Engine.routes.draw do
344
340
 
345
341
  api_resources :environments, :only => [] do
346
342
  api_resources :products, :only => [:index] do
347
- get :repositories, :on => :member
343
+ api_resources :repositories, :only => [:index] do
344
+ get :index, :on => :member
345
+ end
348
346
  end
349
347
 
350
348
  api_resources :content_views, :only => [:index]
@@ -356,6 +354,9 @@ Katello::Engine.routes.draw do
356
354
  end
357
355
 
358
356
  api_resources :products, :only => [] do
357
+ api_resources :repositories, :only => [:index] do
358
+ get :index, :on => :member
359
+ end
359
360
  get :repositories, :on => :member
360
361
  api_resources :sync, :only => [:index] do
361
362
  delete :index, :on => :collection, :action => :cancel
@@ -1,21 +1,25 @@
1
1
  module Katello
2
2
  class WhitelistConstraint
3
- PATHS ||= [%r{\A/api/v2/organizations/\S+/parameters}]
3
+ PATHS ||= [%r{\A/api/v2/organizations/\S+/parameters}].freeze
4
4
 
5
5
  def matches?(request)
6
- PATHS.map { |path| request.env["REQUEST_PATH"].match(path) }.any? ? false : true
6
+ PATHS.map { |path| request.env["REQUEST_PATH"].try(:match, path) }.any? ? false : true
7
7
  end
8
8
  end
9
9
  end
10
10
 
11
11
  Foreman::Application.routes.draw do
12
- override_message = '{"message": "Route forbidden by Katello, check katello/config/routes/overrides"}'
12
+ override_message = '{"message": "Route overriden by Katello, use the /katello API endpoint instead. See /apidoc for more details."}'
13
13
 
14
14
  match "/api/v2/organizations/*all", :to => proc { [404, {}, [override_message]] },
15
- :via => :get,
15
+ :via => :put,
16
16
  :constraints => Katello::WhitelistConstraint.new
17
17
 
18
- match "/api/v1/organizations/:id", via: :delete, to: proc { [404, {}, [override_message]] }
18
+ match "/api/v2/organizations", :to => proc { [404, {}, [override_message]] },
19
+ :via => :post,
20
+ :constraints => Katello::WhitelistConstraint.new
21
+
22
+ match "/api/v2/organizations/:id", via: :delete, to: proc { [404, {}, [override_message]] }
19
23
 
20
24
  resources :hosts, :only => [] do
21
25
  get 'puppet_environment_for_content_view', :on => :collection
@@ -79,6 +83,7 @@ Foreman::Application.routes.draw do
79
83
  put :auto_attach
80
84
  get :product_content
81
85
  get :events
86
+ get :available_release_versions
82
87
  put :content_override
83
88
  put :remove_subscriptions
84
89
  put :add_subscriptions
@@ -45,12 +45,12 @@ class RefactorContentViews < ActiveRecord::Migration
45
45
  def down
46
46
  create_table "katello_content_view_definition_bases", :force => true do |t|
47
47
  t.string "name", :limit => 255
48
- t.string "label", :null => false, :limit => 255
48
+ t.string "label", :null => false, :limit => 255
49
49
  t.text "description"
50
50
  t.integer "organization_id"
51
51
  t.datetime "created_at", :null => false
52
52
  t.datetime "updated_at", :null => false
53
- t.boolean "composite", :default => false, :null => false
53
+ t.boolean "composite", :default => false, :null => false
54
54
  t.string "type", :limit => 255
55
55
  t.integer "source_id"
56
56
  end
@@ -70,8 +70,8 @@ class RefactorContentViews < ActiveRecord::Migration
70
70
  create_table "katello_filter_rules", :force => true do |t|
71
71
  t.string "type", :limit => 255
72
72
  t.text "parameters"
73
- t.integer "filter_id", :null => false
74
- t.boolean "inclusion", :default => true
73
+ t.integer "filter_id", :null => false
74
+ t.boolean "inclusion", :default => true
75
75
  t.datetime "created_at", :null => false
76
76
  t.datetime "updated_at", :null => false
77
77
  end
@@ -4,6 +4,6 @@ class DropCdnImportSuccessColumn < ActiveRecord::Migration
4
4
  end
5
5
 
6
6
  def down
7
- add_column :katello_products, "cdn_import_success", :boolean, :default => true, :null => false
7
+ add_column :katello_products, "cdn_import_success", :boolean, :default => true, :null => false
8
8
  end
9
9
  end
@@ -4,6 +4,6 @@ class DropRepositoriesEnabledColumn < ActiveRecord::Migration
4
4
  end
5
5
 
6
6
  def down
7
- add_column :katello_repositories, :enabled, :boolean, :default => true
7
+ add_column :katello_repositories, :enabled, :boolean, :default => true
8
8
  end
9
9
  end
@@ -6,7 +6,7 @@ class AddPulpProxyToHost < ActiveRecord::Migration
6
6
  add_index :hosts, :content_source_id
7
7
  add_index :hostgroups, :content_source_id
8
8
 
9
- add_foreign_key :hosts, :smart_proxies, :name => "hosts_content_source_id_fk", :column => "content_source_id"
9
+ add_foreign_key :hosts, :smart_proxies, :name => "hosts_content_source_id_fk", :column => "content_source_id"
10
10
  add_foreign_key :hostgroups, :smart_proxies, :name => "hostgroups_content_source_id_fk", :column => "content_source_id"
11
11
  end
12
12
  end
@@ -26,7 +26,7 @@ class AddErrata < ActiveRecord::Migration
26
26
  end
27
27
 
28
28
  add_index :katello_erratum_packages, [:erratum_id, :nvrea, :name, :filename], :unique => true,
29
- :name => 'katello_erratum_packages_eid_nvrea_n_f'
29
+ :name => 'katello_erratum_packages_eid_nvrea_n_f'
30
30
  add_foreign_key "katello_erratum_packages", "katello_errata",
31
31
  :name => "katello_erratum_packages_errata_id_fk", :column => "erratum_id"
32
32
 
@@ -8,7 +8,7 @@ class AddHostContentViewEnvironment < ActiveRecord::Migration
8
8
 
9
9
  [Hostgroup, Host::Managed].each do |model|
10
10
  model.find_each do |host|
11
- lifecycle_environment = host.environment.try(:lifecycle_environment)
11
+ lifecycle_environment = host.environment.try(:lifecycle_environment)
12
12
  content_view = host.environment.try(:content_view)
13
13
  if lifecycle_environment && content_view
14
14
  host.update_column(:content_view_id, content_view.id)
@@ -7,7 +7,7 @@ class RemoveUserNotices < ActiveRecord::Migration
7
7
  create_table "katello_user_notices", :force => true do |t|
8
8
  t.integer "user_id"
9
9
  t.integer "notice_id"
10
- t.boolean "viewed", :default => false, :null => false
10
+ t.boolean "viewed", :default => false, :null => false
11
11
  end
12
12
 
13
13
  add_index "katello_user_notices", ["notice_id"], :name => "index_user_notices_on_notice_id"
@@ -5,9 +5,9 @@ class RemoveNotices < ActiveRecord::Migration
5
5
 
6
6
  def down
7
7
  create_table "katello_notices", :force => true do |t|
8
- t.string "text", :limit => 1024, :null => false
8
+ t.string "text", :limit => 1024, :null => false
9
9
  t.text "details"
10
- t.boolean "global", :default => false, :null => false
10
+ t.boolean "global", :default => false, :null => false
11
11
  t.string "level", :null => false, :limit => 255
12
12
  t.datetime "created_at", :null => false
13
13
  t.datetime "updated_at", :null => false
@@ -325,7 +325,7 @@ class MigrateContentHosts < ActiveRecord::Migration
325
325
  if hostname.nil?
326
326
  logger.warn("Content host #{system.uuid} does not have a hostname, removing.")
327
327
  unregister_system(system)
328
- next
328
+ break
329
329
  end
330
330
 
331
331
  MigrateContentHosts::Host.reset_column_information
@@ -1,6 +1,8 @@
1
1
  class RemoveDockerImageSchema < ActiveRecord::Migration
2
2
  def up
3
- remove_foreign_key :katello_docker_tags, :name => "katello_docker_tags_docker_image_id_fk"
3
+ if foreign_key_exists?(:katello_docker_tags, :name => "katello_docker_tags_docker_image_id_fk")
4
+ remove_foreign_key :katello_docker_tags, :name => "katello_docker_tags_docker_image_id_fk"
5
+ end
4
6
  remove_column :katello_docker_tags, :docker_image_id
5
7
  drop_table :katello_repository_docker_images
6
8
  drop_table :katello_docker_images
@@ -0,0 +1,9 @@
1
+ class RenameKatelloSettings < ActiveRecord::Migration
2
+ def up
3
+ Setting.where(category: 'Setting::Katello').update_all(:category => 'Setting::Content')
4
+ end
5
+
6
+ def down
7
+ Setting.where(category: 'Setting::Content').update_all(:category => 'Setting::Katello')
8
+ end
9
+ end
@@ -0,0 +1,8 @@
1
+ class AddHostApplicablePackage < ActiveRecord::Migration
2
+ def change
3
+ create_table "katello_content_facet_applicable_rpms" do |t|
4
+ t.references 'content_facet', :null => false
5
+ t.references 'rpm', :null => false
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,25 @@
1
+ class RemoveJobs < ActiveRecord::Migration
2
+ def up
3
+ drop_table :katello_job_tasks
4
+ drop_table :katello_jobs
5
+ end
6
+
7
+ def down
8
+ create_table "katello_job_tasks", force: :cascade do |t|
9
+ t.integer "job_id"
10
+ t.integer "task_status_id"
11
+ end
12
+
13
+ add_index "katello_job_tasks", ["job_id"], name: "index_job_tasks_on_job_id", using: :btree
14
+ add_index "katello_job_tasks", ["task_status_id"], name: "index_job_tasks_on_task_status_id", using: :btree
15
+
16
+ create_table "katello_jobs", force: :cascade do |t|
17
+ t.integer "job_owner_id"
18
+ t.string "job_owner_type", limit: 255
19
+ t.string "pulp_id", limit: 255, null: false
20
+ end
21
+
22
+ add_index "katello_jobs", ["job_owner_id"], name: "index_jobs_on_job_owner_id", using: :btree
23
+ add_index "katello_jobs", ["pulp_id"], name: "index_jobs_on_pulp_id", using: :btree
24
+ end
25
+ end
@@ -0,0 +1,5 @@
1
+ class RemoveSystemSmartProxy < ActiveRecord::Migration
2
+ def change
3
+ remove_column :smart_proxies, :content_host_id, :integer
4
+ end
5
+ end
@@ -14,8 +14,8 @@
14
14
  * Provides the functionality for activation key associations.
15
15
  */
16
16
  angular.module('Bastion.activation-keys').controller('ActivationKeyAssociationsController',
17
- ['$scope', '$location', 'translate', 'Nutupane', 'ActivationKey', 'ContentHostsHelper', 'CurrentOrganization',
18
- function ($scope, $location, translate, Nutupane, ActivationKey, ContentHostsHelper, CurrentOrganization) {
17
+ ['$scope', '$location', 'translate', 'Nutupane', 'ActivationKey', 'ContentHostsHelper', 'CurrentOrganization', 'Host',
18
+ function ($scope, $location, translate, Nutupane, ActivationKey, ContentHostsHelper, CurrentOrganization, Host) {
19
19
  var contentHostsNutupane, params = {
20
20
  'organization_id': CurrentOrganization,
21
21
  'search': $location.search().search || "",
@@ -31,17 +31,26 @@ angular.module('Bastion.activation-keys').controller('ActivationKeyAssociationsC
31
31
  $scope.table.working = false;
32
32
  }
33
33
 
34
- contentHostsNutupane = new Nutupane(ActivationKey, params, 'contentHosts');
34
+ contentHostsNutupane = new Nutupane(Host, params);
35
+ contentHostsNutupane.searchTransform = function (term) {
36
+ var searchQuery, addition = "activation_key_id=" + $scope.$stateParams.activationKeyId;
37
+ if (term === "" || angular.isUndefined(term)) {
38
+ searchQuery = addition;
39
+ } else {
40
+ searchQuery = term + " and " + addition;
41
+ }
42
+ return searchQuery;
43
+ };
44
+
35
45
  contentHostsNutupane.masterOnly = true;
36
46
  $scope.detailsTable = contentHostsNutupane.table;
37
47
 
38
48
  $scope.activationKey.$promise.then(function () {
39
- params.id = $scope.activationKey.id;
40
49
  contentHostsNutupane.setParams(params);
41
50
  contentHostsNutupane.load();
42
51
  });
43
52
 
44
- $scope.getSubscriptionStatusColor = ContentHostsHelper.getSubscriptionStatusColor;
53
+ $scope.getHostStatusIcon = ContentHostsHelper.getHostStatusIcon;
45
54
 
46
55
  $scope.memory = ContentHostsHelper.memory;
47
56
  }]
@@ -26,21 +26,21 @@
26
26
  </thead>
27
27
 
28
28
  <tbody>
29
- <tr bst-table-row ng-repeat="contentHost in detailsTable.rows"
29
+ <tr bst-table-row ng-repeat="host in detailsTable.rows"
30
30
  ng-controller="ContentHostStatusController">
31
31
  <td bst-table-cell>
32
- <a ui-sref="content-hosts.details.info({hostId: contentHost.host_id})">
33
- {{ contentHost.name }}
32
+ <a ui-sref="content-hosts.details.info({hostId: host.host_id})">
33
+ {{ host.name }}
34
34
  </a>
35
35
  </td>
36
36
  <td bst-table-cell>
37
- <span class="fa fa-circle" ng-class="getSubscriptionStatusColor(contentHost.entitlementStatus)">
37
+ <span ng-class="getHostStatusIcon(host.subscription_global_status)">
38
38
  </span>
39
39
  </td>
40
- <td bst-table-cell>{{ contentHost.environment.name }}</td>
41
- <td bst-table-cell>{{ contentHost.content_view.name || "" }}</td>
42
- <td bst-table-cell>{{ contentHost.service_level }}</td>
43
- <td bst-table-cell>{{ contentHost.release_ver }}</td>
40
+ <td bst-table-cell>{{ host.environment.name }}</td>
41
+ <td bst-table-cell>{{ host.content_view.name || "" }}</td>
42
+ <td bst-table-cell>{{ host.service_level }}</td>
43
+ <td bst-table-cell>{{ host.release_ver }}</td>
44
44
  </tr>
45
45
  </tbody>
46
46
  </table>
@@ -21,9 +21,10 @@ angular.module('Bastion.content-hosts').controller('ContentHostsBulkActionPackag
21
21
 
22
22
  function successMessage(type) {
23
23
  var messages = {
24
- install: translate("Succesfully scheduled package installation"),
25
- update: translate("Succesfully scheduled package update"),
26
- remove: translate("Succesfully scheduled package removal")
24
+ install: translate("Successfully scheduled package installation"),
25
+ update: translate("Successfully scheduled package update"),
26
+ remove: translate("Successfully scheduled package removal"),
27
+ "update all": translate("Successfully scheduled an update of all packages")
27
28
  };
28
29
  return messages[type];
29
30
  }
@@ -31,7 +32,12 @@ angular.module('Bastion.content-hosts').controller('ContentHostsBulkActionPackag
31
32
  function installParams() {
32
33
  var params = $scope.nutupane.getAllSelectedResults();
33
34
  params['content_type'] = $scope.content.contentType;
34
- params.content = $scope.content.content.split(/ *, */);
35
+ if ($scope.content.action === "update all") {
36
+ params['update_all'] = true;
37
+ params.content = null;
38
+ } else {
39
+ params.content = $scope.content.content.split(/ *, */);
40
+ }
35
41
  params['organization_id'] = CurrentOrganization;
36
42
  return params;
37
43
  }
@@ -102,6 +108,8 @@ angular.module('Bastion.content-hosts').controller('ContentHostsBulkActionPackag
102
108
  HostBulkAction.updateContent(params, success, error);
103
109
  } else if ($scope.content.action === "remove") {
104
110
  HostBulkAction.removeContent(params, success, error);
111
+ } else if ($scope.content.action === "update all") {
112
+ HostBulkAction.updateContent(params, success, error);
105
113
  }
106
114
 
107
115
  return deferred.promise;
@@ -117,6 +125,10 @@ angular.module('Bastion.content-hosts').controller('ContentHostsBulkActionPackag
117
125
  action = $scope.content.action;
118
126
  }
119
127
 
128
+ if (action === "update all") {
129
+ action = "update";
130
+ }
131
+
120
132
  if ($scope.content.contentType === 'package_group') {
121
133
  $scope.packageActionFormValues.remoteAction = 'group_' + action;
122
134
  } else if ($scope.content.contentType === 'package') {
@@ -4,6 +4,28 @@
4
4
  <section>
5
5
  <h4 translate>Content Host Package Management</h4>
6
6
 
7
+ <span class="input-group-btn">
8
+ <button class="btn btn-default"
9
+ type="button"
10
+ translate
11
+ ng-hide="denied('edit_hosts')"
12
+ ng-click="confirmContentAction('update all', content)"
13
+ ng-disabled="(table.numSelected === 0)">
14
+ Update All Packages
15
+ </button>
16
+ <button class="btn btn-default dropdown-toggle"
17
+ ng-hide="!remoteExecutionPresent"
18
+ ng-disabled="(table.numSelected === 0) || !packageActionForm.$valid || content.confirm"
19
+ type="button" id="update-all-use-remote-execution" data-toggle="dropdown">
20
+ <span class="caret"></span>
21
+ </button>
22
+ <ul class="dropdown-menu" role="menu" aria-labelledby="install-use-remote-execution">
23
+ <li role="presentation"><a ng-click="performViaKatelloAgent('update all', content)" role="menuitem" tabindex="-1" href="#" translate>via Katello Agent</a></li>
24
+ <li role="presentation"><a ng-click="performViaRemoteExecution('update all', false)" role="menuitem" tabindex="-1" href="#" translate>via remote execution</a></li>
25
+ <li role="presentation"><a ng-click="performViaRemoteExecution('update all', true)" role="menuitem" tabindex="-1" href="#" translate>via remote execution - customize first</a></li>
26
+ </ul>
27
+ </span>
28
+
7
29
  <form id="packageActionForm" name="packageActionForm" class="form" method="post" action="/katello/remote_execution">
8
30
  <input type="hidden" name="name" ng-value="content.content"/>
9
31
  <input type="hidden" name="remote_action" ng-value="packageActionFormValues.remoteAction"/>
@@ -13,7 +35,7 @@
13
35
  <input type="hidden" name="customize" ng-value="packageActionFormValues.customize"/>
14
36
  </form>
15
37
 
16
- <form name="systemContentForm" class="form" ng-hide="content.workingMode || denied('edit_hosts')">
38
+ <form name="systemContentForm" class="form" ng-hide="content.workingMode || denied('edit_hosts')" novalidate>
17
39
 
18
40
  <div>
19
41
  <input id="package" type="radio"
@@ -117,9 +139,12 @@
117
139
  <div class="confirmation_text" ng-show="content.action == 'remove'" translate>
118
140
  Are you sure you want to remove {{ content.content }} from the {{ getSelectedSystemIds().length }} system(s) selected?
119
141
  </div>
142
+ <div class="confirmation_text" ng-show="content.action == 'update all'" translate>
143
+ Are you sure you want to update all packages on the {{ getSelectedSystemIds().length }} system(s) selected?
144
+ </div>
120
145
 
121
146
  <button class="btn btn-default" ng-click="performContentAction()" translate>Yes</button>
122
- <button class="btn btn-default" ng-click="content.confirm = false" translate>No</button>
147
+ <button type="button" class="btn btn-default" ng-click="content.confirm = false" translate>No</button>
123
148
  </div>
124
149
 
125
150
  </form>
@@ -7,28 +7,26 @@
7
7
  */
8
8
  angular.module('Bastion.content-hosts').service('ContentHostsHelper',
9
9
  function () {
10
- this.getSubscriptionStatusColor = function (status) {
10
+ this.getHostStatusIcon = function (globalStatus) {
11
+ var icons;
11
12
  var colors = {
12
- 'valid': 'green',
13
- 'partial': 'yellow',
14
- 'invalid': 'red',
15
- 0: 'green',
16
- 1: 'yellow',
17
- 2: 'red',
18
- 3: 'red'
19
- };
13
+ // we can remove 'valid', 'partial', and 'invalid' when http://projects.theforeman.org/issues/15347 is fixed
14
+ 'valid': 'green',
15
+ 'partial': 'yellow',
16
+ 'invalid': 'red',
17
+ 0: 'green',
18
+ 1: 'yellow',
19
+ 2: 'red'
20
+ };
20
21
 
21
- return colors[status] ? colors[status] : 'red';
22
- };
23
-
24
- this.getGlobalStatusColor = function (status) {
25
- var colors = {
26
- 0: 'green',
27
- 1: 'yellow',
28
- 2: 'red'
29
- };
22
+ globalStatus = colors[globalStatus] || "red";
23
+ icons = {
24
+ 'green': globalStatus + ' host-status pficon pficon-ok status-ok',
25
+ 'yellow': globalStatus + ' host-status pficon pficon-info status-warn',
26
+ 'red': globalStatus + ' host-status pficon pficon-error-circle-o status-error'
27
+ };
30
28
 
31
- return colors[status] ? colors[status] : 'red';
29
+ return icons[globalStatus];
32
30
  };
33
31
  }
34
32
  );