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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/katello/sync_management/sync_management.js +14 -5
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +4 -4
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +2 -0
- data/app/controllers/katello/api/v2/api_controller.rb +1 -1
- data/app/controllers/katello/api/v2/content_uploads_controller.rb +1 -1
- data/app/controllers/katello/api/v2/content_view_puppet_modules_controller.rb +2 -12
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +4 -4
- data/app/controllers/katello/api/v2/content_views_controller.rb +2 -4
- data/app/controllers/katello/api/v2/environments_controller.rb +0 -16
- data/app/controllers/katello/api/v2/host_contents_controller.rb +9 -0
- data/app/controllers/katello/api/v2/host_errata_controller.rb +1 -1
- data/app/controllers/katello/api/v2/host_packages_controller.rb +1 -1
- data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +25 -6
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +3 -2
- data/app/controllers/katello/api/v2/repositories_controller.rb +6 -3
- data/app/controllers/katello/api/v2/sync_plans_controller.rb +2 -1
- data/app/controllers/katello/api/v2/systems_controller.rb +1 -13
- data/app/controllers/katello/application_controller.rb +15 -18
- data/app/controllers/katello/concerns/api/v2/hosts_controller_extensions.rb +11 -7
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +1 -1
- data/app/controllers/katello/concerns/authorization/api/v2/content_views_controller.rb +1 -1
- data/app/controllers/katello/concerns/organizations_controller_extensions.rb +1 -1
- data/app/controllers/katello/concerns/smart_proxies_controller_extensions.rb +2 -2
- data/app/helpers/katello/application_helper.rb +1 -1
- data/app/helpers/katello/concerns/settings_helper_extensions.rb +3 -2
- data/app/helpers/katello/hosts_and_hostgroups_helper.rb +1 -1
- data/app/helpers/katello/katello_form_builder.rb +1 -1
- data/app/helpers/katello/katello_url_helper.rb +2 -2
- data/app/lib/actions/candlepin/candlepin_listening_service.rb +3 -3
- data/app/lib/actions/candlepin/consumer/remove_subscription.rb +6 -0
- data/app/lib/actions/candlepin/import_pool_handler.rb +2 -1
- data/app/lib/actions/katello/capsule_content/create_repos.rb +1 -1
- data/app/lib/actions/katello/capsule_content/sync.rb +4 -5
- data/app/lib/actions/katello/content_view/errata_mail.rb +1 -1
- data/app/lib/actions/katello/content_view/presenters/incremental_updates_presenter.rb +1 -1
- data/app/lib/actions/katello/content_view/promote.rb +8 -3
- data/app/lib/actions/katello/content_view/publish.rb +8 -3
- data/app/lib/actions/katello/content_view/remove.rb +2 -2
- data/app/lib/actions/katello/content_view_version/incremental_update.rb +1 -1
- data/app/lib/actions/katello/host/erratum/applicable_errata_install.rb +1 -1
- data/app/lib/actions/katello/host/generate_applicability.rb +1 -1
- data/app/lib/actions/katello/host/hypervisors_update.rb +23 -5
- data/app/lib/actions/katello/host/register.rb +2 -11
- data/app/lib/actions/katello/host/remove_subscriptions.rb +1 -1
- data/app/lib/actions/katello/host/update.rb +1 -1
- data/app/lib/actions/katello/host/update_content_view.rb +5 -1
- data/app/lib/actions/katello/repository/errata_mail.rb +1 -1
- data/app/lib/actions/katello/repository/export.rb +1 -1
- data/app/lib/actions/katello/repository/sync.rb +2 -0
- data/app/lib/actions/pulp/abstract_async_task.rb +1 -1
- data/app/lib/actions/pulp/abstract_async_task_group.rb +76 -0
- data/app/lib/actions/pulp/consumer/create.rb +1 -1
- data/app/lib/actions/pulp/repos/update.rb +2 -1
- data/app/lib/actions/pulp/repository/associate_importer.rb +4 -0
- data/app/lib/actions/pulp/repository/import_upload.rb +0 -4
- data/app/lib/actions/pulp/repository/refresh.rb +7 -18
- data/app/lib/actions/pulp/repository/regenerate_applicability.rb +2 -2
- data/app/lib/actions/pulp/repository/sync.rb +1 -1
- data/app/lib/actions/pulp/repository/update_importer.rb +4 -0
- data/app/lib/katello/api/v2/error_handling.rb +1 -1
- data/app/lib/katello/bulk_actions.rb +7 -8
- data/app/lib/katello/capsule_content.rb +11 -11
- data/app/lib/katello/errors.rb +2 -0
- data/app/lib/katello/glue/queue.rb +1 -1
- data/app/lib/katello/resources/candlepin.rb +3 -3
- data/app/lib/katello/resources/cdn.rb +1 -1
- data/app/lib/katello/util/cdn_var_substitutor.rb +1 -1
- data/app/lib/katello/util/package.rb +1 -1
- data/app/lib/katello/util/package_filter.rb +4 -4
- data/app/lib/katello/util/search.rb +3 -3
- data/app/lib/katello/validators/content_view_puppet_module_validator.rb +20 -14
- data/app/models/katello/activation_key.rb +4 -4
- data/app/models/katello/concerns/content_facet_host_extensions.rb +2 -2
- data/app/models/katello/concerns/host_managed_extensions.rb +6 -2
- data/app/models/katello/concerns/operatingsystem_extensions.rb +2 -2
- data/app/models/katello/concerns/organization_extensions.rb +5 -1
- data/app/models/katello/concerns/smart_proxy_extensions.rb +2 -13
- data/app/models/katello/concerns/subscription_facet_host_extensions.rb +27 -2
- data/app/models/katello/content_view.rb +5 -5
- data/app/models/katello/content_view_erratum_filter_rule.rb +3 -3
- data/app/models/katello/content_view_filter.rb +3 -3
- data/app/models/katello/content_view_history.rb +4 -4
- data/app/models/katello/content_view_repository.rb +1 -1
- data/app/models/katello/erratum.rb +14 -10
- data/app/models/katello/glue.rb +0 -2
- data/app/models/katello/glue/candlepin/consumer.rb +4 -4
- data/app/models/katello/glue/candlepin/content.rb +2 -2
- data/app/models/katello/glue/candlepin/pool.rb +6 -0
- data/app/models/katello/glue/candlepin/product.rb +1 -1
- data/app/models/katello/glue/provider.rb +1 -1
- data/app/models/katello/glue/pulp/consumer.rb +3 -3
- data/app/models/katello/glue/pulp/repo.rb +26 -31
- data/app/models/katello/glue/pulp/repos.rb +1 -1
- data/app/models/katello/host/content_facet.rb +6 -1
- data/app/models/katello/host/subscription_facet.rb +1 -8
- data/app/models/katello/host_collection.rb +1 -82
- data/app/models/katello/hypervisor.rb +1 -1
- data/app/models/katello/kt_environment.rb +3 -2
- data/app/models/katello/package_group.rb +2 -2
- data/app/models/katello/ping.rb +4 -4
- data/app/models/katello/provider.rb +8 -1
- data/app/models/katello/pulp_sync_status.rb +7 -7
- data/app/models/katello/pulp_task_status.rb +1 -1
- data/app/models/katello/repository.rb +6 -6
- data/app/models/katello/rhsm_fact_parser.rb +0 -9
- data/app/models/katello/sync_plan.rb +14 -21
- data/app/models/katello/system.rb +6 -12
- data/app/models/katello/task_status.rb +3 -24
- data/app/models/setting/{katello.rb → content.rb} +10 -2
- data/app/overrides/add_about_page.rb +3 -3
- data/app/overrides/add_organization_attributes.rb +2 -2
- data/app/overrides/add_subscription_status.rb +1 -1
- data/app/services/katello/candlepin/consumer.rb +8 -8
- data/app/services/katello/pulp/consumer.rb +1 -1
- data/app/services/katello/pulp/consumer_group.rb +3 -3
- data/app/services/katello/pulp/docker_manifest.rb +1 -1
- data/app/services/katello/pulp/erratum.rb +1 -1
- data/app/services/katello/pulp/ostree_branch.rb +1 -1
- data/app/services/katello/pulp/package_group.rb +1 -1
- data/app/services/katello/pulp/puppet_module.rb +1 -1
- data/app/services/katello/pulp/rpm.rb +3 -3
- data/app/services/katello/puppet_class_importer_extensions.rb +1 -1
- data/app/views/dashboard/_subscription_status_widget.html.erb +1 -1
- data/app/views/foreman/smart_proxies/_content_sync.html.erb +1 -1
- data/app/views/foreman/unattended/finish-katello.erb +2 -2
- data/app/views/foreman/unattended/kickstart-katello.erb +2 -2
- data/app/views/foreman/unattended/userdata-katello.erb +2 -0
- data/app/views/katello/api/v2/common/_syncable.json.rabl +1 -1
- data/app/views/katello/api/v2/errata/show.json.rabl +2 -2
- data/app/views/katello/api/v2/{systems/releases.json.rabl → host_subscriptions/available_release_versions.json.rabl} +0 -0
- data/app/views/katello/api/v2/products/base.json.rabl +0 -19
- data/app/views/katello/api/v2/products/show.json.rabl +21 -2
- data/app/views/katello/api/v2/subscription_facet/base_with_root.json.rabl +2 -1
- data/app/views/katello/api/v2/subscriptions/show.json.rabl +19 -17
- data/config/katello.yml +242 -0
- data/config/routes/api/v2.rb +7 -6
- data/config/routes/overrides.rb +10 -5
- data/db/migrate/20140117160939_refactor_content_views.rb +4 -4
- data/db/migrate/20140318174203_drop_cdn_import_success_column.rb +1 -1
- data/db/migrate/20140404122011_drop_repositories_enabled_column.rb +1 -1
- data/db/migrate/20140610083129_add_pulp_proxy_to_host.rb +1 -1
- data/db/migrate/20140930170628_add_errata.rb +1 -1
- data/db/migrate/20141222151001_add_host_content_view_environment.rb +1 -1
- data/db/migrate/20150602153756_remove_user_notices.rb +1 -1
- data/db/migrate/20150602153757_remove_notices.rb +2 -2
- data/db/migrate/20150930183738_migrate_content_hosts.rb +1 -1
- data/db/migrate/20160203195736_remove_docker_image_schema.rb +3 -1
- data/db/migrate/20160505181337_rename_katello_settings.rb +9 -0
- data/db/migrate/20160520175340_add_host_applicable_package.rb +8 -0
- data/db/migrate/20160605160933_remove_jobs.rb +25 -0
- data/db/migrate/20160605162929_remove_system_smart_proxy.rb +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-associations.controller.js +14 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-associations-content-hosts.html +8 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-action-packages.controller.js +16 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/bulk-actions-packages.html +27 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts-helper.service.js +17 -19
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +1 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages.controller.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages.html +2 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details-info.controller.js +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +4 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-provisioning-info.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-subscriptions.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts-table-collapsed.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts-table-full.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-versions.controller.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/views/gpg-key-details.html +6 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/gpg-keys.controller.js +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/gpg-keys.module.js +7 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/new/new-gpg-key.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/new/views/gpg-key-new.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/views/gpg-keys.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-subscription.factory.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/katello-features.run.js +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/check-current-organization.run.js +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-associations-content-hosts.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-associations-content-hosts.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-import.controller.js +3 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/new/views/new-sync-plan-form.html +1 -0
- data/engines/bastion_katello/lib/bastion_katello/version.rb +1 -1
- data/lib/katello.rb +0 -1
- data/lib/katello/engine.rb +12 -8
- data/lib/katello/permissions/content_host_permissions.rb +1 -1
- data/lib/katello/tasks/clean_backend_objects.rake +5 -6
- data/lib/katello/tasks/delete_orphaned_content.rake +1 -1
- data/lib/katello/tasks/jenkins.rake +1 -3
- data/lib/katello/tasks/jshint.rake +28 -29
- data/lib/katello/tasks/jsroutes.rake +2 -2
- data/lib/katello/tasks/regenerate_repo_metadata.rake +3 -5
- data/lib/katello/tasks/reindex.rake +17 -16
- data/lib/katello/tasks/rubocop.rake +1 -3
- data/lib/katello/tasks/setup.rake +3 -4
- data/lib/katello/tasks/test.rake +8 -23
- data/lib/katello/tasks/upgrades/2.4/import_distributions.rake +1 -2
- data/lib/katello/tasks/upgrades/2.4/import_package_groups.rake +1 -2
- data/lib/katello/tasks/upgrades/2.4/import_puppet_modules.rake +1 -2
- data/lib/katello/tasks/upgrades/2.4/import_rpms.rake +1 -1
- data/lib/katello/tasks/upgrades/2.4/import_subscriptions.rake +1 -2
- data/lib/katello/tasks/upgrades/3.0/add_export_distributor.rake +1 -1
- data/lib/katello/tasks/upgrades/3.0/update_subscription_facet_backend_data.rake +1 -1
- data/lib/katello/tasks/yard.rake +2 -2
- data/lib/katello/version.rb +1 -1
- metadata +14 -15
- data/app/models/katello/job.rb +0 -197
- data/app/models/katello/job_task.rb +0 -10
- data/app/views/katello/api/v2/systems_bulk_actions/applicable_errata.json.rabl +0 -7
- data/app/views/katello/api/v2/systems_bulk_actions/available_incremental_updates.json.rabl +0 -21
- data/app/views/katello/api/v2/systems_bulk_actions/erratum.json.rabl +0 -7
- data/app/views/katello/api/v2/systems_bulk_actions/job.json.rabl +0 -1
- data/db/migrate/20160619223332_fix_viewer_role.rb +0 -41
@@ -3,7 +3,7 @@ require 'katello/plugin.rb'
|
|
3
3
|
Foreman::Plugin.find(:katello).security_block :content_hosts do
|
4
4
|
permission :view_content_hosts,
|
5
5
|
{
|
6
|
-
'katello/content_hosts'
|
6
|
+
'katello/content_hosts' => [:auto_complete_search],
|
7
7
|
'katello/api/v2/systems' => [:index, :show, :errata, :package_profile, :product_content,
|
8
8
|
:report, :releases, :available_host_collections],
|
9
9
|
'katello/api/v2/host_collections' => [:systems]
|
@@ -3,7 +3,6 @@ namespace :katello do
|
|
3
3
|
task :clean_backend_objects => ["environment"] do
|
4
4
|
def cleanup_systems
|
5
5
|
Katello::System.find_each do |system|
|
6
|
-
|
7
6
|
if system.uuid.nil?
|
8
7
|
cp_fail = true
|
9
8
|
pulp_fail = true
|
@@ -24,11 +23,11 @@ namespace :katello do
|
|
24
23
|
def test_method
|
25
24
|
yield
|
26
25
|
false
|
27
|
-
rescue RestClient::ResourceNotFound
|
26
|
+
rescue RestClient::ResourceNotFound
|
28
27
|
true
|
29
|
-
rescue RestClient::Gone
|
28
|
+
rescue RestClient::Gone
|
30
29
|
true
|
31
|
-
rescue RestClient::Conflict
|
30
|
+
rescue RestClient::Conflict
|
32
31
|
true
|
33
32
|
end
|
34
33
|
|
@@ -39,7 +38,7 @@ namespace :katello do
|
|
39
38
|
# for more information
|
40
39
|
cp_consumers = ::Katello::Resources::Candlepin::Consumer.get({})
|
41
40
|
cp_consumers.reject! { |consumer| consumer['type']['label'] == 'uebercert' }
|
42
|
-
cp_consumer_ids = cp_consumers.map {|cons| cons["uuid"]}
|
41
|
+
cp_consumer_ids = cp_consumers.map { |cons| cons["uuid"] }
|
43
42
|
katello_consumer_ids = ::Katello::System.pluck(:uuid)
|
44
43
|
deletable_ids = cp_consumer_ids - katello_consumer_ids
|
45
44
|
deletable_ids.each do |consumer_id|
|
@@ -50,7 +49,7 @@ namespace :katello do
|
|
50
49
|
end
|
51
50
|
begin
|
52
51
|
Katello.pulp_server.extensions.consumer.delete(consumer_id)
|
53
|
-
rescue RestClient::ResourceNotFound
|
52
|
+
rescue RestClient::ResourceNotFound # rubocop:disable Lint/HandleExceptions
|
54
53
|
#do nothing
|
55
54
|
rescue RestClient::Exception => e
|
56
55
|
p "exception when destroying pulp consumer #{consumer_id}:#{e.inspect}"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
namespace :katello do
|
2
|
-
task :delete_orphaned_content => ["environment"]
|
2
|
+
task :delete_orphaned_content => ["environment"] do
|
3
3
|
User.current = User.anonymous_admin
|
4
4
|
Katello::Repository.delete_orphaned_content
|
5
5
|
puts _("Orphaned content deletion started in background.")
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require File.expand_path("../engine", File.dirname(__FILE__))
|
2
2
|
|
3
3
|
begin
|
4
|
-
|
5
4
|
namespace :jenkins do
|
6
5
|
task :katello do
|
7
6
|
Rake::Task['jenkins:setup:minitest'].invoke
|
@@ -18,7 +17,6 @@ begin
|
|
18
17
|
Rake::Task['rake:test:katello:test'].invoke
|
19
18
|
end
|
20
19
|
end
|
21
|
-
|
22
|
-
rescue LoadError
|
20
|
+
rescue LoadError # rubocop:disable Lint/HandleExceptions
|
23
21
|
# ci/reporter/rake/rspec not present, skipping this definition
|
24
22
|
end
|
@@ -12,38 +12,37 @@ if Rails.env.development?
|
|
12
12
|
].join(",")
|
13
13
|
|
14
14
|
Jshintrb::JshintTask.new :jshint do |t|
|
15
|
-
t.pattern
|
15
|
+
t.pattern = 'app/assets/javascripts/**/*.js'
|
16
16
|
t.exclude_pattern = "{#{vendor_files}}.js"
|
17
|
-
t.globals
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
t.globals = {
|
18
|
+
"KT" => true,
|
19
|
+
"Katello" => true,
|
20
|
+
"angular" => false
|
21
21
|
}
|
22
|
-
t.options
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
22
|
+
t.options = {
|
23
|
+
:bitwise => true,
|
24
|
+
:curly => true,
|
25
|
+
:eqeqeq => true,
|
26
|
+
:forin => true,
|
27
|
+
:immed => true,
|
28
|
+
:latedef => false, # TODO: reenable this and fix
|
29
|
+
:newcap => false,
|
30
|
+
:noarg => true,
|
31
|
+
:noempty => true,
|
32
|
+
:nonew => true,
|
33
|
+
:plusplus => true,
|
34
|
+
:regexp => true,
|
35
|
+
:undef => false,
|
36
|
+
:strict => false,
|
37
|
+
:trailing => true,
|
38
|
+
:browser => true,
|
39
|
+
:jquery => true,
|
40
|
+
:passfail => false,
|
41
|
+
:white => false,
|
42
|
+
:sub => true,
|
43
|
+
:lastsemic => true,
|
44
|
+
:smarttabs => true
|
45
45
|
}
|
46
|
-
|
47
46
|
end
|
48
47
|
rescue LoadError
|
49
48
|
warn "install jshintrb gem"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
desc 'Regenerates js routes'
|
2
2
|
task :jsroutes => :environment do
|
3
|
-
JsRoutes.generate!(Rails.root.join('app', 'assets', 'javascripts', 'common', 'routes.js'), :namespace => 'KT.routes', :exclude =>[
|
4
|
-
JsRoutes.generate!(Rails.root.join('app', 'assets', 'javascripts', 'common', 'bastion-routes.js'), :namespace => 'BASTION.KT.routes', :exclude =>[
|
3
|
+
JsRoutes.generate!(Rails.root.join('app', 'assets', 'javascripts', 'common', 'routes.js'), :namespace => 'KT.routes', :exclude => [/^admin_/])
|
4
|
+
JsRoutes.generate!(Rails.root.join('app', 'assets', 'javascripts', 'common', 'bastion-routes.js'), :namespace => 'BASTION.KT.routes', :exclude => [/^admin_/], :camel_case => true)
|
5
5
|
end
|
@@ -1,16 +1,14 @@
|
|
1
1
|
namespace :katello do
|
2
|
-
task :regenerate_repo_metadata => ["environment"]
|
2
|
+
task :regenerate_repo_metadata => ["environment"] do
|
3
3
|
User.current = User.first #set a user for orchestration
|
4
|
-
tasks = []
|
5
4
|
puts "Regenerating repository information for all repositories:\n"
|
6
5
|
|
7
6
|
Katello::Repository.all.each_with_index do |repo, i|
|
8
|
-
puts "Regenerating #{i+1}/#{repos.count} (#{repo.pulp_id})\n"
|
9
|
-
Katello::PulpTaskStatus
|
7
|
+
puts "Regenerating #{i + 1}/#{repos.count} (#{repo.pulp_id})\n"
|
8
|
+
Katello::PulpTaskStatus.wait_for_tasks(repo.generate_metadata(:force_regeneration => true))
|
10
9
|
end
|
11
10
|
end
|
12
11
|
|
13
|
-
|
14
12
|
task :refresh_pulp_repo_details => ["environment"] do
|
15
13
|
User.current = User.first
|
16
14
|
Katello::Product.all.each do |product|
|
@@ -1,23 +1,24 @@
|
|
1
1
|
namespace :katello do
|
2
2
|
class ReindexHelper
|
3
|
-
LOG_FILE = "#{Rails.root}/log/reindex.log"
|
3
|
+
LOG_FILE = "#{Rails.root}/log/reindex.log".freeze
|
4
4
|
|
5
5
|
attr_accessor :reindex_logger
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
|
7
|
+
def reindex_logger
|
8
|
+
unless @reindex_logger
|
9
|
+
@reindex_logger = Logger.new(LOG_FILE)
|
10
|
+
@reindex_logger.formatter = Logger::Formatter.new
|
11
|
+
@reindex_logger.level = Logger::DEBUG
|
11
12
|
end
|
12
|
-
|
13
|
+
@reindex_logger
|
13
14
|
end
|
14
15
|
|
15
16
|
def log(message, options = {})
|
16
17
|
puts message if options[:console]
|
17
18
|
if options[:error]
|
18
|
-
|
19
|
+
reindex_logger.error(message)
|
19
20
|
else
|
20
|
-
|
21
|
+
reindex_logger.info("#{message}")
|
21
22
|
end
|
22
23
|
end
|
23
24
|
|
@@ -27,15 +28,15 @@ namespace :katello do
|
|
27
28
|
|
28
29
|
def fetch_resource
|
29
30
|
return yield
|
30
|
-
rescue RestClient::ResourceNotFound, RestClient::BadRequest =>
|
31
|
-
|
31
|
+
rescue RestClient::ResourceNotFound, RestClient::BadRequest => _ # rubocop:disable Lint/HandleExceptions
|
32
|
+
# ignore
|
32
33
|
end
|
33
34
|
|
34
35
|
def index_objects(object_class)
|
35
36
|
log("Re-indexing #{object_class.name}", :console => true)
|
36
37
|
begin
|
37
38
|
yield
|
38
|
-
rescue
|
39
|
+
rescue => _
|
39
40
|
if object_class.ancestors.include?(Katello::Glue::Pulp::PulpContentUnit)
|
40
41
|
report_bad_backend_class(object_class.name)
|
41
42
|
else
|
@@ -43,7 +44,7 @@ namespace :katello do
|
|
43
44
|
object_class.each do |object|
|
44
45
|
begin
|
45
46
|
object.update_index
|
46
|
-
rescue
|
47
|
+
rescue => e
|
47
48
|
bad_objects << [object, e]
|
48
49
|
end
|
49
50
|
end
|
@@ -101,7 +102,7 @@ namespace :katello do
|
|
101
102
|
end
|
102
103
|
|
103
104
|
desc "Regenerates the search indicies for various Katello objects"
|
104
|
-
task :reindex => ["environment", "katello:check_ping"]
|
105
|
+
task :reindex => ["environment", "katello:check_ping"] do
|
105
106
|
User.current = User.anonymous_admin #set a user for orchestration
|
106
107
|
|
107
108
|
Dir.glob(Katello::Engine.root.to_s + '/app/models/katello/*.rb').each { |file| require file }
|
@@ -120,12 +121,12 @@ namespace :katello do
|
|
120
121
|
|
121
122
|
begin
|
122
123
|
model.index.import(objects) if objects.count > 0
|
123
|
-
rescue
|
124
|
+
rescue => e
|
124
125
|
bad_objects = []
|
125
126
|
objects.each do |object|
|
126
127
|
begin
|
127
128
|
object.update_index
|
128
|
-
rescue
|
129
|
+
rescue => e
|
129
130
|
bad_objects << [object, e]
|
130
131
|
end
|
131
132
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require File.expand_path("../engine", File.dirname(__FILE__))
|
2
2
|
|
3
3
|
namespace :katello do
|
4
|
-
|
5
4
|
desc "Runs Rubocop style checker on Katello code"
|
6
5
|
task :rubocop do
|
7
6
|
system("cd #{Katello::Engine.root} && bundle exec rubocop")
|
@@ -13,7 +12,6 @@ namespace :katello do
|
|
13
12
|
--require rubocop/formatter/checkstyle_formatter \
|
14
13
|
--format RuboCop::Formatter::CheckstyleFormatter \
|
15
14
|
--no-color --out rubocop.xml")
|
16
|
-
exit(
|
15
|
+
exit($CHILD_STATUS.exitstatus)
|
17
16
|
end
|
18
|
-
|
19
17
|
end
|
@@ -1,19 +1,18 @@
|
|
1
1
|
namespace :katello do
|
2
|
-
|
3
2
|
namespace :reset_backends do
|
4
3
|
service_stop = "sudo /sbin/service %s status > /dev/null && sudo /sbin/service %s stop"
|
5
4
|
service_start = "sudo /sbin/service %s start"
|
6
5
|
|
7
6
|
task :pulp do
|
8
|
-
SERVICES = %w(httpd pulp_workers pulp_resource_manager pulp_celerybeat)
|
7
|
+
SERVICES = %w(httpd pulp_workers pulp_resource_manager pulp_celerybeat).freeze
|
9
8
|
system(service_stop.gsub("%s", "mongod"))
|
10
9
|
|
11
|
-
SERVICES.each{|s| system(service_stop.gsub("%s", s)) }
|
10
|
+
SERVICES.each { |s| system(service_stop.gsub("%s", s)) }
|
12
11
|
system("sudo rm -rf /var/lib/mongodb/pulp_database*")
|
13
12
|
system(service_start.gsub("%s", "mongod"))
|
14
13
|
sleep(10)
|
15
14
|
fail "Cannot migrate pulp database" unless system("sudo -u apache /usr/bin/pulp-manage-db")
|
16
|
-
SERVICES.each{|s| system(service_start.gsub("%s", s)) }
|
15
|
+
SERVICES.each { |s| system(service_start.gsub("%s", s)) }
|
17
16
|
puts "Pulp database reset."
|
18
17
|
end
|
19
18
|
|
data/lib/katello/tasks/test.rake
CHANGED
@@ -1,16 +1,13 @@
|
|
1
1
|
require File.expand_path("../engine", File.dirname(__FILE__))
|
2
2
|
|
3
3
|
namespace :test do
|
4
|
-
|
5
4
|
namespace :katello do
|
6
|
-
|
7
5
|
desc "Run the Katello plugin spec test suite."
|
8
6
|
task :spec => ['db:test:prepare'] do
|
9
|
-
|
10
7
|
spec_task = Rake::TestTask.new('katello_spec_task') do |t|
|
11
8
|
t.libs << ["test", "#{Katello::Engine.root}/test", "spec", "#{Katello::Engine.root}/spec"]
|
12
9
|
t.test_files = [
|
13
|
-
"#{Katello::Engine.root}/spec/**/*_spec.rb"
|
10
|
+
"#{Katello::Engine.root}/spec/**/*_spec.rb"
|
14
11
|
]
|
15
12
|
t.verbose = true
|
16
13
|
end
|
@@ -19,32 +16,28 @@ namespace :test do
|
|
19
16
|
end
|
20
17
|
|
21
18
|
namespace :spec do
|
22
|
-
|
23
19
|
desc "Run the Katello plugin spec test suite."
|
24
20
|
task :routing => ['db:test:prepare'] do
|
25
|
-
|
26
21
|
spec_task = Rake::TestTask.new('katello_spec_task') do |t|
|
27
22
|
t.libs << ["test", "#{Katello::Engine.root}/test", "spec", "#{Katello::Engine.root}/spec"]
|
28
23
|
t.test_files = [
|
29
|
-
"#{Katello::Engine.root}/spec/routing/**/*_spec.rb"
|
24
|
+
"#{Katello::Engine.root}/spec/routing/**/*_spec.rb"
|
30
25
|
]
|
31
26
|
t.verbose = true
|
32
27
|
end
|
33
28
|
|
34
29
|
Rake::Task[spec_task.name].invoke
|
35
30
|
end
|
36
|
-
|
37
31
|
end
|
38
32
|
|
39
33
|
desc "Run the Katello plugin unit test suite."
|
40
34
|
task :test => ['db:test:prepare'] do
|
41
|
-
|
42
35
|
test_task = Rake::TestTask.new('katello_test_task') do |t|
|
43
36
|
t.libs << ["test", "#{Katello::Engine.root}/test"]
|
44
37
|
t.test_files = [
|
45
38
|
"#{Katello::Engine.root}/test/models/**/*_test.rb",
|
46
39
|
"#{Katello::Engine.root}/test/controllers/**/*_test.rb",
|
47
|
-
"#{Katello::Engine.root}/test/**/*_test.rb"
|
40
|
+
"#{Katello::Engine.root}/test/**/*_test.rb"
|
48
41
|
]
|
49
42
|
t.verbose = true
|
50
43
|
end
|
@@ -53,14 +46,12 @@ namespace :test do
|
|
53
46
|
end
|
54
47
|
|
55
48
|
namespace :test do
|
56
|
-
|
57
49
|
desc "Run the Katello plugin unit models test suite."
|
58
50
|
task :models => ['db:test:prepare'] do
|
59
|
-
|
60
51
|
test_task = Rake::TestTask.new('katello_models_test_task') do |t|
|
61
52
|
t.libs << ["test", "#{Katello::Engine.root}/test"]
|
62
53
|
t.test_files = [
|
63
|
-
"#{Katello::Engine.root}/test/models/**/*_test.rb"
|
54
|
+
"#{Katello::Engine.root}/test/models/**/*_test.rb"
|
64
55
|
]
|
65
56
|
t.verbose = true
|
66
57
|
end
|
@@ -70,11 +61,10 @@ namespace :test do
|
|
70
61
|
|
71
62
|
desc "Run the Katello plugin unit actions test suite."
|
72
63
|
task :actions => ['db:test:prepare'] do
|
73
|
-
|
74
64
|
test_task = Rake::TestTask.new('katello_actions_test_task') do |t|
|
75
65
|
t.libs << ["test", "#{Katello::Engine.root}/test"]
|
76
66
|
t.test_files = [
|
77
|
-
"#{Katello::Engine.root}/test/actions/**/*_test.rb"
|
67
|
+
"#{Katello::Engine.root}/test/actions/**/*_test.rb"
|
78
68
|
]
|
79
69
|
t.verbose = true
|
80
70
|
end
|
@@ -84,11 +74,10 @@ namespace :test do
|
|
84
74
|
|
85
75
|
desc "Run the Katello plugin unit controllers test suite."
|
86
76
|
task :controllers => ['db:test:prepare'] do
|
87
|
-
|
88
77
|
test_task = Rake::TestTask.new('katello_controllers_test_task') do |t|
|
89
78
|
t.libs << ["test", "#{Katello::Engine.root}/test"]
|
90
79
|
t.test_files = [
|
91
|
-
"#{Katello::Engine.root}/test/controllers/**/*_test.rb"
|
80
|
+
"#{Katello::Engine.root}/test/controllers/**/*_test.rb"
|
92
81
|
]
|
93
82
|
t.verbose = true
|
94
83
|
end
|
@@ -98,11 +87,10 @@ namespace :test do
|
|
98
87
|
|
99
88
|
desc "Run the Katello plugin unit glue test suite."
|
100
89
|
task :glue => ['db:test:prepare'] do
|
101
|
-
|
102
90
|
test_task = Rake::TestTask.new('katello_glue_test_task') do |t|
|
103
91
|
t.libs << ["test", "#{Katello::Engine.root}/test"]
|
104
92
|
t.test_files = [
|
105
|
-
"#{Katello::Engine.root}/test/glue/**/*_test.rb"
|
93
|
+
"#{Katello::Engine.root}/test/glue/**/*_test.rb"
|
106
94
|
]
|
107
95
|
t.verbose = true
|
108
96
|
end
|
@@ -112,18 +100,16 @@ namespace :test do
|
|
112
100
|
|
113
101
|
desc "Run the Katello plugin unit lib test suite."
|
114
102
|
task :lib => ['db:test:prepare'] do
|
115
|
-
|
116
103
|
test_task = Rake::TestTask.new('katello_lib_test_task') do |t|
|
117
104
|
t.libs << ["test", "#{Katello::Engine.root}/test"]
|
118
105
|
t.test_files = [
|
119
|
-
"#{Katello::Engine.root}/test/lib/**/*_test.rb"
|
106
|
+
"#{Katello::Engine.root}/test/lib/**/*_test.rb"
|
120
107
|
]
|
121
108
|
t.verbose = true
|
122
109
|
end
|
123
110
|
|
124
111
|
Rake::Task[test_task.name].invoke
|
125
112
|
end
|
126
|
-
|
127
113
|
end
|
128
114
|
end
|
129
115
|
|
@@ -132,7 +118,6 @@ namespace :test do
|
|
132
118
|
Rake::Task['test:katello:spec'].invoke
|
133
119
|
Rake::Task['test:katello:test'].invoke
|
134
120
|
end
|
135
|
-
|
136
121
|
end
|
137
122
|
|
138
123
|
Rake::Task[:test].enhance do
|
@@ -1,8 +1,7 @@
|
|
1
1
|
namespace :katello do
|
2
2
|
namespace :upgrades do
|
3
3
|
namespace '2.4' do
|
4
|
-
task :import_distributions => ["environment"]
|
5
|
-
|
4
|
+
task :import_distributions => ["environment"] do
|
6
5
|
User.current = User.anonymous_api_admin
|
7
6
|
puts _("Importing distribution data into repositories")
|
8
7
|
Katello::Repository.import_distributions
|
@@ -1,8 +1,7 @@
|
|
1
1
|
namespace :katello do
|
2
2
|
namespace :upgrades do
|
3
3
|
namespace '2.4' do
|
4
|
-
task :import_package_groups => ["environment"]
|
5
|
-
|
4
|
+
task :import_package_groups => ["environment"] do
|
6
5
|
User.current = User.anonymous_api_admin
|
7
6
|
puts _("Importing Package Groups")
|
8
7
|
Katello::PackageGroup.import_all
|