katello 4.9.2 → 4.10.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/README.md +4 -7
- data/app/assets/javascripts/katello/locale/bn/katello.js +8967 -1
- data/app/assets/javascripts/katello/locale/bn_IN/katello.js +8967 -0
- data/app/assets/javascripts/katello/locale/ca/katello.js +8967 -0
- data/app/assets/javascripts/katello/locale/cs/katello.js +8967 -1
- data/app/assets/javascripts/katello/locale/cs_CZ/katello.js +8969 -0
- data/app/assets/javascripts/katello/locale/de/katello.js +8991 -1
- data/app/assets/javascripts/katello/locale/de_AT/katello.js +8966 -0
- data/app/assets/javascripts/katello/locale/de_DE/katello.js +8967 -0
- data/app/assets/javascripts/katello/locale/el/katello.js +8967 -0
- data/app/assets/javascripts/katello/locale/en/katello.js +8967 -1
- data/app/assets/javascripts/katello/locale/en_GB/katello.js +8967 -0
- data/app/assets/javascripts/katello/locale/en_US/katello.js +8966 -0
- data/app/assets/javascripts/katello/locale/es/katello.js +8984 -1
- data/app/assets/javascripts/katello/locale/et_EE/katello.js +8966 -0
- data/app/assets/javascripts/katello/locale/fr/katello.js +9008 -1
- data/app/assets/javascripts/katello/locale/gl/katello.js +8967 -0
- data/app/assets/javascripts/katello/locale/gu/katello.js +8967 -1
- data/app/assets/javascripts/katello/locale/he_IL/katello.js +8967 -0
- data/app/assets/javascripts/katello/locale/hi/katello.js +8967 -1
- data/app/assets/javascripts/katello/locale/id/katello.js +8966 -0
- data/app/assets/javascripts/katello/locale/it/katello.js +8974 -1
- data/app/assets/javascripts/katello/locale/ja/katello.js +9004 -1
- data/app/assets/javascripts/katello/locale/ka/katello.js +8976 -1
- data/app/assets/javascripts/katello/locale/kn/katello.js +8967 -1
- data/app/assets/javascripts/katello/locale/ko/katello.js +8972 -1
- data/app/assets/javascripts/katello/locale/locale/katello.js +3070 -1
- data/app/assets/javascripts/katello/locale/ml_IN/katello.js +8966 -0
- data/app/assets/javascripts/katello/locale/mr/katello.js +8967 -1
- data/app/assets/javascripts/katello/locale/nl_NL/katello.js +8967 -0
- data/app/assets/javascripts/katello/locale/or/katello.js +8967 -1
- data/app/assets/javascripts/katello/locale/pa/katello.js +8967 -1
- data/app/assets/javascripts/katello/locale/pl/katello.js +8967 -0
- data/app/assets/javascripts/katello/locale/pl_PL/katello.js +8966 -0
- data/app/assets/javascripts/katello/locale/pt/katello.js +8967 -1
- data/app/assets/javascripts/katello/locale/pt_BR/katello.js +8984 -1
- data/app/assets/javascripts/katello/locale/ro/katello.js +8966 -0
- data/app/assets/javascripts/katello/locale/ro_RO/katello.js +8966 -0
- data/app/assets/javascripts/katello/locale/ru/katello.js +8973 -1
- data/app/assets/javascripts/katello/locale/sl/katello.js +8967 -0
- data/app/assets/javascripts/katello/locale/sv_SE/katello.js +8967 -0
- data/app/assets/javascripts/katello/locale/ta/katello.js +8967 -1
- data/app/assets/javascripts/katello/locale/ta_IN/katello.js +8967 -0
- data/app/assets/javascripts/katello/locale/te/katello.js +8967 -1
- data/app/assets/javascripts/katello/locale/tr/katello.js +8967 -0
- data/app/assets/javascripts/katello/locale/vi/katello.js +8966 -0
- data/app/assets/javascripts/katello/locale/vi_VN/katello.js +8966 -0
- data/app/assets/javascripts/katello/locale/zh/katello.js +8966 -0
- data/app/assets/javascripts/katello/locale/zh_CN/katello.js +9004 -1
- data/app/assets/javascripts/katello/locale/zh_TW/katello.js +8972 -1
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +1 -1
- data/app/controllers/katello/api/v2/alternate_content_sources_bulk_actions_controller.rb +22 -1
- data/app/controllers/katello/api/v2/api_controller.rb +0 -15
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +13 -4
- data/app/controllers/katello/api/v2/host_errata_controller.rb +0 -12
- data/app/controllers/katello/api/v2/host_packages_controller.rb +0 -55
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +0 -77
- data/app/controllers/katello/api/v2/organizations_controller.rb +2 -1
- data/app/controllers/katello/api/v2/repositories_controller.rb +6 -10
- data/app/controllers/katello/api/v2/sync_controller.rb +0 -1
- data/app/controllers/katello/concerns/api/api_controller.rb +0 -10
- data/app/controllers/katello/concerns/hosts_controller_extensions.rb +1 -1
- data/app/lib/actions/katello/alternate_content_source/update.rb +1 -1
- data/app/lib/actions/katello/content_view/capsule_sync.rb +1 -1
- data/app/lib/actions/katello/content_view/incremental_updates.rb +3 -9
- data/app/lib/actions/katello/content_view_version/republish_repositories.rb +8 -2
- data/app/lib/actions/katello/repository/capsule_sync.rb +1 -1
- data/app/lib/actions/katello/repository/update_metadata_sync.rb +1 -1
- data/app/lib/katello/concerns/base_template_scope_extensions.rb +4 -9
- data/app/lib/katello/resources/cdn.rb +4 -0
- data/app/lib/katello/validators/alternate_content_source_products_validator.rb +1 -1
- data/app/models/katello/cdn_configuration.rb +4 -0
- data/app/models/katello/concerns/host_managed_extensions.rb +2 -1
- data/app/models/katello/content_view.rb +5 -1
- data/app/models/katello/content_view_component.rb +1 -1
- data/app/models/katello/content_view_version.rb +4 -0
- data/app/models/katello/host/content_facet.rb +4 -5
- data/app/models/katello/ping.rb +0 -19
- data/app/models/katello/repository.rb +5 -1
- data/app/models/katello/root_repository.rb +2 -8
- data/app/services/katello/applicability/applicable_content_helper.rb +2 -2
- data/app/services/katello/registration_manager.rb +2 -12
- data/app/views/foreman/job_templates/configure_host_for_new_content_source.erb +25 -0
- data/app/views/katello/api/v2/capsule_content/sync_status.json.rabl +1 -1
- data/app/views/katello/api/v2/content_facet/show.json.rabl +0 -12
- data/app/views/katello/api/v2/content_view_components/show.json.rabl +4 -1
- data/app/views/katello/api/v2/content_views/base.json.rabl +6 -2
- data/app/views/katello/api/v2/repositories/show.json.rabl +0 -1
- data/config/initializers/monkeys.rb +1 -0
- data/config/katello.yaml.example +0 -4
- data/config/routes/api/v2.rb +3 -0
- data/config/routes/overrides.rb +0 -11
- data/db/migrate/20230609155411_add_custom_cdn_auth_enabled_to_katello_cdn_configurations.rb +5 -0
- data/db/migrate/20230710190626_remove_relative_path_limit.rb +5 -0
- data/db/migrate/20230717150442_change_change_content_source_job_template_name.rb +20 -0
- data/db/migrate/20230828143236_remove_katello_agent_dispatch_history.rb +15 -0
- data/db/seeds.d/111-upgrade_tasks.rb +1 -2
- data/engines/bastion/app/views/bastion/layouts/assets.html.erb +1 -1
- data/engines/bastion_katello/README.md +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/activation-keys.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-associations-content-hosts.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/views/activation-keys.html +8 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +3 -44
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-module-streams-modal.controller.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-packages-modal.controller.js +1 -65
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html +1 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-packages-modal.html +1 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-debs-applicable.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-errata.controller.js +1 -16
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-module-streams.controller.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-actions.controller.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-applicable.controller.js +2 -11
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-installed.controller.js +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages.controller.js +1 -39
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-debs-applicable.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-errata.html +1 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-actions.html +2 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-applicable.html +4 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-installed.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +2 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +2 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +0 -14
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +0 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/apply-errata.controller.js +1 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/files/details/file-content-views.controller.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/files/details/views/file-content-views.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +235 -521
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-packages.html +13 -2
- data/engines/bastion_katello/lib/bastion_katello/engine.rb +1 -3
- data/lib/katello/engine.rb +0 -18
- data/lib/katello/permission_creator.rb +1 -1
- data/lib/katello/plugin.rb +0 -25
- data/lib/katello/version.rb +1 -1
- data/lib/monkeys/remove_hidden_distribution.rb +383 -0
- data/locale/action_names.rb +3 -1
- data/locale/bn/katello.po +130 -39
- data/locale/bn_IN/katello.po +130 -39
- data/locale/ca/katello.po +130 -39
- data/locale/cs/katello.po +130 -39
- data/locale/cs_CZ/katello.po +130 -39
- data/locale/de/LC_MESSAGES/katello.mo +0 -0
- data/locale/de/katello.po +134 -43
- data/locale/de_AT/katello.po +130 -39
- data/locale/de_DE/katello.po +130 -39
- data/locale/el/katello.po +130 -39
- data/locale/en/katello.po +130 -39
- data/locale/en_GB/katello.po +130 -39
- data/locale/en_US/katello.po +130 -39
- data/locale/es/LC_MESSAGES/katello.mo +0 -0
- data/locale/es/katello.po +133 -42
- data/locale/et_EE/katello.po +130 -39
- data/locale/fr/LC_MESSAGES/katello.mo +0 -0
- data/locale/fr/katello.po +138 -47
- data/locale/gl/katello.po +130 -39
- data/locale/gu/katello.po +130 -39
- data/locale/he_IL/katello.po +130 -39
- data/locale/hi/katello.po +130 -39
- data/locale/id/katello.po +130 -39
- data/locale/it/LC_MESSAGES/katello.mo +0 -0
- data/locale/it/katello.po +131 -40
- data/locale/ja/LC_MESSAGES/katello.mo +0 -0
- data/locale/ja/katello.po +138 -47
- data/locale/ka/LC_MESSAGES/katello.mo +0 -0
- data/locale/ka/katello.po +131 -40
- data/locale/katello.pot +805 -642
- data/locale/kn/katello.po +130 -39
- data/locale/ko/LC_MESSAGES/katello.mo +0 -0
- data/locale/ko/katello.po +131 -40
- data/locale/ml_IN/katello.po +130 -39
- data/locale/mr/katello.po +130 -39
- data/locale/nl_NL/katello.po +130 -39
- data/locale/or/katello.po +130 -39
- data/locale/pa/katello.po +130 -39
- data/locale/pl/katello.po +130 -39
- data/locale/pl_PL/katello.po +130 -39
- data/locale/pt/katello.po +130 -39
- data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
- data/locale/pt_BR/katello.po +133 -42
- data/locale/ro/katello.po +130 -39
- data/locale/ro_RO/katello.po +130 -39
- data/locale/ru/LC_MESSAGES/katello.mo +0 -0
- data/locale/ru/katello.po +131 -40
- data/locale/sl/katello.po +130 -39
- data/locale/sv_SE/katello.po +130 -39
- data/locale/ta/katello.po +130 -39
- data/locale/ta_IN/katello.po +130 -39
- data/locale/te/katello.po +130 -39
- data/locale/tr/katello.po +130 -39
- data/locale/vi/katello.po +130 -39
- data/locale/vi_VN/katello.po +130 -39
- data/locale/zh/katello.po +130 -39
- data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh_CN/katello.po +138 -47
- data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh_TW/katello.po +131 -40
- data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/HostCollectionsModal.js +0 -5
- data/webpack/components/extensions/HostDetails/Tabs/ContentTab/index.js +9 -3
- data/webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErrataTab.js +7 -58
- data/webpack/components/extensions/HostDetails/Tabs/ErrataTab/HostErrataActions.js +2 -11
- data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/HostPackagesActions.js +1 -40
- data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/HostPackagesConstants.js +0 -3
- data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackageInstallModal.js +5 -40
- data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js +6 -65
- data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js +5 -4
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js +0 -212
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/packageInstallModal.test.js +2 -157
- data/webpack/components/extensions/HostDetails/hostDetailsHelpers.js +0 -20
- data/webpack/containers/Application/config.js +5 -0
- data/webpack/scenes/ActivationKeys/Details/ActivationKeyActions.js +31 -0
- data/webpack/scenes/ActivationKeys/Details/ActivationKeyConstants.js +3 -0
- data/webpack/scenes/ActivationKeys/Details/ActivationKeyDetails.js +127 -0
- data/webpack/scenes/ActivationKeys/Details/ActivationKeyDetails.scss +37 -0
- data/webpack/scenes/ActivationKeys/Details/ActivationKeyDetailsSelectors.js +16 -0
- data/webpack/scenes/ActivationKeys/Details/__tests__/activationKeyDetails.test.js +117 -0
- data/webpack/scenes/ActivationKeys/Details/components/DeleteMenu.js +77 -0
- data/webpack/scenes/ActivationKeys/Details/components/DeleteModal.js +63 -0
- data/webpack/scenes/ActivationKeys/Details/components/EditModal.js +199 -0
- data/webpack/scenes/ActivationKeys/Details/index.js +3 -0
- data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditCredentials.js +10 -5
- data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditProducts.js +8 -3
- data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditSmartProxies.js +8 -3
- data/webpack/scenes/AlternateContentSources/Details/__tests__/ACSEdits.test.js +2 -2
- data/webpack/scenes/AlternateContentSources/MainTable/ACSTable.js +1 -1
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewAddModal.js +37 -29
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewBulkAddModal.js +53 -37
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +7 -0
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.fixtures.json +15 -6
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.test.js +6 -5
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/publishedContentViewDetails.fixtures.json +43 -197
- data/webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js +1 -1
- data/webpack/scenes/ContentViews/Details/Filters/Rules/Package/AddEditPackageRuleModal.js +1 -1
- data/webpack/scenes/ContentViews/Details/Promote/ContentViewVersionPromote.js +2 -2
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.fixtures.json +0 -98
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js +103 -1
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersionsLatestEnvironment.fixtures.json +634 -0
- data/webpack/scenes/ContentViews/components/ContentViewSelect/helpers.js +1 -1
- data/webpack/scenes/Hosts/ChangeContentSource/actions.js +14 -12
- data/webpack/scenes/Hosts/ChangeContentSource/components/ContentSourceForm.js +45 -6
- data/webpack/scenes/Hosts/ChangeContentSource/components/ContentSourceTemplate.js +42 -7
- data/webpack/scenes/Hosts/ChangeContentSource/index.js +37 -10
- data/webpack/scenes/Hosts/ChangeContentSource/styles.scss +5 -0
- data/webpack/scenes/RedHatRepositories/index.scss +1 -1
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +2 -2
- metadata +85 -81
- data/app/lib/actions/katello/agent/dispatch_history_presenter.rb +0 -64
- data/app/lib/actions/katello/agent_action.rb +0 -120
- data/app/lib/actions/katello/bulk_agent_action.rb +0 -37
- data/app/lib/actions/katello/host/erratum/applicable_errata_install.rb +0 -44
- data/app/lib/actions/katello/host/erratum/install.rb +0 -38
- data/app/lib/actions/katello/host/package/install.rb +0 -34
- data/app/lib/actions/katello/host/package/remove.rb +0 -48
- data/app/lib/actions/katello/host/package/update.rb +0 -42
- data/app/lib/actions/katello/host/package_group/install.rb +0 -30
- data/app/lib/actions/katello/host/package_group/remove.rb +0 -30
- data/app/lib/katello/agent/base_message.rb +0 -41
- data/app/lib/katello/agent/client_message_handler.rb +0 -69
- data/app/lib/katello/agent/connection.rb +0 -38
- data/app/lib/katello/agent/install_errata_message.rb +0 -25
- data/app/lib/katello/agent/install_package_group_message.rb +0 -25
- data/app/lib/katello/agent/install_package_message.rb +0 -28
- data/app/lib/katello/agent/remove_package_group_message.rb +0 -25
- data/app/lib/katello/agent/remove_package_message.rb +0 -28
- data/app/lib/katello/agent/update_package_message.rb +0 -33
- data/app/lib/katello/event_daemon/services/agent_event_receiver.rb +0 -59
- data/app/lib/katello/qpid/connection.rb +0 -149
- data/app/lib/katello/util/default_enablement_migrator.rb +0 -183
- data/app/models/katello/agent/dispatch_history.rb +0 -19
- data/app/models/katello/events/delete_host_agent_queue.rb +0 -19
- data/app/services/katello/agent/dispatcher.rb +0 -60
- data/app/views/foreman/job_templates/change_content_source.erb +0 -18
- data/app/views/katello/api/v2/sync/index.json.rabl +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/views/katello-agent-notice.html +0 -8
- data/lib/katello/tasks/upgrades/4.9/update_custom_products_enablement.rake +0 -13
- data/webpack/components/extensions/HostDetails/common/KatelloAgentDeprecationAlert.js +0 -23
@@ -1,37 +0,0 @@
|
|
1
|
-
module Actions
|
2
|
-
module Katello
|
3
|
-
class BulkAgentAction < Actions::BulkAction
|
4
|
-
def plan(agent_action, hosts, args)
|
5
|
-
host_ids = hosts.map(&:id)
|
6
|
-
|
7
|
-
histories = ::Katello::Agent::Dispatcher.create_histories(
|
8
|
-
host_ids: host_ids
|
9
|
-
)
|
10
|
-
|
11
|
-
grouped_histories = {}
|
12
|
-
histories.each { |h| grouped_histories[h.host_id] = h.id }
|
13
|
-
options = {
|
14
|
-
dispatch_histories: grouped_histories,
|
15
|
-
type: agent_action.agent_message,
|
16
|
-
content: args[:content],
|
17
|
-
bulk: true
|
18
|
-
}
|
19
|
-
super(agent_action, hosts, options)
|
20
|
-
end
|
21
|
-
|
22
|
-
def spawn_plans
|
23
|
-
args = input[:args].first
|
24
|
-
# args[:dispatch_histories] keys are numeric host ids; they may be integer or string
|
25
|
-
# Hash#slice will return a filtered hash only with the specified keys, and ignore keys that don't exist
|
26
|
-
possible_keys = [*current_batch.map(&:to_i), *current_batch.map(&:to_s)]
|
27
|
-
histories = ::Katello::Agent::DispatchHistory.where(id: args[:dispatch_histories].slice(*possible_keys).values)
|
28
|
-
::Katello::Agent::Dispatcher.dispatch(
|
29
|
-
args[:type].to_sym,
|
30
|
-
histories,
|
31
|
-
content: args[:content]
|
32
|
-
)
|
33
|
-
super
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
module Actions
|
2
|
-
module Katello
|
3
|
-
module Host
|
4
|
-
module Erratum
|
5
|
-
class ApplicableErrataInstall < Actions::EntryAction
|
6
|
-
include Helpers::Presenter
|
7
|
-
|
8
|
-
#takes a list of errata and schedules the installation of those that are applicable
|
9
|
-
def plan(host, options = {})
|
10
|
-
fail _("errata_ids or update_all must be provided") if !options[:errata_ids] && !options[:update_all]
|
11
|
-
errata_ids = options.fetch(:errata_ids, nil)
|
12
|
-
|
13
|
-
applicable_errata = host.content_facet.applicable_errata
|
14
|
-
applicable_errata = applicable_errata.with_identifiers(errata_ids) unless options[:update_all]
|
15
|
-
if applicable_errata.empty?
|
16
|
-
plan_self(:hostname => host.name, :skip => true)
|
17
|
-
else
|
18
|
-
plan_action(Actions::Katello::Host::Erratum::Install, host, content: applicable_errata.pluck(:errata_id))
|
19
|
-
plan_self(:hostname => host.name, :skip => false)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def run
|
24
|
-
if input[:skip]
|
25
|
-
output[:response] = _("No applicable errata for %s, skipping" % input[:hostname])
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def humanized_name
|
30
|
-
if input.try(:[], :hostname).nil?
|
31
|
-
_("Install Applicable Errata")
|
32
|
-
else
|
33
|
-
_("Install Applicable Errata on %s") % input[:hostname]
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def presenter
|
38
|
-
Helpers::Presenter::Delegated.new(self, planned_actions(Katello::Host::Erratum::Install))
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
module Actions
|
2
|
-
module Katello
|
3
|
-
module Host
|
4
|
-
module Erratum
|
5
|
-
class Install < Actions::Katello::AgentAction
|
6
|
-
def self.agent_message
|
7
|
-
:install_errata
|
8
|
-
end
|
9
|
-
|
10
|
-
def agent_action_type
|
11
|
-
:content_install
|
12
|
-
end
|
13
|
-
|
14
|
-
def humanized_name
|
15
|
-
if input.try(:[], :hostname)
|
16
|
-
_("Install erratum for %s") % input[:hostname]
|
17
|
-
else
|
18
|
-
_("Install erratum")
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def humanized_input
|
23
|
-
[input[:content].join(", ")] + super
|
24
|
-
end
|
25
|
-
|
26
|
-
def resource_locks
|
27
|
-
:link
|
28
|
-
end
|
29
|
-
|
30
|
-
def finalize
|
31
|
-
host = ::Host.find_by(:id => input[:host_id])
|
32
|
-
host.update(audit_comment: (_("Installation of errata requested: %{errata}") % {errata: input[:content].join(", ")}).truncate(255))
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
module Actions
|
2
|
-
module Katello
|
3
|
-
module Host
|
4
|
-
module Package
|
5
|
-
class Install < Actions::Katello::AgentAction
|
6
|
-
def self.agent_message
|
7
|
-
:install_package
|
8
|
-
end
|
9
|
-
|
10
|
-
def agent_action_type
|
11
|
-
:content_install
|
12
|
-
end
|
13
|
-
|
14
|
-
def humanized_name
|
15
|
-
if input.try(:[], :hostname)
|
16
|
-
_("Install package for %s") % input[:hostname]
|
17
|
-
else
|
18
|
-
_("Install package")
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def humanized_input
|
23
|
-
[input[:content].join(", ")] + super
|
24
|
-
end
|
25
|
-
|
26
|
-
def finalize
|
27
|
-
host = ::Host.find_by(:id => input[:host_id])
|
28
|
-
host.update(audit_comment: (_("Installation of package(s) requested: %{packages}") % {packages: input[:content].join(", ")}).truncate(255))
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
module Actions
|
2
|
-
module Katello
|
3
|
-
module Host
|
4
|
-
module Package
|
5
|
-
class Remove < Actions::Katello::AgentAction
|
6
|
-
def self.agent_message
|
7
|
-
:remove_package
|
8
|
-
end
|
9
|
-
|
10
|
-
def agent_action_type
|
11
|
-
:content_uninstall
|
12
|
-
end
|
13
|
-
|
14
|
-
def humanized_name
|
15
|
-
if input.try(:[], :hostname)
|
16
|
-
_("Remove package for %s") % input[:hostname]
|
17
|
-
else
|
18
|
-
_("Remove package")
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def humanized_input
|
23
|
-
[humanized_package_names.join(', ')] + super
|
24
|
-
end
|
25
|
-
|
26
|
-
def humanized_package_names
|
27
|
-
input[:content].inject([]) do |result, package|
|
28
|
-
if package.is_a?(Hash)
|
29
|
-
new_name = package.include?(:name) ? package[:name] : ""
|
30
|
-
new_name += '-' + package[:version] if package.include?(:version)
|
31
|
-
new_name += '.' + package[:release] if package.include?(:release)
|
32
|
-
new_name += '.' + package[:arch] if package.include?(:arch)
|
33
|
-
result << new_name
|
34
|
-
else
|
35
|
-
result << package
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def finalize
|
41
|
-
host = ::Host.find_by(:id => input[:host_id])
|
42
|
-
host.update(audit_comment: (_("Removal of package(s) requested: %{packages}") % {packages: input[:content].join(", ")}).truncate(255))
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
module Actions
|
2
|
-
module Katello
|
3
|
-
module Host
|
4
|
-
module Package
|
5
|
-
class Update < Actions::Katello::AgentAction
|
6
|
-
def self.agent_message
|
7
|
-
:update_package
|
8
|
-
end
|
9
|
-
|
10
|
-
def agent_action_type
|
11
|
-
:content_install
|
12
|
-
end
|
13
|
-
|
14
|
-
def humanized_name
|
15
|
-
if input.try(:[], :hostname)
|
16
|
-
_("Update package for %s") % input[:hostname]
|
17
|
-
else
|
18
|
-
_("Update package")
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def humanized_input
|
23
|
-
[(input[:content].present? && input[:content].join(", ") || "all packages")] + super
|
24
|
-
end
|
25
|
-
|
26
|
-
def finalize
|
27
|
-
host = ::Host.find_by(:id => input[:host_id])
|
28
|
-
host.update(audit_comment: audit_comment)
|
29
|
-
end
|
30
|
-
|
31
|
-
def audit_comment
|
32
|
-
if input[:content].present?
|
33
|
-
(_("Update of package(s) requested: %{packages}") % {packages: input[:content].join(", ")}).truncate(255)
|
34
|
-
else
|
35
|
-
_("Update of all packages requested")
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
module Actions
|
2
|
-
module Katello
|
3
|
-
module Host
|
4
|
-
module PackageGroup
|
5
|
-
class Install < Actions::Katello::AgentAction
|
6
|
-
def self.agent_message
|
7
|
-
:install_package_group
|
8
|
-
end
|
9
|
-
|
10
|
-
def agent_action_type
|
11
|
-
:content_install
|
12
|
-
end
|
13
|
-
|
14
|
-
def humanized_name
|
15
|
-
_("Install package group")
|
16
|
-
end
|
17
|
-
|
18
|
-
def humanized_input
|
19
|
-
[input[:content].join(", ")] + super
|
20
|
-
end
|
21
|
-
|
22
|
-
def finalize
|
23
|
-
host = ::Host.find_by(:id => input[:host_id])
|
24
|
-
host.update(audit_comment: (_("Installation of package group(s) requested: %{groups}") % {groups: input[:content].join(", ")}).truncate(255))
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
module Actions
|
2
|
-
module Katello
|
3
|
-
module Host
|
4
|
-
module PackageGroup
|
5
|
-
class Remove < Actions::Katello::AgentAction
|
6
|
-
def self.agent_message
|
7
|
-
:remove_package_group
|
8
|
-
end
|
9
|
-
|
10
|
-
def agent_action_type
|
11
|
-
:content_uninstall
|
12
|
-
end
|
13
|
-
|
14
|
-
def humanized_name
|
15
|
-
_("Remove package group")
|
16
|
-
end
|
17
|
-
|
18
|
-
def humanized_input
|
19
|
-
[input[:content].join(', ')] + super
|
20
|
-
end
|
21
|
-
|
22
|
-
def finalize
|
23
|
-
host = ::Host.find_by(:id => input[:host_id])
|
24
|
-
host.update(audit_comment: (_("Removal of package group(s) requested: %{groups}") % {groups: input[:content].join(", ")}).truncate(255))
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
module Agent
|
3
|
-
class BaseMessage
|
4
|
-
attr_accessor :dispatch_history_id, :recipient_address, :reply_to
|
5
|
-
|
6
|
-
def json
|
7
|
-
{
|
8
|
-
data: {
|
9
|
-
consumer_id: @consumer_id,
|
10
|
-
dispatch_history_id: dispatch_history_id
|
11
|
-
},
|
12
|
-
replyto: reply_to,
|
13
|
-
request: {
|
14
|
-
args: [
|
15
|
-
units, options
|
16
|
-
],
|
17
|
-
classname: "Content",
|
18
|
-
cntr: [[], {}],
|
19
|
-
kws: {},
|
20
|
-
method: @method
|
21
|
-
},
|
22
|
-
routing: [
|
23
|
-
nil,
|
24
|
-
recipient_address
|
25
|
-
],
|
26
|
-
version: "2.0"
|
27
|
-
}
|
28
|
-
end
|
29
|
-
|
30
|
-
def options # may be overridden by children
|
31
|
-
{
|
32
|
-
importkeys: true
|
33
|
-
}
|
34
|
-
end
|
35
|
-
|
36
|
-
def to_s
|
37
|
-
json.to_json
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
@@ -1,69 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
module Agent
|
3
|
-
class ClientMessageHandler
|
4
|
-
def initialize(message)
|
5
|
-
logger.debug("client message: #{message.body}")
|
6
|
-
@json = parse_message_json(message)
|
7
|
-
dispatch_history_id = @json&.dig(:data, :dispatch_history_id)
|
8
|
-
@dispatch_history = Katello::Agent::DispatchHistory.find_by_id(dispatch_history_id)
|
9
|
-
|
10
|
-
unless @dispatch_history
|
11
|
-
logger.error("Invalid client message: #{@json}")
|
12
|
-
fail("No valid dispatch history in client message")
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
def accepted?
|
17
|
-
@json[:status] == 'accepted'
|
18
|
-
end
|
19
|
-
|
20
|
-
def result
|
21
|
-
@json.dig(:result, :retval, :details)
|
22
|
-
end
|
23
|
-
|
24
|
-
def handle
|
25
|
-
@dispatch_history.accepted_at = DateTime.now if accepted?
|
26
|
-
@dispatch_history.result = result if result
|
27
|
-
@dispatch_history.save!
|
28
|
-
|
29
|
-
if @dispatch_history.dynflow_execution_plan_id && @dispatch_history.dynflow_step_id
|
30
|
-
handle_dynflow_event
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
private
|
35
|
-
|
36
|
-
def handle_dynflow_event
|
37
|
-
return unless accepted? || result
|
38
|
-
|
39
|
-
task = ForemanTasks::Task.find_by_external_id(@dispatch_history.dynflow_execution_plan_id)
|
40
|
-
|
41
|
-
unless task
|
42
|
-
logger.info("Task external_id=#{@dispatch_history.dynflow_execution_plan_id} wasn't found. Skipping dynflow event dispatch")
|
43
|
-
return
|
44
|
-
end
|
45
|
-
|
46
|
-
unless task.result == 'pending'
|
47
|
-
logger.info("Task is no longer pending. Skipping dynflow event dispatch. task_result=#{task.result} external_id=#{@dispatch_history.dynflow_execution_plan_id} dispatch_history_id=#{@dispatch_history.id}")
|
48
|
-
return
|
49
|
-
end
|
50
|
-
|
51
|
-
if accepted?
|
52
|
-
ForemanTasks.dynflow.world.event(@dispatch_history.dynflow_execution_plan_id, @dispatch_history.dynflow_step_id, 'accepted')
|
53
|
-
elsif result
|
54
|
-
ForemanTasks.dynflow.world.event(@dispatch_history.dynflow_execution_plan_id, @dispatch_history.dynflow_step_id, 'finished')
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
def parse_message_json(message)
|
59
|
-
JSON.parse(message.body).with_indifferent_access
|
60
|
-
rescue
|
61
|
-
nil
|
62
|
-
end
|
63
|
-
|
64
|
-
def logger
|
65
|
-
::Foreman::Logging.logger('katello/agent')
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
module Agent
|
3
|
-
class Connection
|
4
|
-
def initialize
|
5
|
-
@connection = ::Katello::Qpid::Connection.new(
|
6
|
-
url: settings[:broker_url],
|
7
|
-
ssl_cert_file: settings[:broker_ssl_cert_file],
|
8
|
-
ssl_key_file: settings[:broker_ssl_key_file],
|
9
|
-
ssl_ca_file: settings[:broker_ssl_ca_file]
|
10
|
-
)
|
11
|
-
end
|
12
|
-
|
13
|
-
def send_messages(messages)
|
14
|
-
@connection.send_messages(messages)
|
15
|
-
end
|
16
|
-
|
17
|
-
def fetch_agent_messages(handler = ClientMessageHandler)
|
18
|
-
@connection.receive_messages(address: settings[:event_queue_name], handler: handler)
|
19
|
-
end
|
20
|
-
|
21
|
-
def delete_client_queue(queue_name)
|
22
|
-
@connection.delete_queue(queue_name)
|
23
|
-
end
|
24
|
-
|
25
|
-
def settings
|
26
|
-
SETTINGS[:katello][:agent]
|
27
|
-
end
|
28
|
-
|
29
|
-
def open?
|
30
|
-
@connection.open?
|
31
|
-
end
|
32
|
-
|
33
|
-
def close
|
34
|
-
@connection.close
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
module Agent
|
3
|
-
class InstallErrataMessage < BaseMessage
|
4
|
-
def initialize(content:, consumer_id:)
|
5
|
-
@errata_ids = content
|
6
|
-
@consumer_id = consumer_id
|
7
|
-
@content_type = 'erratum'
|
8
|
-
@method = 'install'
|
9
|
-
end
|
10
|
-
|
11
|
-
protected
|
12
|
-
|
13
|
-
def units
|
14
|
-
@errata_ids.map do |id|
|
15
|
-
{
|
16
|
-
type_id: @content_type,
|
17
|
-
unit_key: {
|
18
|
-
id: id
|
19
|
-
}
|
20
|
-
}
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
module Agent
|
3
|
-
class InstallPackageGroupMessage < BaseMessage
|
4
|
-
def initialize(content:, consumer_id:)
|
5
|
-
@groups = content
|
6
|
-
@consumer_id = consumer_id
|
7
|
-
@content_type = 'package_group'
|
8
|
-
@method = 'install'
|
9
|
-
end
|
10
|
-
|
11
|
-
protected
|
12
|
-
|
13
|
-
def units
|
14
|
-
@groups.map do |group|
|
15
|
-
{
|
16
|
-
type_id: @content_type,
|
17
|
-
unit_key: {
|
18
|
-
name: group
|
19
|
-
}
|
20
|
-
}
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
module Agent
|
3
|
-
class InstallPackageMessage < BaseMessage
|
4
|
-
def initialize(content:, consumer_id:)
|
5
|
-
@packages = content
|
6
|
-
@consumer_id = consumer_id
|
7
|
-
@content_type = 'rpm'
|
8
|
-
@method = 'install'
|
9
|
-
end
|
10
|
-
|
11
|
-
protected
|
12
|
-
|
13
|
-
def units
|
14
|
-
@packages.map do |package|
|
15
|
-
nvra = ::Katello::Util::Package.parse_nvrea_nvre(package)
|
16
|
-
unit_key = nvra || {
|
17
|
-
name: package
|
18
|
-
}
|
19
|
-
|
20
|
-
{
|
21
|
-
type_id: @content_type,
|
22
|
-
unit_key: unit_key
|
23
|
-
}
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
module Agent
|
3
|
-
class RemovePackageGroupMessage < BaseMessage
|
4
|
-
def initialize(content:, consumer_id:)
|
5
|
-
@groups = content
|
6
|
-
@consumer_id = consumer_id
|
7
|
-
@content_type = 'package_group'
|
8
|
-
@method = 'uninstall'
|
9
|
-
end
|
10
|
-
|
11
|
-
protected
|
12
|
-
|
13
|
-
def units
|
14
|
-
@groups.map do |group|
|
15
|
-
{
|
16
|
-
type_id: @content_type,
|
17
|
-
unit_key: {
|
18
|
-
name: group
|
19
|
-
}
|
20
|
-
}
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
module Agent
|
3
|
-
class RemovePackageMessage < BaseMessage
|
4
|
-
def initialize(content:, consumer_id:)
|
5
|
-
@packages = content
|
6
|
-
@consumer_id = consumer_id
|
7
|
-
@content_type = 'rpm'
|
8
|
-
@method = 'uninstall'
|
9
|
-
end
|
10
|
-
|
11
|
-
protected
|
12
|
-
|
13
|
-
def units
|
14
|
-
@packages.map do |package|
|
15
|
-
nvra = ::Katello::Util::Package.parse_nvrea_nvre(package)
|
16
|
-
unit_key = nvra || {
|
17
|
-
name: package
|
18
|
-
}
|
19
|
-
|
20
|
-
{
|
21
|
-
type_id: @content_type,
|
22
|
-
unit_key: unit_key
|
23
|
-
}
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
module Agent
|
3
|
-
class UpdatePackageMessage < BaseMessage
|
4
|
-
def initialize(content:, consumer_id:)
|
5
|
-
@packages = content
|
6
|
-
@consumer_id = consumer_id
|
7
|
-
@content_type = 'rpm'
|
8
|
-
@method = 'update'
|
9
|
-
end
|
10
|
-
|
11
|
-
protected
|
12
|
-
|
13
|
-
def options
|
14
|
-
ops = super
|
15
|
-
ops[:all] = true if @packages.blank?
|
16
|
-
ops
|
17
|
-
end
|
18
|
-
|
19
|
-
def units
|
20
|
-
return [{ type_id: @content_type, unit_key: {}}] if @packages.blank?
|
21
|
-
|
22
|
-
@packages.map do |package|
|
23
|
-
{
|
24
|
-
type_id: @content_type,
|
25
|
-
unit_key: {
|
26
|
-
name: package
|
27
|
-
}
|
28
|
-
}
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,59 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
module EventDaemon
|
3
|
-
module Services
|
4
|
-
class AgentEventReceiver
|
5
|
-
class Handler
|
6
|
-
attr_accessor :processed, :failed
|
7
|
-
|
8
|
-
def initialize
|
9
|
-
@processed = 0
|
10
|
-
@failed = 0
|
11
|
-
end
|
12
|
-
|
13
|
-
def handle(message)
|
14
|
-
::Katello::Util::Support.with_db_connection do
|
15
|
-
::Katello::Agent::ClientMessageHandler.new(message).handle
|
16
|
-
@processed += 1
|
17
|
-
rescue => e
|
18
|
-
@failed += 1
|
19
|
-
Rails.logger.error("Error handling Katello Agent client message")
|
20
|
-
Rails.logger.error(e.message)
|
21
|
-
Rails.logger.error(e.backtrace.join("\n"))
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def self.logger
|
27
|
-
::Foreman::Logging.logger('katello/agent')
|
28
|
-
end
|
29
|
-
|
30
|
-
def self.run
|
31
|
-
fail("Katello agent event receiver already started") if running?
|
32
|
-
|
33
|
-
@thread = Thread.new do
|
34
|
-
@handler = Handler.new
|
35
|
-
@agent_connection = ::Katello::Agent::Connection.new
|
36
|
-
@agent_connection.fetch_agent_messages(@handler)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def self.close
|
41
|
-
@agent_connection&.close
|
42
|
-
@thread&.join
|
43
|
-
end
|
44
|
-
|
45
|
-
def self.running?
|
46
|
-
@agent_connection&.open? && @thread&.status.present?
|
47
|
-
end
|
48
|
-
|
49
|
-
def self.status
|
50
|
-
{
|
51
|
-
running: running?,
|
52
|
-
processed_count: @handler&.processed || 0,
|
53
|
-
failed_count: @handler&.failed || 0
|
54
|
-
}
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|