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
@@ -57,23 +57,14 @@ module Actions
|
|
57
57
|
host.subscription_facet.update_from_consumer_attributes(host.subscription_facet.candlepin_consumer.
|
58
58
|
consumer_attributes.except(:installedProducts, :guestIds, :facts))
|
59
59
|
host.subscription_facet.save!
|
60
|
-
|
60
|
+
host.subscription_facet.update_subscription_status
|
61
|
+
host.refresh_global_status!
|
61
62
|
|
62
63
|
system = ::Katello::System.find(input[:system_id])
|
63
64
|
system.uuid = input[:uuid]
|
64
65
|
system.save!
|
65
66
|
end
|
66
67
|
|
67
|
-
def connect_to_smart_proxy(system)
|
68
|
-
smart_proxy = SmartProxy.where(:name => system.name).first
|
69
|
-
|
70
|
-
if smart_proxy
|
71
|
-
smart_proxy.content_host = system.content_host
|
72
|
-
smart_proxy.organizations << system.organization unless smart_proxy.organizations.include?(system.organization)
|
73
|
-
smart_proxy.save!
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
68
|
private
|
78
69
|
|
79
70
|
def set_host_collections(host, activation_keys)
|
@@ -9,7 +9,7 @@ module Actions
|
|
9
9
|
|
10
10
|
entitlements.each do |entitlement|
|
11
11
|
plan_action(::Actions::Candlepin::Consumer::RemoveSubscription, :uuid => host.subscription_facet.uuid,
|
12
|
-
:entitlement_id => entitlement['id'])
|
12
|
+
:entitlement_id => entitlement['id'], :pool_id => entitlement['pool']['id'])
|
13
13
|
plan_self(:host_name => host.name)
|
14
14
|
end
|
15
15
|
end
|
@@ -17,7 +17,7 @@ module Actions
|
|
17
17
|
else
|
18
18
|
consumer_params = host.subscription_facet.consumer_attributes
|
19
19
|
end
|
20
|
-
::Katello::Host::SubscriptionFacet.update_facts(host, consumer_params[:facts]) unless consumer_params[:facts].blank?
|
20
|
+
::Katello::Host::SubscriptionFacet.update_facts(::Host.find(host.id), consumer_params[:facts]) unless consumer_params[:facts].blank?
|
21
21
|
host.subscription_facet.save!
|
22
22
|
plan_action(::Actions::Candlepin::Consumer::Update, host.subscription_facet.uuid, consumer_params)
|
23
23
|
end
|
@@ -17,7 +17,7 @@ module Actions
|
|
17
17
|
errata = ::Katello::Erratum.where(:id => repo.repository_errata.where('katello_repository_errata.updated_at > ?', input[:last_updated].to_datetime).pluck(:erratum_id))
|
18
18
|
|
19
19
|
begin
|
20
|
-
MailNotification[:katello_sync_errata].
|
20
|
+
MailNotification[:katello_sync_errata].deliver_now(:users => users, :repo => repo, :errata => errata) unless users.blank?
|
21
21
|
rescue => e
|
22
22
|
message = _('Unable to send errata e-mail notification: %{error}' % {:error => e})
|
23
23
|
Rails.logger.error(message)
|
@@ -9,7 +9,7 @@ module Actions
|
|
9
9
|
param :export_result, Hash
|
10
10
|
end
|
11
11
|
|
12
|
-
EXPORT_OUTPUT_BASEDIR = "/var/lib/pulp/published/yum/master/group_export_distributor/"
|
12
|
+
EXPORT_OUTPUT_BASEDIR = "/var/lib/pulp/published/yum/master/group_export_distributor/".freeze
|
13
13
|
|
14
14
|
def plan(repos, export_to_iso, since, iso_size, group_id)
|
15
15
|
unless File.directory?(Setting['pulp_export_destination'])
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# rubocop:disable HandleExceptions
|
1
2
|
module Actions
|
2
3
|
module Katello
|
3
4
|
module Repository
|
@@ -51,6 +52,7 @@ module Actions
|
|
51
52
|
|
52
53
|
def run
|
53
54
|
ForemanTasks.async_task(Repository::CapsuleGenerateAndSync, ::Katello::Repository.find(input[:id]))
|
55
|
+
rescue ::Katello::Errors::CapsuleCannotBeReached # skip any capsules that cannot be connected to
|
54
56
|
end
|
55
57
|
|
56
58
|
def humanized_name
|
@@ -4,7 +4,7 @@ module Actions
|
|
4
4
|
include Actions::Base::Polling
|
5
5
|
include ::Dynflow::Action::Cancellable
|
6
6
|
|
7
|
-
FINISHED_STATES = %w(finished error canceled skipped)
|
7
|
+
FINISHED_STATES = %w(finished error canceled skipped).freeze
|
8
8
|
|
9
9
|
# A call report (documented http://pulp-dev-guide.readthedocs.org/en/latest/conventions/sync-v-async.html)
|
10
10
|
# Looks like: {
|
@@ -0,0 +1,76 @@
|
|
1
|
+
module Actions
|
2
|
+
module Pulp
|
3
|
+
class AbstractAsyncTaskGroup < Pulp::Abstract
|
4
|
+
include Actions::Base::Polling
|
5
|
+
|
6
|
+
# A call report (documented https://github.com/pulp/pulp/blob/master/docs/dev-guide/integration/rest-api/consumer/applicability.rst#id65)
|
7
|
+
# Looks like:
|
8
|
+
# {
|
9
|
+
# "_href": "/pulp/api/v2/task_groups/7744e2df-39b9-46f0-bb10-feffa2f7014b/",
|
10
|
+
# "group_id": "7744e2df-39b9-46f0-bb10-feffa2f7014b"
|
11
|
+
# }
|
12
|
+
#
|
13
|
+
# A TaskGroup (https://github.com/pulp/pulp/blob/master/docs/dev-guide/integration/rest-api/tasks.rst#task-group-management)
|
14
|
+
# Looks like:
|
15
|
+
# {
|
16
|
+
# "accepted": 0,
|
17
|
+
# "finished": 100,
|
18
|
+
# "running": 4,
|
19
|
+
# "canceled": 0,
|
20
|
+
# "waiting": 2,
|
21
|
+
# "skipped": 0,
|
22
|
+
# "suspended": 0,
|
23
|
+
# "error": 0,
|
24
|
+
# "total": 106
|
25
|
+
# }
|
26
|
+
|
27
|
+
def run(event = nil)
|
28
|
+
# do nothing when the action is being skipped
|
29
|
+
unless event == Dynflow::Action::Skip
|
30
|
+
super
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def humanized_state
|
35
|
+
case state
|
36
|
+
when :running
|
37
|
+
if self.external_task.nil?
|
38
|
+
_("initiating Pulp task")
|
39
|
+
else
|
40
|
+
_("checking Pulp task status")
|
41
|
+
end
|
42
|
+
else
|
43
|
+
super
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def done?
|
48
|
+
finishing_states = ["finished", "canceled", "skipped", "suspended", "error"]
|
49
|
+
return false if (finishing_states - external_task.keys).present?
|
50
|
+
task_resource.completed?(external_task)
|
51
|
+
end
|
52
|
+
|
53
|
+
def external_task
|
54
|
+
output["pulp_task_group"]
|
55
|
+
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
def external_task=(external_task_data)
|
60
|
+
if external_task_data.key?("group_id")
|
61
|
+
output["pulp_task_group"] = {"group_id" => external_task_data["group_id"]}
|
62
|
+
else
|
63
|
+
output["pulp_task_group"] = {"group_id" => output["pulp_task_group"]["group_id"]}.merge(external_task_data)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def poll_external_task
|
68
|
+
task_resource.summary(output["pulp_task_group"]["group_id"])
|
69
|
+
end
|
70
|
+
|
71
|
+
def task_resource
|
72
|
+
::Katello.pulp_server.resources.task_group
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -10,7 +10,7 @@ module Actions
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def run
|
13
|
-
response =
|
13
|
+
response = pulp_extensions.consumer.create(input[:uuid], display_name: input[:name])
|
14
14
|
output[:response] = response.slice(:uuid, :name)
|
15
15
|
end
|
16
16
|
end
|
@@ -9,7 +9,8 @@ module Actions
|
|
9
9
|
if sync_plan.nil?
|
10
10
|
plan_action(::Actions::Pulp::Repository::RemoveSchedule, :repo_id => repo.id)
|
11
11
|
else
|
12
|
-
plan_action(
|
12
|
+
plan_action(
|
13
|
+
::Actions::Pulp::Repository::UpdateSchedule,
|
13
14
|
:repo_id => repo.id,
|
14
15
|
:schedule => sync_plan.schedule_format,
|
15
16
|
:enabled => sync_plan.enabled
|
@@ -15,25 +15,24 @@ module Actions
|
|
15
15
|
|
16
16
|
def update_or_associate_importer(capsule_id, repository, repository_details)
|
17
17
|
existing_importers = repository_details["importers"]
|
18
|
-
importer =
|
19
|
-
importer_config = capsule_id ? importer.config.merge!(importer_certs(repository)) : importer.config
|
18
|
+
importer = repository.generate_importer(!capsule_id.nil?)
|
20
19
|
found = existing_importers.find { |i| i['importer_type_id'] == importer.id }
|
21
20
|
|
22
21
|
if found
|
23
22
|
plan_action(::Actions::Pulp::Repository::UpdateImporter,
|
24
23
|
:repo_id => repository.pulp_id,
|
25
24
|
:id => found['id'],
|
26
|
-
:config =>
|
25
|
+
:config => importer.config,
|
27
26
|
:capsule_id => capsule_id
|
28
|
-
|
27
|
+
)
|
29
28
|
else
|
30
29
|
plan_action(::Actions::Pulp::Repository::AssociateImporter,
|
31
30
|
:repo_id => repository.pulp_id,
|
32
31
|
:type_id => repository.importers.first['importer_type_id'],
|
33
|
-
:config =>
|
32
|
+
:config => importer.config,
|
34
33
|
:capsule_id => capsule_id,
|
35
34
|
:hash => { :importer_id => importer.id }
|
36
|
-
|
35
|
+
)
|
37
36
|
end
|
38
37
|
end
|
39
38
|
|
@@ -48,7 +47,7 @@ module Actions
|
|
48
47
|
:id => found['id'],
|
49
48
|
:config => distributor.config,
|
50
49
|
:capsule_id => capsule_id
|
51
|
-
|
50
|
+
)
|
52
51
|
else
|
53
52
|
plan_action(::Actions::Pulp::Repository::AssociateDistributor,
|
54
53
|
:repo_id => repository.pulp_id,
|
@@ -56,7 +55,7 @@ module Actions
|
|
56
55
|
:config => distributor.config,
|
57
56
|
:capsule_id => capsule_id,
|
58
57
|
:hash => { :distributor_id => distributor.id }
|
59
|
-
|
58
|
+
)
|
60
59
|
end
|
61
60
|
end
|
62
61
|
end
|
@@ -77,16 +76,6 @@ module Actions
|
|
77
76
|
end
|
78
77
|
end
|
79
78
|
end
|
80
|
-
|
81
|
-
def importer_certs(repository)
|
82
|
-
ueber_cert = ::Cert::Certs.ueber_cert(repository.organization)
|
83
|
-
|
84
|
-
{
|
85
|
-
:ssl_ca_cert => ::Cert::Certs.ca_cert,
|
86
|
-
:ssl_client_cert => ueber_cert[:cert],
|
87
|
-
:ssl_client_key => ueber_cert[:key]
|
88
|
-
}
|
89
|
-
end
|
90
79
|
end
|
91
80
|
end
|
92
81
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Actions
|
2
2
|
module Pulp
|
3
3
|
module Repository
|
4
|
-
class RegenerateApplicability < Pulp::
|
4
|
+
class RegenerateApplicability < Pulp::AbstractAsyncTaskGroup
|
5
5
|
middleware.use Actions::Middleware::ExecuteIfContentsChanged
|
6
6
|
|
7
7
|
input_format do
|
@@ -10,7 +10,7 @@ module Actions
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def invoke_external_task
|
13
|
-
pulp_extensions.repository.regenerate_applicability_by_ids([input[:pulp_id]])
|
13
|
+
pulp_extensions.repository.regenerate_applicability_by_ids([input[:pulp_id]], true)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -31,7 +31,7 @@ module Actions
|
|
31
31
|
sync_options[:validate] = !(SETTINGS[:katello][:pulp][:skip_checksum_validation])
|
32
32
|
|
33
33
|
output[:pulp_tasks] = pulp_tasks =
|
34
|
-
[pulp_resources.repository.sync(input[:pulp_id],
|
34
|
+
[pulp_resources.repository.sync(input[:pulp_id], override_config: sync_options)]
|
35
35
|
|
36
36
|
pulp_tasks
|
37
37
|
end
|
@@ -58,7 +58,7 @@ module Katello
|
|
58
58
|
# TODO: why not use http_code from the exception???
|
59
59
|
render :json => format_subsys_exception_hash(exception), :status => :bad_request
|
60
60
|
else
|
61
|
-
respond_for_exception(exception,
|
61
|
+
respond_for_exception(exception, :status => :bad_request)
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
@@ -6,43 +6,42 @@ module Katello
|
|
6
6
|
@consumer_ids = hosts.map { |host| host.content_facet.try(:uuid) }.compact
|
7
7
|
end
|
8
8
|
|
9
|
-
def install_packages(packages)
|
9
|
+
def install_packages(packages, _options = {})
|
10
10
|
fail Errors::EmptyBulkActionException if self.consumer_ids.empty?
|
11
11
|
perform_bulk_action do |consumer_group|
|
12
12
|
consumer_group.install_package(packages)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
def uninstall_packages(packages)
|
16
|
+
def uninstall_packages(packages, _options = {})
|
17
17
|
fail Errors::EmptyBulkActionException if self.consumer_ids.empty?
|
18
18
|
perform_bulk_action do |consumer_group|
|
19
19
|
consumer_group.uninstall_package(packages)
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
def update_packages(packages = nil)
|
24
|
-
# if no packages are provided, a full system update will be performed (e.g ''yum update' equivalent)
|
23
|
+
def update_packages(packages = nil, options = {})
|
25
24
|
fail Errors::EmptyBulkActionException if self.consumer_ids.empty?
|
26
25
|
perform_bulk_action do |consumer_group|
|
27
|
-
consumer_group.update_package(packages)
|
26
|
+
consumer_group.update_package(packages, options)
|
28
27
|
end
|
29
28
|
end
|
30
29
|
|
31
|
-
def install_package_groups(groups)
|
30
|
+
def install_package_groups(groups, _options = {})
|
32
31
|
fail Errors::EmptyBulkActionException if self.consumer_ids.empty?
|
33
32
|
perform_bulk_action do |consumer_group|
|
34
33
|
consumer_group.install_package_group(groups)
|
35
34
|
end
|
36
35
|
end
|
37
36
|
|
38
|
-
def update_package_groups(groups)
|
37
|
+
def update_package_groups(groups, _options = {})
|
39
38
|
fail Errors::EmptyBulkActionException if self.consumer_ids.empty?
|
40
39
|
perform_bulk_action do |consumer_group|
|
41
40
|
consumer_group.install_package_group(groups)
|
42
41
|
end
|
43
42
|
end
|
44
43
|
|
45
|
-
def uninstall_package_groups(groups)
|
44
|
+
def uninstall_package_groups(groups, _options = {})
|
46
45
|
fail Errors::EmptyBulkActionException if self.consumer_ids.empty?
|
47
46
|
perform_bulk_action do |consumer_group|
|
48
47
|
consumer_group.uninstall_package_group(groups)
|
@@ -47,16 +47,6 @@ module Katello
|
|
47
47
|
scope
|
48
48
|
end
|
49
49
|
|
50
|
-
delegate :uuid, :to => :consumer, :prefix => true
|
51
|
-
|
52
|
-
def consumer
|
53
|
-
@consumer ||= @capsule.content_host
|
54
|
-
unless @consumer
|
55
|
-
fail Errors::CapsuleContentMissingConsumer, _("Could not find Content Host with exact name '%s', verify the Capsule is registered with that name.") % @capsule.name
|
56
|
-
end
|
57
|
-
@consumer
|
58
|
-
end
|
59
|
-
|
60
50
|
def sync_tasks
|
61
51
|
ForemanTasks::Task.for_resource(self.capsule)
|
62
52
|
end
|
@@ -142,7 +132,7 @@ module Katello
|
|
142
132
|
end
|
143
133
|
|
144
134
|
def pulp_url
|
145
|
-
self.capsule.
|
135
|
+
"https://" + self.capsule.hostname + "/pulp/api/v2/"
|
146
136
|
end
|
147
137
|
|
148
138
|
def pulp_repo_facts(pulp_id)
|
@@ -151,6 +141,12 @@ module Katello
|
|
151
141
|
nil
|
152
142
|
end
|
153
143
|
|
144
|
+
def ping_pulp
|
145
|
+
::Katello::Ping.pulp_without_auth(self.pulp_url)
|
146
|
+
rescue Errno::EHOSTUNREACH, Errno::ECONNREFUSED, RestClient::Exception => error
|
147
|
+
raise ::Katello::Errors::CapsuleCannotBeReached, _("%s is unreachable. %s" % [@capsule.name, error])
|
148
|
+
end
|
149
|
+
|
154
150
|
def self.with_environment(environment, include_default = false)
|
155
151
|
features = [SmartProxy::PULP_NODE_FEATURE]
|
156
152
|
features << SmartProxy::PULP_FEATURE if include_default
|
@@ -165,5 +161,9 @@ module Katello
|
|
165
161
|
proxy = SmartProxy.with_features(SmartProxy::PULP_FEATURE).first
|
166
162
|
self.new(proxy) if proxy
|
167
163
|
end
|
164
|
+
|
165
|
+
def self.sync_needed?(environment)
|
166
|
+
::Katello::CapsuleContent.with_environment(environment).any?
|
167
|
+
end
|
168
168
|
end
|
169
169
|
end
|
data/app/lib/katello/errors.rb
CHANGED