katello 4.1.4 → 4.2.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/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +2 -2
- data/app/controllers/katello/api/v2/content_credentials_controller.rb +3 -3
- data/app/controllers/katello/api/v2/content_uploads_controller.rb +3 -1
- data/app/controllers/katello/api/v2/content_view_components_controller.rb +33 -1
- data/app/controllers/katello/api/v2/content_views_controller.rb +12 -0
- data/app/controllers/katello/api/v2/host_errata_controller.rb +1 -1
- data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +1 -2
- data/app/controllers/katello/api/v2/products_controller.rb +4 -4
- data/app/controllers/katello/api/v2/repositories_bulk_actions_controller.rb +3 -11
- data/app/controllers/katello/api/v2/repositories_controller.rb +68 -47
- data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +0 -28
- data/app/controllers/katello/concerns/api/v2/registration_commands_controller_extensions.rb +26 -5
- data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +26 -1
- data/app/lib/actions/candlepin/environment/destroy.rb +2 -0
- data/app/lib/actions/katello/agent_action.rb +2 -2
- data/app/lib/actions/katello/capsule_content/sync_capsule.rb +3 -2
- data/app/lib/actions/katello/{gpg_key → content_credential}/update.rb +1 -1
- data/app/lib/actions/katello/content_view/publish.rb +6 -1
- data/app/lib/actions/katello/content_view_version/create_repos.rb +1 -1
- data/app/lib/actions/katello/content_view_version/incremental_update.rb +0 -47
- data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +1 -1
- data/app/lib/actions/katello/repository/clone_contents.rb +1 -7
- data/app/lib/actions/katello/repository/clone_to_environment.rb +1 -7
- data/app/lib/actions/katello/repository/create.rb +4 -8
- data/app/lib/actions/katello/repository/create_root.rb +1 -1
- data/app/lib/actions/katello/repository/destroy.rb +1 -3
- data/app/lib/actions/katello/repository/import_upload.rb +3 -2
- data/app/lib/actions/katello/repository/instance_update.rb +1 -1
- data/app/lib/actions/katello/repository/metadata_generate.rb +2 -8
- data/app/lib/actions/katello/repository/multi_clone_contents.rb +0 -1
- data/app/lib/actions/katello/repository/refresh_repository.rb +1 -4
- data/app/lib/actions/katello/repository/remove_content.rb +6 -4
- data/app/lib/actions/katello/repository/sync.rb +5 -25
- data/app/lib/actions/katello/repository/update.rb +1 -2
- data/app/lib/actions/katello/repository/update_http_proxy_details.rb +2 -5
- data/app/lib/actions/katello/repository/update_redhat_repository.rb +1 -1
- data/app/lib/actions/katello/repository/upload_files.rb +8 -3
- data/app/lib/actions/katello/repository/upload_package_group.rb +2 -11
- data/app/lib/actions/katello/repository/verify_checksum.rb +0 -1
- data/app/lib/actions/katello/repository_set/enable_repository.rb +1 -1
- data/app/lib/actions/pulp3/orchestration/repository/create.rb +2 -2
- data/app/lib/actions/pulp3/repository/create.rb +3 -4
- data/app/lib/actions/pulp3/repository/create_remote.rb +1 -6
- data/app/lib/actions/pulp3/repository/repair.rb +4 -0
- data/app/lib/katello/errors.rb +1 -0
- data/app/lib/katello/http_resource.rb +26 -73
- data/app/lib/katello/qpid/connection.rb +1 -3
- data/app/lib/katello/resources/candlepin/consumer.rb +1 -1
- data/app/lib/katello/resources/candlepin/environment.rb +2 -0
- data/app/lib/katello/resources/registry.rb +7 -20
- data/app/lib/katello/util/http_proxy.rb +0 -3
- data/app/lib/katello/validators/gpg_key_content_validator.rb +1 -1
- data/app/models/katello/authorization/{gpg_key.rb → content_credential.rb} +1 -1
- data/app/models/katello/authorization/product.rb +0 -4
- data/app/models/katello/concerns/host_managed_extensions.rb +2 -16
- data/app/models/katello/concerns/organization_extensions.rb +1 -1
- data/app/models/katello/concerns/pulp_database_unit.rb +13 -5
- data/app/models/katello/concerns/smart_proxy_extensions.rb +45 -41
- data/app/models/katello/{gpg_key.rb → content_credential.rb} +4 -4
- data/app/models/katello/content_view.rb +6 -1
- data/app/models/katello/generic_content_unit.rb +16 -0
- data/app/models/katello/glue/pulp/repos.rb +9 -25
- data/app/models/katello/kt_environment.rb +1 -1
- data/app/models/katello/product.rb +4 -4
- data/app/models/katello/repository.rb +13 -7
- data/app/models/katello/repository_generic_content_unit.rb +7 -0
- data/app/models/katello/root_repository.rb +38 -7
- data/app/models/setting/content.rb +5 -0
- data/app/services/cert/certs.rb +16 -8
- data/app/services/katello/applicability/applicable_content_helper.rb +1 -2
- data/app/services/katello/candlepin/consumer.rb +6 -0
- data/app/services/katello/component_view_presenter.rb +27 -0
- data/app/services/katello/pulp/repository.rb +1 -1
- data/app/services/katello/pulp/server.rb +2 -2
- data/app/services/katello/pulp3/api/core.rb +4 -0
- data/app/services/katello/pulp3/api/generic.rb +68 -0
- data/app/services/katello/pulp3/generic_content_unit.rb +29 -0
- data/app/services/katello/pulp3/pulp_content_unit.rb +5 -1
- data/app/services/katello/pulp3/repository/generic.rb +94 -0
- data/app/services/katello/pulp3/repository/yum.rb +4 -5
- data/app/services/katello/pulp3/repository.rb +27 -12
- data/app/services/katello/pulp3/repository_mirror.rb +2 -2
- data/app/services/katello/pulp3/smart_proxy_repository.rb +4 -4
- data/app/services/katello/registration_manager.rb +18 -7
- data/app/services/katello/repository_type.rb +59 -1
- data/app/services/katello/repository_type_manager.rb +116 -24
- data/app/views/katello/api/v2/content_views/base.json.rabl +4 -4
- data/app/views/katello/api/v2/repositories/show.json.rabl +1 -0
- data/app/views/smart_proxies/plugins/_pulpcore.html.erb +2 -5
- data/app/views/smart_proxies/pulp_status.html.erb +0 -7
- data/config/katello.yaml.example +0 -21
- data/config/routes/api/v2.rb +2 -1
- data/db/functions/deb_version_cmp_v01.sql +200 -0
- data/db/migrate/20171110082124_add_ssl_certs_to_products_and_repos.rb +5 -1
- data/db/migrate/20200402130013_add_repsoitory_docker_meta_tag_f_key.rb +3 -1
- data/db/migrate/20210624221630_katello_generic_content.rb +22 -0
- data/db/migrate/20210625095042_add_retain_package_versions_count.rb +9 -0
- data/db/migrate/20210628182553_add_generic_remote_options_to_root_repository.rb +5 -0
- data/db/migrate/20210714140440_remove_repo_export_permission.rb +5 -0
- data/db/migrate/20210721163730_change_gpg_keys_to_content_credentials.rb +8 -0
- data/db/migrate/20210728130748_create_function_deb_version_cmp.rb +12 -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/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.controller.js +7 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html +4 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/apply-errata.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/views/apply-errata-confirm.html +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +25 -33
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/views/products-bulk-advanced-sync-modal.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-repositories.controller.js +1 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +10 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.filter.js +9 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details.controller.js +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-advanced-sync-options.html +1 -25
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-details.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +31 -13
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +11 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +0 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/aggregate-task.factory.js +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task.factory.js +1 -1
- data/lib/katello/engine.rb +2 -4
- data/lib/katello/permission_creator.rb +6 -12
- data/lib/katello/plugin.rb +76 -80
- data/lib/katello/repository_types/python.rb +37 -0
- data/lib/katello/tasks/reimport.rake +0 -9
- data/lib/katello/tasks/repository.rake +3 -4
- data/lib/katello/version.rb +1 -1
- data/locale/action_names.rb +28 -29
- data/locale/bn/katello.po +699 -221
- data/locale/cs/katello.po +167 -59
- data/locale/de/katello.po +585 -352
- data/locale/en/katello.po +167 -59
- data/locale/es/katello.po +1388 -1189
- data/locale/fr/katello.po +1740 -1494
- data/locale/gu/katello.po +896 -416
- data/locale/hi/katello.po +892 -415
- data/locale/it/katello.po +371 -170
- data/locale/ja/katello.po +1657 -1439
- data/locale/katello.pot +933 -736
- data/locale/kn/katello.po +894 -416
- data/locale/ko/katello.po +515 -317
- data/locale/mr/katello.po +857 -415
- data/locale/or/katello.po +894 -416
- data/locale/pa/katello.po +874 -411
- data/locale/pt/katello.po +347 -154
- data/locale/pt_BR/katello.po +1398 -1215
- data/locale/ru/katello.po +671 -463
- data/locale/ta/katello.po +697 -221
- data/locale/te/katello.po +891 -415
- data/locale/zh_CN/katello.po +2029 -1845
- data/locale/zh_TW/katello.po +735 -407
- data/package.json +3 -1
- data/webpack/components/EditableTextInput/EditableTextInput.js +3 -3
- data/webpack/components/RoutedTabs/RoutedTabs.js +7 -8
- data/webpack/components/Table/TableWrapper.js +19 -11
- data/webpack/components/Table/helpers.js +1 -1
- data/webpack/components/extensions/HostDetails/Tabs/ContentTab.js +42 -0
- data/webpack/components/extensions/HostDetails/Tabs/SubscriptionTab.js +12 -0
- data/webpack/components/extensions/RegistrationCommands/__tests__/__snapshots__/ActivationKeys.test.js.snap +4 -0
- data/webpack/components/extensions/RegistrationCommands/fields/ActivationKeys.js +1 -1
- data/webpack/components/extensions/RegistrationCommands/index.js +1 -2
- data/webpack/components/pf3Table/formatters/selectionHeaderCellFormatter.js +2 -1
- data/webpack/fills_index.js +4 -1
- data/webpack/redux/actions/RedHatRepositories/helpers.js +2 -4
- data/webpack/redux/reducers/RedHatRepositories/enabled.js +4 -1
- data/webpack/scenes/ContentViews/ContentViewsActions.js +16 -1
- data/webpack/scenes/ContentViews/ContentViewsConstants.js +15 -0
- data/webpack/scenes/ContentViews/ContentViewsPage.js +12 -22
- data/webpack/scenes/ContentViews/Copy/CopyContentViewForm.js +4 -3
- data/webpack/scenes/ContentViews/Create/CreateContentViewForm.js +25 -14
- data/webpack/scenes/ContentViews/Create/CreateContentViewModal.js +4 -2
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewAddModal.js +153 -0
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentVersion.js +21 -10
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +157 -19
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.fixtures.json +100 -108
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.test.js +140 -16
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/publishedContentViewDetails.fixtures.json +367 -0
- data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +59 -6
- data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +43 -0
- data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +44 -13
- data/webpack/scenes/ContentViews/Details/Filters/Add/CVFilterAddModal.js +161 -0
- data/webpack/scenes/ContentViews/Details/Filters/Add/__tests__/cvFilterAdd.test.js +54 -0
- data/webpack/scenes/ContentViews/Details/Filters/Add/__tests__/cvFilterCreateResult.fixtures.json +124 -0
- data/webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js +8 -6
- data/webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js +7 -6
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetails.js +4 -3
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js +71 -12
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js +77 -0
- data/webpack/scenes/ContentViews/Details/Histories/ContentViewHistories.js +13 -12
- data/webpack/scenes/ContentViews/Details/Histories/__tests__/contentViewHistory.test.js +2 -2
- data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +17 -14
- data/webpack/scenes/ContentViews/Details/Repositories/LastSync.js +3 -3
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewAddRemove.test.js +2 -2
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.test.js +6 -2
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js +61 -20
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewTaskInProgressResponse.fixtures.json +71 -0
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewTaskResponse.fixtures.json +75 -0
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js +86 -1
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersionsWithTask.fixtures.json +713 -0
- data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +3 -0
- data/webpack/scenes/ContentViews/Publish/CVPublishFinish.js +184 -0
- data/webpack/scenes/ContentViews/Publish/CVPublishForm.js +104 -0
- data/webpack/scenes/ContentViews/Publish/CVPublishReview.js +71 -0
- data/webpack/scenes/ContentViews/Publish/ContentViewPublishSelectors.js +17 -0
- data/webpack/scenes/ContentViews/Publish/PublishContentViewWizard.js +145 -0
- data/webpack/scenes/ContentViews/Publish/__tests__/environmentPaths.fixtures.json +352 -0
- data/webpack/scenes/ContentViews/Publish/__tests__/publishContentView.test.js +184 -0
- data/webpack/scenes/ContentViews/Publish/__tests__/publishResponse.fixture.json +69 -0
- data/webpack/scenes/ContentViews/Publish/cvPublishForm.scss +3 -0
- data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +75 -48
- data/webpack/scenes/ContentViews/Table/tableDataGenerator.js +15 -2
- data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +6 -10
- data/webpack/scenes/ContentViews/components/EnvironmentLabels.js +22 -10
- data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPathActions.js +12 -0
- data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPathConstants.js +2 -0
- data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPathSelectors.js +16 -0
- data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPaths.js +72 -0
- data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPaths.scss +8 -0
- data/webpack/scenes/ContentViews/components/TaskPresenter/TaskPresenter.js +85 -0
- data/webpack/scenes/SmartProxy/SmartProxyContentTable.js +9 -8
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +4 -25
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +0 -3
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +3 -3
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +4 -2
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +24 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/components/Table.js +4 -1
- data/webpack/scenes/Subscriptions/index.js +1 -4
- metadata +74 -39
- data/app/lib/actions/candlepin/environment/create.rb +0 -21
- data/app/lib/actions/foreman/environment/destroy.rb +0 -23
- data/app/lib/actions/katello/content_view/environment_create.rb +0 -21
- data/app/lib/actions/katello/repository/export.rb +0 -85
- data/app/lib/actions/katello/repository/purge_empty_content.rb +0 -16
- data/app/lib/actions/katello/repository/upload_errata.rb +0 -38
- data/app/lib/katello/util/proxy_uri.rb +0 -64
- data/app/models/katello/rhsm_fact_importer.rb +0 -20
- data/app/models/katello/rhsm_fact_name.rb +0 -17
- data/app/models/katello/rhsm_fact_parser.rb +0 -120
@@ -1,23 +0,0 @@
|
|
1
|
-
module Actions
|
2
|
-
module Foreman
|
3
|
-
module Environment
|
4
|
-
class Destroy < Actions::Base
|
5
|
-
def plan(environment)
|
6
|
-
if environment.hosts.count > 0
|
7
|
-
names = environment.hosts.limit(5).pluck(:name).join(', ')
|
8
|
-
fail _("The environment %{name} is in use by %{count} Host(s) including %{names}") %
|
9
|
-
{:name => environment.name, :names => names, :count => environment.hosts.count}
|
10
|
-
end
|
11
|
-
|
12
|
-
if environment.hostgroups.count > 0
|
13
|
-
names = environment.hostgroups.limit(5).pluck(:name).join(', ')
|
14
|
-
fail _("The environment %{name} is in use by %{count} Host Group(s) including %{names}") %
|
15
|
-
{:name => environment.name, :names => names, :count => environment.hostgroups.count}
|
16
|
-
end
|
17
|
-
|
18
|
-
environment.destroy!
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Actions
|
2
|
-
module Katello
|
3
|
-
module ContentView
|
4
|
-
class EnvironmentCreate < Actions::Base
|
5
|
-
def plan(content_view_environment)
|
6
|
-
content_view_environment.save!
|
7
|
-
content_view = content_view_environment.content_view
|
8
|
-
plan_action(Candlepin::Environment::Create,
|
9
|
-
organization_label: content_view.organization.label,
|
10
|
-
cp_id: content_view_environment.cp_id,
|
11
|
-
name: content_view_environment.label,
|
12
|
-
description: content_view.description)
|
13
|
-
end
|
14
|
-
|
15
|
-
def humanized_name
|
16
|
-
_("Create")
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,85 +0,0 @@
|
|
1
|
-
module Actions
|
2
|
-
module Katello
|
3
|
-
module Repository
|
4
|
-
class Export < Actions::EntryAction
|
5
|
-
input_format do
|
6
|
-
param :id, Integer
|
7
|
-
param :export_result, Hash
|
8
|
-
end
|
9
|
-
|
10
|
-
EXPORT_OUTPUT_BASEDIR = "/var/lib/pulp/published/yum/master/group_export_distributor/".freeze
|
11
|
-
|
12
|
-
def plan(repos, export_to_iso, since, iso_size, group_id)
|
13
|
-
unless File.directory?(Setting['pulp_export_destination'])
|
14
|
-
fail ::Foreman::Exception, N_("Unable to export, 'pulp_export_destination' setting is not set to a valid directory.")
|
15
|
-
end
|
16
|
-
|
17
|
-
unless File.writable?(Setting['pulp_export_destination'])
|
18
|
-
fail ::Foreman::Exception, N_("Unable to export. 'pulp_export_destination' setting is not a writable directory.")
|
19
|
-
end
|
20
|
-
|
21
|
-
repo_pulp_ids = repos.collect do |repo|
|
22
|
-
action_subject(repo)
|
23
|
-
repo.pulp_id
|
24
|
-
end
|
25
|
-
|
26
|
-
start_date = since ? since.iso8601 : nil
|
27
|
-
unless since.nil?
|
28
|
-
group_id += "-incremental"
|
29
|
-
end
|
30
|
-
|
31
|
-
# create an export path that's the same as the ISO export path. Pulp
|
32
|
-
# only uses this when exporting to a directory, but we want to keep
|
33
|
-
# things as similar as possible.
|
34
|
-
# Additionally, we want Pulp to export to dirs that Pulp owns, and
|
35
|
-
# then Katello can copy it over as needed. This is needed for SELinux
|
36
|
-
# reasons.
|
37
|
-
export_directory = File.join(EXPORT_OUTPUT_BASEDIR, group_id)
|
38
|
-
|
39
|
-
sequence do
|
40
|
-
copy_units(repos)
|
41
|
-
plan_action(Pulp::RepositoryGroup::Create, :id => group_id,
|
42
|
-
:pulp_ids => repo_pulp_ids)
|
43
|
-
plan_action(Pulp::RepositoryGroup::Export, :id => group_id,
|
44
|
-
:export_to_iso => export_to_iso,
|
45
|
-
:iso_size => iso_size,
|
46
|
-
:start_date => start_date,
|
47
|
-
:export_directory => export_directory)
|
48
|
-
plan_self(:group_id => group_id, :export_to_iso => export_to_iso)
|
49
|
-
# NB: the delete will also make Pulp delete our exported data under /var/lib/pulp
|
50
|
-
plan_action(Pulp::RepositoryGroup::Delete, :id => group_id)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
def run
|
55
|
-
# copy the export to a place we have permission to write to. We let
|
56
|
-
# Pulp do the deletion as part of repo group delete since it's under
|
57
|
-
# /v/l/p.
|
58
|
-
export_location = File.join(EXPORT_OUTPUT_BASEDIR, input[:group_id])
|
59
|
-
FileUtils.cp_r(export_location, Setting['pulp_export_destination'], :remove_destination => true)
|
60
|
-
end
|
61
|
-
|
62
|
-
def humanized_name
|
63
|
-
_("Export")
|
64
|
-
end
|
65
|
-
|
66
|
-
def copy_units(repos)
|
67
|
-
concurrence do
|
68
|
-
repos.each do |repo|
|
69
|
-
sequence do
|
70
|
-
if repo.link?
|
71
|
-
plan_action(Pulp::Repository::Clear, repo, SmartProxy.pulp_primary!)
|
72
|
-
plan_action(Pulp::Repository::CopyAllUnits, repo, ::SmartProxy.pulp_primary, repo.target_repository)
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
def rescue_strategy
|
80
|
-
Dynflow::Action::Rescue::Skip
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module Actions
|
2
|
-
module Katello
|
3
|
-
module Repository
|
4
|
-
class PurgeEmptyContent < Pulp::AbstractAsyncTask
|
5
|
-
input_format do
|
6
|
-
param :id, Integer
|
7
|
-
end
|
8
|
-
|
9
|
-
def invoke_external_task
|
10
|
-
repo = ::Katello::Repository.find(input[:id])
|
11
|
-
repo.backend_service(SmartProxy.pulp_primary).purge_empty_contents
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
require 'English'
|
3
|
-
|
4
|
-
module Actions
|
5
|
-
module Katello
|
6
|
-
module Repository
|
7
|
-
class UploadErrata < Actions::EntryAction
|
8
|
-
def plan(repository, errata)
|
9
|
-
action_subject(repository)
|
10
|
-
sequence do
|
11
|
-
errata.each do |erratum|
|
12
|
-
sequence do
|
13
|
-
upload_request = plan_action(Pulp::Repository::CreateUploadRequest)
|
14
|
-
plan_action(Pulp::Repository::UploadFile,
|
15
|
-
upload_id: upload_request.output[:upload_id])
|
16
|
-
# this call is tightly coupled to Pulp's internal data
|
17
|
-
# structure; we are rehydrating an object from json.
|
18
|
-
plan_action(Pulp::Repository::ImportUpload,
|
19
|
-
pulp_id: repository.pulp_id,
|
20
|
-
unit_type_id: 'erratum',
|
21
|
-
unit_metadata: erratum["unit_metadata"],
|
22
|
-
unit_key: erratum["unit_key"],
|
23
|
-
upload_id: upload_request.output[:upload_id])
|
24
|
-
plan_action(Pulp::Repository::DeleteUploadRequest,
|
25
|
-
upload_id: upload_request.output[:upload_id])
|
26
|
-
end
|
27
|
-
end
|
28
|
-
plan_action(FinishUpload, repository)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def humanized_name
|
33
|
-
_("Upload errata into")
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,64 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# The Ruby URI parser doesn't decode the percent encoded characters in the URI, in particular it
|
3
|
-
# doesn't decode the password which is frequently used when specifying proxy addresses and
|
4
|
-
# authentication. For example, the following code:
|
5
|
-
#
|
6
|
-
# require 'uri'
|
7
|
-
# proxy = URI.parse('http://myuser:%24%3fxxxx@192.168.100.10:3128')
|
8
|
-
# puts proxy.password
|
9
|
-
#
|
10
|
-
# Produces the following output:
|
11
|
-
#
|
12
|
-
# %24%3fxxxx
|
13
|
-
#
|
14
|
-
# But some gems, in particular `rest-client` and `kubeclient`, expect it to decode those characters,
|
15
|
-
# as they use the value returned by the `password` method directly, and thus they fail to
|
16
|
-
# authenticate against the proxy server when the password contains percent encoded characters.
|
17
|
-
#
|
18
|
-
# To address this issue this file adds a new `proxy` URI schema that almost identical to the `http`
|
19
|
-
# schema, but that decodes the password before returning it. Users can use this schema instead of
|
20
|
-
# `http` when they need to use percent encoded characters in the password. For example, the user
|
21
|
-
# can type in the UI the following proxy URL:
|
22
|
-
#
|
23
|
-
# proxy://myuser:%24%3fxxxx@192.168.100.10:3128
|
24
|
-
#
|
25
|
-
# And the new schema will automatically translate `%24%3fxxxx` into `$?xxxx`.
|
26
|
-
# This fix is derived from: https://github.com/ManageIQ/manageiq/pull/17318
|
27
|
-
require 'cgi'
|
28
|
-
require 'uri'
|
29
|
-
|
30
|
-
module URI
|
31
|
-
class ProxyUri < HTTP
|
32
|
-
def password
|
33
|
-
value = super
|
34
|
-
value = CGI.unescape(value) if value
|
35
|
-
value
|
36
|
-
end
|
37
|
-
|
38
|
-
def user
|
39
|
-
value = super
|
40
|
-
value = CGI.unescape(value) if value
|
41
|
-
value
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
@@schemes['PROXY'] = ProxyUri
|
46
|
-
end
|
47
|
-
|
48
|
-
module URI
|
49
|
-
class ProxysUri < HTTP
|
50
|
-
def password
|
51
|
-
value = super
|
52
|
-
value = CGI.unescape(value) if value
|
53
|
-
value
|
54
|
-
end
|
55
|
-
|
56
|
-
def user
|
57
|
-
value = super
|
58
|
-
value = CGI.unescape(value) if value
|
59
|
-
value
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
@@schemes['PROXYS'] = ProxysUri
|
64
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
class RhsmFactImporter < ::StructuredFactImporter
|
3
|
-
def fact_name_class
|
4
|
-
Katello::RhsmFactName
|
5
|
-
end
|
6
|
-
|
7
|
-
def normalize(facts)
|
8
|
-
facts = change_separator(facts)
|
9
|
-
super(facts)
|
10
|
-
end
|
11
|
-
|
12
|
-
def change_separator(facts)
|
13
|
-
to_ret = {}
|
14
|
-
facts.each do |key, value|
|
15
|
-
to_ret[key.split('.').join(RhsmFactName::SEPARATOR)] = value
|
16
|
-
end
|
17
|
-
to_ret
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,120 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
class RhsmFactParser < ::FactParser
|
3
|
-
def architecture
|
4
|
-
name = facts['lscpu.architecture'] || facts['uname.machine']
|
5
|
-
name = "x86_64" if name == "amd64"
|
6
|
-
name = "i386" if name == "i686"
|
7
|
-
Architecture.where(:name => name).first_or_create unless name.blank?
|
8
|
-
end
|
9
|
-
|
10
|
-
def model
|
11
|
-
if facts['virt::is_guest'] == "true"
|
12
|
-
name = facts['lscpu.hypervisor_vendor']
|
13
|
-
else
|
14
|
-
name = facts['dmi.system.product_name']
|
15
|
-
end
|
16
|
-
::Model.where(:name => name.strip).first_or_create unless name.blank?
|
17
|
-
end
|
18
|
-
|
19
|
-
def support_interfaces_parsing?
|
20
|
-
true
|
21
|
-
end
|
22
|
-
|
23
|
-
def get_facts_for_interface(interface)
|
24
|
-
{
|
25
|
-
'link' => true,
|
26
|
-
'macaddress' => get_rhsm_mac(interface),
|
27
|
-
'ipaddress' => get_rhsm_ip(interface)
|
28
|
-
}
|
29
|
-
end
|
30
|
-
|
31
|
-
def interfaces
|
32
|
-
virtual_interface_regexp = /\A([^.]*?)\.(\d+)\z/
|
33
|
-
super.tap do |interfaces|
|
34
|
-
interfaces.each do |name, attributes|
|
35
|
-
attributes[:virtual] = true if name =~ virtual_interface_regexp
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
# rubocop:disable Naming/AccessorMethodName:
|
41
|
-
def get_interfaces
|
42
|
-
mac_keys = facts.keys.select { |f| f =~ /net\.interface\..*\.mac_address/ }
|
43
|
-
names = mac_keys.map do |key|
|
44
|
-
key.sub('net.interface.', '').sub('.mac_address', '') if facts[key] != 'none'
|
45
|
-
end
|
46
|
-
names.compact
|
47
|
-
end
|
48
|
-
|
49
|
-
def operatingsystem
|
50
|
-
name = facts['distribution.name']
|
51
|
-
version = facts['distribution.version']
|
52
|
-
return nil if name.nil? || version.nil?
|
53
|
-
|
54
|
-
os_name = ::Katello::Candlepin::Consumer.distribution_to_puppet_os(name)
|
55
|
-
major, minor = version.split('.')
|
56
|
-
unless facts['ignore_os']
|
57
|
-
os_attributes = {:major => major, :minor => minor || '', :name => os_name}
|
58
|
-
|
59
|
-
release_name = os_release_name(os_name)
|
60
|
-
if release_name
|
61
|
-
os_attributes[:release_name] = release_name
|
62
|
-
end
|
63
|
-
|
64
|
-
if facts['distribution.name'] == 'Red Hat Enterprise Linux Workstation'
|
65
|
-
os_attributes[:name] = os_name + '_Workstation'
|
66
|
-
end
|
67
|
-
|
68
|
-
::Operatingsystem.find_by(os_attributes) || ::Operatingsystem.create!(os_attributes)
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
def os_release_name(os_name)
|
73
|
-
if os_name&.match(::Operatingsystem::FAMILIES['Debian'])
|
74
|
-
facts['distribution.id']&.split&.first&.downcase
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
#required to be defined, even if they return nil
|
79
|
-
def domain
|
80
|
-
end
|
81
|
-
|
82
|
-
def environment
|
83
|
-
end
|
84
|
-
|
85
|
-
def ipmi_interface
|
86
|
-
end
|
87
|
-
|
88
|
-
def boot_timestamp
|
89
|
-
facts['proc_stat.btime']&.to_i
|
90
|
-
end
|
91
|
-
|
92
|
-
def virtual
|
93
|
-
facts['virt.is_guest']
|
94
|
-
end
|
95
|
-
|
96
|
-
def ram
|
97
|
-
facts['memory.memtotal'].to_i / 1024 if facts['memory.memtotal']
|
98
|
-
end
|
99
|
-
|
100
|
-
def sockets
|
101
|
-
facts['cpu.cpu_socket(s)']
|
102
|
-
end
|
103
|
-
|
104
|
-
def cores
|
105
|
-
facts['cpu.core(s)_per_socket']
|
106
|
-
end
|
107
|
-
|
108
|
-
private
|
109
|
-
|
110
|
-
def get_rhsm_ip(interface)
|
111
|
-
ip = facts["net.interface.#{interface}.ipv4_address"]
|
112
|
-
Net::Validations.validate_ip(ip) ? ip : nil
|
113
|
-
end
|
114
|
-
|
115
|
-
def get_rhsm_mac(interface)
|
116
|
-
# if secondary then permanent_mac_address contains the physical mac
|
117
|
-
facts["net.interface.#{interface}.permanent_mac_address"] || facts["net.interface.#{interface}.mac_address"]
|
118
|
-
end
|
119
|
-
end
|
120
|
-
end
|