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
@@ -107,13 +107,13 @@ end
|
|
107
107
|
|
108
108
|
module Katello
|
109
109
|
class PulpSyncStatus < PulpTaskStatus
|
110
|
-
HISTORY_ERROR = 'failed'
|
111
|
-
HISTORY_SUCCESS = 'success'
|
112
|
-
FINISHED = "finished"
|
113
|
-
ERROR = "error"
|
114
|
-
RUNNING = "running"
|
115
|
-
WAITING = "waiting"
|
116
|
-
CANCELED = "canceled"
|
110
|
+
HISTORY_ERROR = 'failed'.freeze
|
111
|
+
HISTORY_SUCCESS = 'success'.freeze
|
112
|
+
FINISHED = "finished".freeze
|
113
|
+
ERROR = "error".freeze
|
114
|
+
RUNNING = "running".freeze
|
115
|
+
WAITING = "waiting".freeze
|
116
|
+
CANCELED = "canceled".freeze
|
117
117
|
|
118
118
|
class Status < TaskStatus::Status
|
119
119
|
NOT_SYNCED = :not_synced
|
@@ -17,13 +17,13 @@ module Katello
|
|
17
17
|
include Ext::LabelFromName
|
18
18
|
include Katello::Engine.routes.url_helpers
|
19
19
|
|
20
|
-
YUM_TYPE = 'yum'
|
21
|
-
FILE_TYPE = 'file'
|
22
|
-
PUPPET_TYPE = 'puppet'
|
23
|
-
DOCKER_TYPE = 'docker'
|
24
|
-
OSTREE_TYPE = 'ostree'
|
20
|
+
YUM_TYPE = 'yum'.freeze
|
21
|
+
FILE_TYPE = 'file'.freeze
|
22
|
+
PUPPET_TYPE = 'puppet'.freeze
|
23
|
+
DOCKER_TYPE = 'docker'.freeze
|
24
|
+
OSTREE_TYPE = 'ostree'.freeze
|
25
25
|
|
26
|
-
CHECKSUM_TYPES = %w(sha1 sha256)
|
26
|
+
CHECKSUM_TYPES = %w(sha1 sha256).freeze
|
27
27
|
|
28
28
|
belongs_to :environment, :inverse_of => :repositories, :class_name => "Katello::KTEnvironment"
|
29
29
|
belongs_to :product, :inverse_of => :repositories
|
@@ -27,15 +27,6 @@ module Katello
|
|
27
27
|
}
|
28
28
|
end
|
29
29
|
|
30
|
-
def interfaces
|
31
|
-
virtual_interface_regexp = /\A([^.]*?)\.(\d+)\z/
|
32
|
-
super.tap do |interfaces|
|
33
|
-
interfaces.each do |name, attributes|
|
34
|
-
attributes[:virtual] = true if name =~ virtual_interface_regexp
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
30
|
# rubocop:disable Style/AccessorMethodName:
|
40
31
|
def get_interfaces
|
41
32
|
mac_keys = facts.keys.select { |f| f =~ /net\.interface\..*\.mac_address/ }
|
@@ -8,11 +8,11 @@ module Katello
|
|
8
8
|
include Katello::Authorization::SyncPlan
|
9
9
|
include ForemanTasks::Concerns::ActionSubject
|
10
10
|
|
11
|
-
HOURLY = 'hourly'
|
12
|
-
DAILY = 'daily'
|
13
|
-
WEEKLY = 'weekly'
|
14
|
-
TYPES = [HOURLY, DAILY, WEEKLY]
|
15
|
-
DURATION = {HOURLY => 'T1H', DAILY => 'T24H', WEEKLY => '7D' }
|
11
|
+
HOURLY = 'hourly'.freeze
|
12
|
+
DAILY = 'daily'.freeze
|
13
|
+
WEEKLY = 'weekly'.freeze
|
14
|
+
TYPES = [HOURLY, DAILY, WEEKLY].freeze
|
15
|
+
DURATION = {HOURLY => 'T1H', DAILY => 'T24H', WEEKLY => '7D' }.freeze
|
16
16
|
WEEK_DAYS = (%w(Sunday Monday Tuesday Wednesday Thursday Friday)).collect { |d| N_(d) }
|
17
17
|
|
18
18
|
belongs_to :organization, :inverse_of => :sync_plans
|
@@ -34,28 +34,20 @@ module Katello
|
|
34
34
|
errors.add :base, _("Start Date and Time can't be blank") if self.sync_date.nil?
|
35
35
|
end
|
36
36
|
|
37
|
-
def zone_converted
|
38
|
-
#convert time to local timezone
|
39
|
-
self.sync_date.localtime.to_datetime
|
40
|
-
end
|
41
|
-
|
42
37
|
def plan_day
|
43
38
|
WEEK_DAYS[self.sync_date.strftime('%A').to_i]
|
44
39
|
end
|
45
40
|
|
46
|
-
def plan_date
|
47
|
-
|
48
|
-
date_obj.strftime('%m/%d/%Y')
|
41
|
+
def plan_date
|
42
|
+
self.sync_date.strftime('%m/%d/%Y')
|
49
43
|
end
|
50
44
|
|
51
|
-
def plan_time
|
52
|
-
|
53
|
-
date_obj.strftime('%I:%M %p')
|
45
|
+
def plan_time
|
46
|
+
self.sync_date.strftime('%I:%M %p')
|
54
47
|
end
|
55
48
|
|
56
|
-
def plan_date_time
|
57
|
-
|
58
|
-
date_obj.strftime('%m/%d/%Y %I:%M:%p')
|
49
|
+
def plan_date_time
|
50
|
+
self.sync_date.strftime('%Y/%m/%d %H:%M:%S %Z')
|
59
51
|
end
|
60
52
|
|
61
53
|
def schedule_format
|
@@ -77,8 +69,7 @@ module Katello
|
|
77
69
|
|
78
70
|
def next_sync
|
79
71
|
return nil unless self.enabled
|
80
|
-
|
81
|
-
now = Time.now.utc
|
72
|
+
now = Time.current
|
82
73
|
next_sync = self.sync_date
|
83
74
|
|
84
75
|
if self.sync_date < now
|
@@ -107,6 +98,8 @@ module Katello
|
|
107
98
|
:sec => self.sync_date.sec).advance(:days => days)
|
108
99
|
end
|
109
100
|
end
|
101
|
+
|
102
|
+
next_sync = next_sync.strftime('%Y/%m/%d %H:%M:%S %Z') if next_sync
|
110
103
|
next_sync
|
111
104
|
end
|
112
105
|
|
@@ -28,12 +28,6 @@ module Katello
|
|
28
28
|
|
29
29
|
belongs_to :content_view, :inverse_of => :systems
|
30
30
|
|
31
|
-
has_one :capsule,
|
32
|
-
:class_name => "::SmartProxy",
|
33
|
-
:inverse_of => :content_host,
|
34
|
-
:foreign_key => :content_host_id,
|
35
|
-
:dependent => :nullify
|
36
|
-
|
37
31
|
validates_lengths_from_database
|
38
32
|
before_validation :set_default_content_view, :unless => :persisted?
|
39
33
|
validates :environment, :presence => true
|
@@ -228,8 +222,6 @@ module Katello
|
|
228
222
|
self.products.flat_map(&:available_content)
|
229
223
|
end
|
230
224
|
|
231
|
-
private
|
232
|
-
|
233
225
|
def self.search_host_collections(_key, operator, value)
|
234
226
|
conditions = sanitize_sql_for_conditions(["#{Katello::HostCollection.table_name}.name #{operator} '#{value}'"])
|
235
227
|
systems_matching_query = Katello::System.joins("INNER JOIN #{Katello::HostCollectionHosts.table_name} ON \
|
@@ -261,6 +253,12 @@ module Katello
|
|
261
253
|
casted
|
262
254
|
end
|
263
255
|
|
256
|
+
def self.humanize_class_name(_name = nil)
|
257
|
+
_('Content Host')
|
258
|
+
end
|
259
|
+
|
260
|
+
private
|
261
|
+
|
264
262
|
def refresh_running_tasks
|
265
263
|
ids = self.task_statuses.where(:state => [:waiting, :running]).pluck(:id)
|
266
264
|
TaskStatus.refresh(ids)
|
@@ -281,9 +279,5 @@ module Katello
|
|
281
279
|
def collect_installed_product_names
|
282
280
|
self.installedProducts ? self.installedProducts.map { |p| p[:productName] } : []
|
283
281
|
end
|
284
|
-
|
285
|
-
def self.humanize_class_name(_name = nil)
|
286
|
-
_('Content Host')
|
287
|
-
end
|
288
282
|
end
|
289
283
|
end
|
@@ -26,11 +26,6 @@ module Katello
|
|
26
26
|
# needed to delete providers w/ task status
|
27
27
|
has_one :provider, :class_name => "Katello::Provider", :dependent => :nullify
|
28
28
|
|
29
|
-
# a task may be optionally associated with a job, but it is not required
|
30
|
-
# an example scenario would be a job that is created by performing an action on a system group
|
31
|
-
has_one :job_task, :class_name => "Katello::JobTask", :dependent => :destroy
|
32
|
-
has_one :job, :through => :job_task
|
33
|
-
|
34
29
|
validates_lengths_from_database
|
35
30
|
before_save :setup_task_type
|
36
31
|
|
@@ -60,8 +55,6 @@ module Katello
|
|
60
55
|
end
|
61
56
|
end
|
62
57
|
|
63
|
-
after_destroy :destroy_job
|
64
|
-
|
65
58
|
def initialize(attrs = nil, _options = {})
|
66
59
|
unless attrs.nil?
|
67
60
|
# only keep keys for which we have db columns
|
@@ -160,21 +153,21 @@ module Katello
|
|
160
153
|
if p.length == 1
|
161
154
|
return p.first
|
162
155
|
else
|
163
|
-
return
|
156
|
+
return _("%{package} (%{total} other packages)") % {:package => p.first, :total => p.length - 1}
|
164
157
|
end
|
165
158
|
when :package_group
|
166
159
|
p = self.parameters[:groups]
|
167
160
|
if p.length == 1
|
168
161
|
return p.first
|
169
162
|
else
|
170
|
-
return
|
163
|
+
return _("%{group} (%{total} other package groups)") % {:group => p.first, :total => p.length - 1}
|
171
164
|
end
|
172
165
|
when :errata
|
173
166
|
p = self.parameters[:errata_ids]
|
174
167
|
if p.length == 1
|
175
168
|
return p.first
|
176
169
|
else
|
177
|
-
return
|
170
|
+
return _("%{errata} (%{total} other errata)") % {:errata => p.first, :total => p.length - 1}
|
178
171
|
end
|
179
172
|
end
|
180
173
|
end
|
@@ -336,20 +329,6 @@ module Katello
|
|
336
329
|
end
|
337
330
|
end
|
338
331
|
|
339
|
-
# If the task is associated with a job and this is the last task associated with
|
340
|
-
# the job, destroy the job.
|
341
|
-
def destroy_job
|
342
|
-
# is this task associated with a job?
|
343
|
-
job_id = self.job_task.job_id unless self.job_task.nil?
|
344
|
-
if job_id
|
345
|
-
job = Job.find(job_id)
|
346
|
-
# is this the last task associated with the job?
|
347
|
-
if job && job.task_statuses.length == 0
|
348
|
-
job.destroy
|
349
|
-
end
|
350
|
-
end
|
351
|
-
end
|
352
|
-
|
353
332
|
def packages_change_description(data, action)
|
354
333
|
ret = []
|
355
334
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class Setting::
|
1
|
+
class Setting::Content < Setting
|
2
2
|
def self.load_defaults
|
3
3
|
return unless super
|
4
4
|
|
@@ -27,8 +27,16 @@ class Setting::Katello < Setting
|
|
27
27
|
self.set('pulp_client_cert', N_("Path for ssl cert used for pulp server auth"), "/etc/pki/katello/certs/pulp-client.crt"),
|
28
28
|
self.set('remote_execution_by_default', N_("If set to true, use the remote execution over katello-agent for remote actions"), false),
|
29
29
|
self.set('use_pulp_oauth', N_("use oauth authentication for pulp instead of the default cert based authentication"), false)
|
30
|
-
].each { |s| self.create! s.update(:category => "Setting::
|
30
|
+
].each { |s| self.create! s.update(:category => "Setting::Content") }
|
31
31
|
end
|
32
32
|
true
|
33
33
|
end
|
34
34
|
end
|
35
|
+
|
36
|
+
# If the database is not migrated yet, the system will not be able to load
|
37
|
+
# since setting initializers will try to load old class. Let it have the class and remove it
|
38
|
+
# later.
|
39
|
+
if Setting.where(category: 'Setting::Katello').count > 0
|
40
|
+
class Setting::Katello < Setting
|
41
|
+
end
|
42
|
+
end
|
@@ -3,18 +3,18 @@ Deface::Override.new(:virtual_path => "about/index",
|
|
3
3
|
:name => "add_system_status_to_about",
|
4
4
|
:insert_bottom => '#about',
|
5
5
|
:partial => 'overrides/about/system_status'
|
6
|
-
|
6
|
+
)
|
7
7
|
|
8
8
|
# Add Installed Packages to About page
|
9
9
|
Deface::Override.new(:virtual_path => "about/index",
|
10
10
|
:name => "add_installed_packages_to_about",
|
11
11
|
:insert_bottom => '#about',
|
12
12
|
:partial => 'overrides/about/installed_packages'
|
13
|
-
|
13
|
+
)
|
14
14
|
|
15
15
|
# Add Katello Support information to About page
|
16
16
|
Deface::Override.new(:virtual_path => "about/index",
|
17
17
|
:name => "add_support_documentation",
|
18
18
|
:insert_bottom => '.col-md-5 .stats-well:first-child',
|
19
19
|
:partial => 'overrides/about/support_documentation'
|
20
|
-
|
20
|
+
)
|
@@ -3,13 +3,13 @@ Deface::Override.new(:virtual_path => "taxonomies/_step1",
|
|
3
3
|
:name => "remove_parent_organization_on_create",
|
4
4
|
:surround => 'erb[loud]:contains("select_f"):contains(":parent")',
|
5
5
|
:text => '<% if taxonomy.is_a?(Location) %><%= render_original %><% end %>'
|
6
|
-
|
6
|
+
)
|
7
7
|
|
8
8
|
Deface::Override.new(:virtual_path => "taxonomies/_form",
|
9
9
|
:name => "remove_parent_organization_on_edit",
|
10
10
|
:surround => 'erb[loud]:contains("select_f"):contains(":parent")',
|
11
11
|
:text => '<% if taxonomy.is_a?(Location) %><%= render_original %><% end %>'
|
12
|
-
|
12
|
+
)
|
13
13
|
|
14
14
|
# Add organization attributes to org creation
|
15
15
|
Deface::Override.new(:virtual_path => "taxonomies/_step1",
|
@@ -3,14 +3,14 @@ module Katello
|
|
3
3
|
class Consumer
|
4
4
|
include LazyAccessor
|
5
5
|
|
6
|
-
ENTITLEMENTS_VALID = 'valid'
|
7
|
-
ENTITLEMENTS_PARTIAL = 'partial'
|
8
|
-
ENTITLEMENTS_INVALID = 'invalid'
|
9
|
-
|
10
|
-
SYSTEM = "system"
|
11
|
-
HYPERVISOR = "hypervisor"
|
12
|
-
CANDLEPIN = "candlepin"
|
13
|
-
CP_TYPES = [SYSTEM, HYPERVISOR, CANDLEPIN]
|
6
|
+
ENTITLEMENTS_VALID = 'valid'.freeze
|
7
|
+
ENTITLEMENTS_PARTIAL = 'partial'.freeze
|
8
|
+
ENTITLEMENTS_INVALID = 'invalid'.freeze
|
9
|
+
|
10
|
+
SYSTEM = "system".freeze
|
11
|
+
HYPERVISOR = "hypervisor".freeze
|
12
|
+
CANDLEPIN = "candlepin".freeze
|
13
|
+
CP_TYPES = [SYSTEM, HYPERVISOR, CANDLEPIN].freeze
|
14
14
|
|
15
15
|
lazy_accessor :entitlements, :initializer => lambda { |_s| Resources::Candlepin::Consumer.entitlements(uuid) }
|
16
16
|
lazy_accessor :events, :initializer => lambda { |_s| Resources::Candlepin::Consumer.events(uuid) }
|
@@ -54,7 +54,7 @@ module Katello
|
|
54
54
|
def unbind_repo_ids(repo_ids, distributor_type)
|
55
55
|
repo_ids.each do |repo_id|
|
56
56
|
begin
|
57
|
-
Katello.pulp_server.extensions.consumer.unbind_all(uuid,
|
57
|
+
Katello.pulp_server.extensions.consumer.unbind_all(uuid, repo_id, distributor_type)
|
58
58
|
rescue => e
|
59
59
|
Rails.logger.error "Failed to unbind repo #{repo_id}: #{e}, #{e.backtrace.join("\n")}"
|
60
60
|
end
|
@@ -42,11 +42,11 @@ module Katello
|
|
42
42
|
raise e
|
43
43
|
end
|
44
44
|
|
45
|
-
def update_package(packages)
|
45
|
+
def update_package(packages, options = {})
|
46
46
|
Rails.logger.debug "Scheduling package update for consumer group #{self.pulp_id}"
|
47
47
|
|
48
|
-
options
|
49
|
-
options[:all] = true if
|
48
|
+
options.merge!(:importkeys => true)
|
49
|
+
options[:all] = true if options[:update_all]
|
50
50
|
Katello.pulp_server.extensions.consumer_group.update_content(self.pulp_id,
|
51
51
|
'rpm',
|
52
52
|
packages,
|
@@ -3,9 +3,9 @@ module Katello
|
|
3
3
|
class Rpm < PulpContentUnit
|
4
4
|
include LazyAccessor
|
5
5
|
|
6
|
-
PULP_SELECT_FIELDS = %w(name epoch version release arch checksumtype checksum)
|
7
|
-
PULP_INDEXED_FIELDS = %w(name version release arch epoch summary sourcerpm checksum filename _id)
|
8
|
-
CONTENT_TYPE = "rpm"
|
6
|
+
PULP_SELECT_FIELDS = %w(name epoch version release arch checksumtype checksum).freeze
|
7
|
+
PULP_INDEXED_FIELDS = %w(name version release arch epoch summary sourcerpm checksum filename _id).freeze
|
8
|
+
CONTENT_TYPE = "rpm".freeze
|
9
9
|
|
10
10
|
lazy_accessor :pulp_facts, :initializer => :backend_data
|
11
11
|
|