katello 3.2.0.rc1.1 → 3.2.0.rc2
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/hosts/host_and_hostgroup_edit.js +1 -1
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +5 -0
- data/app/controllers/katello/api/v2/organizations_controller.rb +1 -1
- data/app/controllers/katello/api/v2/repositories_controller.rb +1 -1
- data/app/controllers/katello/concerns/api/v2/hostgroups_controller_extensions.rb +1 -1
- data/app/controllers/katello/products_controller.rb +1 -1
- data/app/lib/actions/katello/capsule_content/create_repos.rb +1 -1
- data/app/lib/actions/katello/capsule_content/sync.rb +3 -22
- data/app/lib/actions/katello/repository/clone_to_environment.rb +6 -0
- data/app/lib/actions/katello/repository/create.rb +3 -1
- data/app/lib/actions/katello/repository/destroy.rb +0 -2
- data/app/lib/actions/katello/repository/sync.rb +0 -1
- data/app/models/katello/activation_key.rb +2 -1
- data/app/models/katello/concerns/content_facet_host_extensions.rb +6 -4
- data/app/models/katello/concerns/host_managed_extensions.rb +3 -3
- data/app/models/katello/concerns/redhat_extensions.rb +3 -1
- data/app/models/katello/concerns/subscription_facet_host_extensions.rb +3 -3
- data/app/models/katello/glue/pulp/repo.rb +17 -0
- data/app/models/katello/ping.rb +13 -4
- data/app/models/katello/product.rb +9 -1
- data/app/models/katello/repository.rb +7 -0
- data/app/models/katello/subscription.rb +5 -0
- data/app/views/dashboard/_content_views_widget.html.erb +3 -3
- data/app/views/dashboard/_errata_widget.html.erb +2 -2
- data/app/views/dashboard/_host_collection_widget.html.erb +3 -3
- data/app/views/dashboard/_subscription_status_widget.html.erb +32 -27
- data/app/views/dashboard/_subscription_widget.html.erb +57 -54
- data/app/views/dashboard/_sync_widget.html.erb +3 -3
- data/app/views/foreman/unattended/finish-katello.erb +7 -19
- data/app/views/foreman/unattended/kickstart-katello.erb +7 -20
- data/app/views/foreman/unattended/userdata-katello.erb +14 -21
- data/app/views/overrides/activation_keys/_host_environment_select.html.erb +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-errata.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-docker-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-file-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-ostree-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/details/repository-details-info.controller.js +3 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-products.controller.js +3 -1
- data/lib/katello/engine.rb +0 -1
- data/lib/katello/version.rb +1 -1
- metadata +3 -7
- data/app/lib/actions/katello/repository/destroy_medium.rb +0 -12
- data/app/lib/actions/katello/repository/update_media.rb +0 -17
- data/app/models/katello/concerns/medium_extensions.rb +0 -79
- data/db/seeds.d/109-atomic_os.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1746a52c274c0de6f5d7d9bfe445688ac837f11e
|
4
|
+
data.tar.gz: 99ca72367e3c93ec650f2269d7438fc050aec55c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dd2a6dcf3602edad6b41282a2d2e5238648f718124cfc04aa8d0ca2c7258d7142c35173e85f4e048656ef7db0ce763705eb4d189f0b2b0d9dda5b12601db98e
|
7
|
+
data.tar.gz: b64938cda76dc55a07e01453d4c99139e79e4e33479298656efb8269fed805d76b8e07bc8e8270a89536728323e7f354f1ec2ee5ca61a220ccc6726930634b77
|
@@ -257,7 +257,7 @@ function os_selected(element){
|
|
257
257
|
'lifecycle_environment_id', 'content_source_id', 'architecture_id', 'hostgroup_id',
|
258
258
|
'medium_id', 'kickstart_repository_id']);
|
259
259
|
var url = $(element).attr('data-url');
|
260
|
-
|
260
|
+
tfm.tools.showSpinner();
|
261
261
|
$.ajax({
|
262
262
|
data: attrs,
|
263
263
|
type:'post',
|
@@ -12,6 +12,11 @@ module Katello
|
|
12
12
|
|
13
13
|
before_action :validate_content_action, :only => [:install_content, :update_content, :remove_content]
|
14
14
|
|
15
|
+
resource_description do
|
16
|
+
api_version 'v2'
|
17
|
+
api_base_url "/api"
|
18
|
+
end
|
19
|
+
|
15
20
|
PARAM_ACTIONS = {
|
16
21
|
:install_content => {
|
17
22
|
:package => :install_packages,
|
@@ -22,7 +22,7 @@ module Katello
|
|
22
22
|
param :user_ids, Array, N_("User IDs"), :required => false
|
23
23
|
param :smart_proxy_ids, Array, N_("Smart proxy IDs"), :required => false
|
24
24
|
param :compute_resource_ids, Array, N_("Compute resource IDs"), :required => false
|
25
|
-
param :
|
25
|
+
param :medium_ids, Array, N_("Medium IDs"), :required => false
|
26
26
|
param :config_template_ids, Array, N_("Provisioning template IDs"), :required => false # FIXME: deprecated
|
27
27
|
param :ptable_ids, Array, N_("Partition template IDs"), :required => false
|
28
28
|
param :provisioning_template_ids, Array, N_("Provisioning template IDs"), :required => false
|
@@ -287,7 +287,7 @@ module Katello
|
|
287
287
|
|
288
288
|
if !filepaths.blank?
|
289
289
|
sync_task(::Actions::Katello::Repository::UploadFiles, @repository, filepaths)
|
290
|
-
render :json => {:status => "success"}
|
290
|
+
render :json => {:status => "success", :filenames => filepaths.map { |item| item[:filename] }}
|
291
291
|
else
|
292
292
|
fail HttpErrors::BadRequest, _("No file uploaded")
|
293
293
|
end
|
@@ -39,7 +39,7 @@ module Katello
|
|
39
39
|
param :id, :identifier, :required => true
|
40
40
|
param_group :hostgroup
|
41
41
|
def update
|
42
|
-
process_response @hostgroup.update_attributes(
|
42
|
+
process_response @hostgroup.update_attributes(hostgroup_params)
|
43
43
|
end
|
44
44
|
|
45
45
|
api :GET, "/hostgroups/:id", N_("Show a host group")
|
@@ -72,7 +72,7 @@ module Katello
|
|
72
72
|
repos.select do |repo|
|
73
73
|
if repo[:path].include?('kickstart')
|
74
74
|
variants = ['Server', 'Client', 'ComputeNode', 'Workstation']
|
75
|
-
has_variant = variants.any? { |v| repo[:substitutions][:releasever].include
|
75
|
+
has_variant = variants.any? { |v| repo[:substitutions][:releasever].try(:include?, v) }
|
76
76
|
has_variant ? repo[:enabled] : true
|
77
77
|
else
|
78
78
|
true
|
@@ -24,7 +24,7 @@ module Actions
|
|
24
24
|
content_type: repository.content_type,
|
25
25
|
pulp_id: repository.pulp_id,
|
26
26
|
name: repository.name,
|
27
|
-
feed: repository.docker? ? repository.docker_feed_url(true) : repository.full_path,
|
27
|
+
feed: repository.docker? ? repository.docker_feed_url(true) : repository.full_path(nil, true),
|
28
28
|
ssl_ca_cert: ::Cert::Certs.ca_cert,
|
29
29
|
ssl_client_cert: ueber_cert[:cert],
|
30
30
|
ssl_client_key: ueber_cert[:key],
|
@@ -74,29 +74,10 @@ module Actions
|
|
74
74
|
end
|
75
75
|
|
76
76
|
def repos_needing_updates(capsule_content, environment, content_view)
|
77
|
-
need_importer_update = repos_needing_importer_updates(capsule_content, environment, content_view)
|
78
|
-
need_distributor_update = repos_needing_distributor_updates(capsule_content, environment, content_view)
|
79
|
-
(need_distributor_update + need_importer_update).uniq
|
80
|
-
end
|
81
|
-
|
82
|
-
def repos_needing_distributor_updates(capsule_content, environment, content_view)
|
83
77
|
repos = capsule_content.repos_available_to_capsule(environment, content_view)
|
84
|
-
repos
|
85
|
-
|
86
|
-
|
87
|
-
capsule_distributors = repo_details["distributors"]
|
88
|
-
!repo.distributors_match?(capsule_distributors, capsule_content.capsule)
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
def repos_needing_importer_updates(capsule, environment, content_view)
|
93
|
-
repos = capsule.repos_available_to_capsule(environment, content_view)
|
94
|
-
repos.select do |repo|
|
95
|
-
repo_details = capsule.pulp_repo_facts(repo.pulp_id)
|
96
|
-
next unless repo_details
|
97
|
-
capsule_importer = repo_details["importers"][0]
|
98
|
-
!repo.importer_matches?(capsule_importer)
|
99
|
-
end
|
78
|
+
need_importer_update = ::Katello::Repository.needs_importer_updates(repos, capsule_content)
|
79
|
+
need_distributor_update = ::Katello::Repository.needs_distributor_updates(repos, capsule_content)
|
80
|
+
(need_distributor_update + need_importer_update).uniq
|
100
81
|
end
|
101
82
|
|
102
83
|
def rescue_strategy
|
@@ -12,6 +12,12 @@ module Actions
|
|
12
12
|
plan_action(Repository::Create, clone, true, false)
|
13
13
|
else
|
14
14
|
plan_action(Repository::Clear, clone)
|
15
|
+
clone.copy_library_instance_attributes
|
16
|
+
clone.save!
|
17
|
+
|
18
|
+
if ::Katello::Repository.needs_distributor_updates([clone]).first
|
19
|
+
plan_action(Pulp::Repository::Refresh, clone)
|
20
|
+
end
|
15
21
|
end
|
16
22
|
|
17
23
|
if repository.yum?
|
@@ -46,7 +46,9 @@ module Actions
|
|
46
46
|
end
|
47
47
|
|
48
48
|
concurrence do
|
49
|
-
|
49
|
+
if !clone && repository.product.sync_plan
|
50
|
+
plan_action(::Actions::Pulp::Repos::Update, repository.product)
|
51
|
+
end
|
50
52
|
plan_self(:repository_id => repository.id, :clone => clone)
|
51
53
|
end
|
52
54
|
end
|
@@ -37,7 +37,6 @@ module Actions
|
|
37
37
|
plan_action(Katello::Foreman::ContentUpdate, repo.environment, repo.content_view, repo)
|
38
38
|
plan_action(Katello::Repository::CorrectChecksum, repo)
|
39
39
|
concurrence do
|
40
|
-
plan_action(Katello::Repository::UpdateMedia, :repo_id => repo.id, :contents_changed => contents_changed)
|
41
40
|
plan_action(Katello::Repository::ErrataMail, repo, nil, contents_changed)
|
42
41
|
plan_self(:id => repo.id, :sync_result => output, :user_id => ::User.current.id, :contents_changed => contents_changed)
|
43
42
|
plan_action(Pulp::Repository::RegenerateApplicability, :pulp_id => repo.pulp_id, :contents_changed => contents_changed)
|
@@ -87,7 +87,8 @@ module Katello
|
|
87
87
|
all_pools = self.get_pools.map { |pool| pool["id"] }
|
88
88
|
added_pools = self.get_key_pools.map { |pool| pool["id"] }
|
89
89
|
available_pools = all_pools - added_pools
|
90
|
-
Pool.where(:cp_id => available_pools
|
90
|
+
Pool.where(:cp_id => available_pools,
|
91
|
+
:subscription_id => Subscription.with_subscribable_content)
|
91
92
|
end
|
92
93
|
|
93
94
|
def products
|
@@ -23,11 +23,13 @@ module Katello
|
|
23
23
|
has_many :applicable_errata, :through => :content_facet
|
24
24
|
|
25
25
|
scoped_search :in => :content_view, :on => :name, :complete_value => true, :rename => :content_view
|
26
|
-
scoped_search :in => :content_facet, :on => :content_view_id, :rename => :content_view_id
|
26
|
+
scoped_search :in => :content_facet, :on => :content_view_id, :rename => :content_view_id, :only_explicit => true
|
27
27
|
scoped_search :in => :lifecycle_environment, :on => :name, :complete_value => true, :rename => :lifecycle_environment
|
28
|
-
scoped_search :in => :content_facet, :on => :lifecycle_environment_id, :rename => :lifecycle_environment_id
|
29
|
-
scoped_search :in => :applicable_errata, :on => :errata_id, :rename => :applicable_errata, :complete_value => true, :ext_method => :find_by_applicable_errata
|
30
|
-
scoped_search :in => :applicable_errata, :on => :errata_id, :rename => :installable_errata, :complete_value => true, :ext_method => :find_by_installable_errata
|
28
|
+
scoped_search :in => :content_facet, :on => :lifecycle_environment_id, :rename => :lifecycle_environment_id, :only_explicit => true
|
29
|
+
scoped_search :in => :applicable_errata, :on => :errata_id, :rename => :applicable_errata, :complete_value => true, :ext_method => :find_by_applicable_errata, :only_explicit => true
|
30
|
+
scoped_search :in => :applicable_errata, :on => :errata_id, :rename => :installable_errata, :complete_value => true, :ext_method => :find_by_installable_errata, :only_explicit => true
|
31
|
+
scoped_search :in => :applicable_rpms, :on => :nvra, :rename => :applicable_rpms, :complete_value => true, :ext_method => :find_by_applicable_rpms, :only_explicit => true
|
32
|
+
scoped_search :in => :applicable_rpms, :on => :nvra, :rename => :upgradable_rpms, :complete_value => true, :ext_method => :find_by_installable_rpms, :only_explicit => true
|
31
33
|
|
32
34
|
accepts_nested_attributes_for :content_facet, :reject_if => proc { |attributes| attributes['content_view_id'].blank? && attributes['lifecycle_environment_id'].blank? }
|
33
35
|
end
|
@@ -21,10 +21,10 @@ module Katello
|
|
21
21
|
before_save :correct_puppet_environment
|
22
22
|
|
23
23
|
scoped_search :in => :content_source, :on => :name, :complete_value => true, :rename => :content_source
|
24
|
-
scoped_search :in => :host_collections, :on => :id, :complete_value => false, :rename => :host_collection_id
|
24
|
+
scoped_search :in => :host_collections, :on => :id, :complete_value => false, :rename => :host_collection_id, :only_explicit => true
|
25
25
|
scoped_search :in => :host_collections, :on => :name, :complete_value => true, :rename => :host_collection
|
26
|
-
scoped_search :in => :installed_packages, :on => :nvra, :complete_value => true, :rename => :installed_package
|
27
|
-
scoped_search :in => :installed_packages, :on => :name, :complete_value => true, :rename => :installed_package_name
|
26
|
+
scoped_search :in => :installed_packages, :on => :nvra, :complete_value => true, :rename => :installed_package, :only_explicit => true
|
27
|
+
scoped_search :in => :installed_packages, :on => :name, :complete_value => true, :rename => :installed_package_name, :only_explicit => true
|
28
28
|
end
|
29
29
|
|
30
30
|
def validate_media_with_capsule?
|
@@ -35,7 +35,9 @@ module Katello
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def construct_name(family)
|
38
|
-
if family
|
38
|
+
if family == ::Operatingsystem::REDHAT_ATOMIC_HOST_DISTRO_NAME
|
39
|
+
return ::Operatingsystem::REDHAT_ATOMIC_HOST_OS
|
40
|
+
elsif family.include? 'Red Hat'
|
39
41
|
return 'RedHat'
|
40
42
|
else
|
41
43
|
return family.tr(' ', '_')
|
@@ -22,12 +22,12 @@ module Katello
|
|
22
22
|
scoped_search :on => :release_version, :in => :subscription_facet, :complete_value => true
|
23
23
|
scoped_search :on => :autoheal, :in => :subscription_facet, :complete_value => true
|
24
24
|
scoped_search :on => :service_level, :in => :subscription_facet, :complete_value => true
|
25
|
-
scoped_search :on => :last_checkin, :in => :subscription_facet, :complete_value => true
|
25
|
+
scoped_search :on => :last_checkin, :in => :subscription_facet, :complete_value => true, :only_explicit => true
|
26
26
|
scoped_search :on => :registered_through, :in => :subscription_facet, :complete_value => true
|
27
|
-
scoped_search :on => :registered_at, :in => :subscription_facet, :rename => :registered_at
|
27
|
+
scoped_search :on => :registered_at, :in => :subscription_facet, :rename => :registered_at, :only_explicit => true
|
28
28
|
scoped_search :on => :uuid, :in => :subscription_facet, :rename => :subscription_uuid
|
29
29
|
scoped_search :in => :activation_keys, :on => :name, :rename => :activation_key, :complete_value => true, :ext_method => :find_by_activation_key
|
30
|
-
scoped_search :in => :activation_keys, :on => :id, :rename => :activation_key_id, :complete_value => true, :ext_method => :find_by_activation_key_id
|
30
|
+
scoped_search :in => :activation_keys, :on => :id, :rename => :activation_key_id, :complete_value => true, :ext_method => :find_by_activation_key_id, :only_explicit => true
|
31
31
|
end
|
32
32
|
|
33
33
|
def update_action
|
@@ -57,6 +57,23 @@ module Katello
|
|
57
57
|
filename.include?("vmlinuz") || filename.include?("pxeboot")
|
58
58
|
end
|
59
59
|
end
|
60
|
+
|
61
|
+
def self.needs_importer_updates(repos, capsule = nil)
|
62
|
+
repos.select do |repo|
|
63
|
+
repo_details = capsule ? capsule.pulp_repo_facts(repo.pulp_id) : repo.pulp_repo_facts
|
64
|
+
next unless repo_details
|
65
|
+
capsule_importer = repo_details["importers"][0]
|
66
|
+
!repo.importer_matches?(capsule_importer)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def self.needs_distributor_updates(repos, capsule = nil)
|
71
|
+
repos.select do |repo|
|
72
|
+
repo_details = capsule ? capsule.pulp_repo_facts(repo.pulp_id) : repo.pulp_repo_facts
|
73
|
+
next unless repo_details
|
74
|
+
!repo.distributors_match?(repo_details["distributors"], capsule)
|
75
|
+
end
|
76
|
+
end
|
60
77
|
end
|
61
78
|
end
|
62
79
|
|
data/app/models/katello/ping.rb
CHANGED
@@ -117,10 +117,6 @@ module Katello
|
|
117
117
|
fail _("Pulp does not appear to be running.") if body.empty?
|
118
118
|
json = JSON.parse(body)
|
119
119
|
|
120
|
-
if json['known_workers'].empty?
|
121
|
-
fail _("No pulp workers running.")
|
122
|
-
end
|
123
|
-
|
124
120
|
if json['database_connection'] && json['database_connection']['connected'] != true
|
125
121
|
fail _("Pulp database connection issue.")
|
126
122
|
end
|
@@ -129,8 +125,21 @@ module Katello
|
|
129
125
|
fail _("Pulp message bus connection issue.")
|
130
126
|
end
|
131
127
|
|
128
|
+
unless all_pulp_workers_present?(json)
|
129
|
+
fail _("Not all necessary pulp workers running.")
|
130
|
+
end
|
131
|
+
|
132
132
|
json
|
133
133
|
end
|
134
|
+
|
135
|
+
def all_pulp_workers_present?(json)
|
136
|
+
worker_ids = json["known_workers"].collect { |worker| worker["_id"] }
|
137
|
+
return false unless worker_ids.any?
|
138
|
+
scheduler = worker_ids.any? { |worker| worker.include?("scheduler@") }
|
139
|
+
resource_manager = worker_ids.any? { |worker| worker.include?("resource_manager@") }
|
140
|
+
reservered_resource_worker = worker_ids.any? { |worker| worker =~ /reserved_resource_worker-./ }
|
141
|
+
scheduler && resource_manager && reservered_resource_worker
|
142
|
+
end
|
134
143
|
end
|
135
144
|
end
|
136
145
|
end
|
@@ -57,6 +57,12 @@ module Katello
|
|
57
57
|
scope :redhat, -> { joins(:provider).where("#{Provider.table_name}.provider_type" => Provider::REDHAT) }
|
58
58
|
scope :custom, -> { joins(:provider).where("#{Provider.table_name}.provider_type" => [Provider::CUSTOM, Provider::ANONYMOUS]) }
|
59
59
|
|
60
|
+
def self.with_subscribable_content
|
61
|
+
joins(:repositories).uniq.
|
62
|
+
where("#{Katello::Repository.table_name}.content_type IN (?)",
|
63
|
+
Repository::SUBSCRIBABLE_TYPES)
|
64
|
+
end
|
65
|
+
|
60
66
|
def self.enabled
|
61
67
|
self.where("#{Product.table_name}.id in (?) or #{Product.table_name}.id in (?)",
|
62
68
|
Product.redhat.joins(:repositories).uniq.pluck(:id), Product.custom.pluck(:id))
|
@@ -209,7 +215,9 @@ module Katello
|
|
209
215
|
end
|
210
216
|
|
211
217
|
def available_content
|
212
|
-
self.productContent.
|
218
|
+
self.productContent.select do |content|
|
219
|
+
self.repositories.subscribable.where(content_id: content.content.id).exists?
|
220
|
+
end
|
213
221
|
end
|
214
222
|
|
215
223
|
def related_resources
|
@@ -24,6 +24,7 @@ module Katello
|
|
24
24
|
OSTREE_TYPE = 'ostree'.freeze
|
25
25
|
|
26
26
|
CHECKSUM_TYPES = %w(sha1 sha256).freeze
|
27
|
+
SUBSCRIBABLE_TYPES = [YUM_TYPE, OSTREE_TYPE].freeze
|
27
28
|
|
28
29
|
belongs_to :environment, :inverse_of => :repositories, :class_name => "Katello::KTEnvironment"
|
29
30
|
belongs_to :product, :inverse_of => :repositories
|
@@ -115,6 +116,7 @@ module Katello
|
|
115
116
|
scope :non_puppet, -> { where("content_type != ?", PUPPET_TYPE) }
|
116
117
|
scope :non_archived, -> { where('environment_id is not NULL') }
|
117
118
|
scope :archived, -> { where('environment_id is NULL') }
|
119
|
+
scope :subscribable, -> { where(content_type: SUBSCRIBABLE_TYPES) }
|
118
120
|
|
119
121
|
scoped_search :on => :name, :complete_value => true
|
120
122
|
scoped_search :rename => :product, :on => :name, :in => :product, :complete_value => true
|
@@ -265,6 +267,11 @@ module Katello
|
|
265
267
|
end
|
266
268
|
end
|
267
269
|
|
270
|
+
def copy_library_instance_attributes
|
271
|
+
self.unprotected = library_instance.unprotected
|
272
|
+
self.checksum_type = library_instance.checksum_type
|
273
|
+
end
|
274
|
+
|
268
275
|
# Returns true if the pulp_task_id was triggered by the last synchronization
|
269
276
|
# action for the repository. Dynflow action handles the synchronization
|
270
277
|
# by it's own so no need to synchronize it again in this callback. Since the
|
@@ -12,6 +12,11 @@ module Katello
|
|
12
12
|
|
13
13
|
scope :in_organization, ->(org) { where(:organization => org) }
|
14
14
|
|
15
|
+
def self.with_subscribable_content
|
16
|
+
joins(:products).
|
17
|
+
where("#{Katello::Product.table_name}.id" => Product.with_subscribable_content)
|
18
|
+
end
|
19
|
+
|
15
20
|
def redhat?
|
16
21
|
self.products.any? { |product| product.redhat? }
|
17
22
|
end
|
@@ -12,9 +12,9 @@
|
|
12
12
|
<table class="table table-fixed table-striped table-bordered">
|
13
13
|
<thead>
|
14
14
|
<tr>
|
15
|
-
<th
|
16
|
-
<th
|
17
|
-
<th
|
15
|
+
<th><%= _("Content View") %></th>
|
16
|
+
<th><%= _("Task") %></th>
|
17
|
+
<th><%= _("Status") %></th>
|
18
18
|
</tr>
|
19
19
|
</thead>
|
20
20
|
<tbody>
|
@@ -12,9 +12,9 @@
|
|
12
12
|
<table class="table table-fixed table-striped table-bordered">
|
13
13
|
<thead>
|
14
14
|
<tr>
|
15
|
-
<th
|
16
|
-
<th
|
17
|
-
<th
|
15
|
+
<th><%= _("Updates") %></th>
|
16
|
+
<th><%= _("Name") %></th>
|
17
|
+
<th><%= _("Content Hosts") %></th>
|
18
18
|
</tr>
|
19
19
|
</thead>
|
20
20
|
<tbody>
|
@@ -2,31 +2,36 @@
|
|
2
2
|
<%= _("Current Subscription Totals") %>
|
3
3
|
</h4>
|
4
4
|
|
5
|
-
<%
|
6
|
-
|
7
|
-
<%
|
8
|
-
<%
|
9
|
-
<%
|
5
|
+
<% unless Organization.current.present? %>
|
6
|
+
<p class="ca"><%= _("Please select an organization to view subscription totals.") %></p>
|
7
|
+
<% else %>
|
8
|
+
<% subscriptions = Katello::Subscription.in_organization([Organization.current]).includes(:pools) %>
|
9
|
+
<% total_active_subscriptions = Organization.current.active_pools_count %>
|
10
|
+
<% total_expiring_subscriptions = subscriptions.select(&:expiring_soon?).count %>
|
11
|
+
<% total_recently_expired_subscriptions = subscriptions.select(&:recently_expired?).count %>
|
12
|
+
|
13
|
+
<table class="table table-fixed table-striped table-bordered">
|
14
|
+
<thead>
|
15
|
+
<tr>
|
16
|
+
<th><%= _("Subscription Status") %></th>
|
17
|
+
<th><%= _("Count") %></th>
|
18
|
+
</tr>
|
19
|
+
</thead>
|
20
|
+
<tbody>
|
21
|
+
<tr>
|
22
|
+
<td><%= _("Active Subscriptions") %></td>
|
23
|
+
<td style="text-align:right;"><%= total_active_subscriptions %></td>
|
24
|
+
</tr>
|
25
|
+
<tr>
|
26
|
+
<td><%= _("Subscriptions Expiring in 120 Days") %></td>
|
27
|
+
<td style="text-align:right;"><%= total_expiring_subscriptions %></td>
|
28
|
+
</tr>
|
29
|
+
<tr>
|
30
|
+
<td><%= _("Recently Expired Subscriptions") %></td>
|
31
|
+
<td style="text-align:right;"><%= total_recently_expired_subscriptions %></td>
|
32
|
+
</tr>
|
33
|
+
</tbody>
|
34
|
+
</table>
|
35
|
+
<% end %>
|
36
|
+
|
10
37
|
|
11
|
-
<table class="table table-fixed table-striped table-bordered">
|
12
|
-
<thead>
|
13
|
-
<tr>
|
14
|
-
<th>Subscription Status</th>
|
15
|
-
<th>Count</th>
|
16
|
-
</tr>
|
17
|
-
</thead>
|
18
|
-
<tbody>
|
19
|
-
<tr>
|
20
|
-
<td><%= _("Active Subscriptions") %></td>
|
21
|
-
<td style="text-align:right;"><%= total_active_subscriptions %></td>
|
22
|
-
</tr>
|
23
|
-
<tr>
|
24
|
-
<td><%= _("Subscriptions Expiring in 120 Days") %></td>
|
25
|
-
<td style="text-align:right;"><%= total_expiring_subscriptions %></td>
|
26
|
-
</tr>
|
27
|
-
<tr>
|
28
|
-
<td><%= _("Recently Expired Subscriptions") %></td>
|
29
|
-
<td style="text-align:right;"><%= total_recently_expired_subscriptions %></td>
|
30
|
-
</tr>
|
31
|
-
</tbody>
|
32
|
-
</table>
|
@@ -2,58 +2,61 @@
|
|
2
2
|
<%= _("Content Host Subscription Status") %>
|
3
3
|
</h4>
|
4
4
|
|
5
|
-
<%
|
6
|
-
|
7
|
-
<%
|
8
|
-
<%
|
9
|
-
<%
|
10
|
-
<%
|
5
|
+
<% unless Organization.current.present? %>
|
6
|
+
<p class="ca"><%= _("Please select an organization to view subscription status.") %></p>
|
7
|
+
<% else %>
|
8
|
+
<% owner_info = Organization.current.owner_info %>
|
9
|
+
<% invalid_consumer_count = owner_info.total_invalid_compliance_consumers %>
|
10
|
+
<% partial_consumer_count = owner_info.total_partial_compliance_consumers %>
|
11
|
+
<% valid_consumer_count = owner_info.total_valid_compliance_consumers %>
|
12
|
+
<% total_count = owner_info.total_consumers %>
|
11
13
|
|
12
|
-
<table class="table table-fixed table-striped table-bordered">
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
</table>
|
14
|
+
<table class="table table-fixed table-striped table-bordered">
|
15
|
+
<thead>
|
16
|
+
<tr>
|
17
|
+
<th></th>
|
18
|
+
<th><%= _("Count") %></th>
|
19
|
+
</tr>
|
20
|
+
</thead>
|
21
|
+
<tbody>
|
22
|
+
<tr>
|
23
|
+
<td>
|
24
|
+
<%= link_to('/content_hosts?search=subscription_status=invalid') do %>
|
25
|
+
<i class="label label-danger" style="margin-right: 6px"> </i><%= _("Invalid") %>
|
26
|
+
<% end %>
|
27
|
+
</td>
|
28
|
+
<td style="text-align:right">
|
29
|
+
<%= link_to( "#{invalid_consumer_count}", '/content_hosts?search=subscription_status=invalid')%>
|
30
|
+
</td>
|
31
|
+
</tr>
|
32
|
+
<tr>
|
33
|
+
<td>
|
34
|
+
<%= link_to('/content_hosts?search=subscription_status=partial') do %>
|
35
|
+
<i class="label label-warning" style="margin-right: 6px"> </i><%= _("Partial") %>
|
36
|
+
<% end %>
|
37
|
+
</td>
|
38
|
+
<td style="text-align:right">
|
39
|
+
<%= link_to( "#{partial_consumer_count}", '/content_hosts?search=subscription_status=partial')%>
|
40
|
+
</td>
|
41
|
+
</tr>
|
42
|
+
<tr>
|
43
|
+
<td>
|
44
|
+
<%= link_to('/content_hosts?search=subscription_status=valid') do %>
|
45
|
+
<i class="label label-success" style="margin-right: 6px"> </i><%= _("Valid") %>
|
46
|
+
<% end %>
|
47
|
+
</td>
|
48
|
+
<td style="text-align:right">
|
49
|
+
<%= link_to( "#{valid_consumer_count}", '/content_hosts?search=subscription_status=valid')%>
|
50
|
+
</td>
|
51
|
+
</tr>
|
52
|
+
<tr>
|
53
|
+
<td><h4>
|
54
|
+
<%= link_to("Total Content Hosts", '/content_hosts')%>
|
55
|
+
</h4></td>
|
56
|
+
<td style="text-align:right;">
|
57
|
+
<%= link_to( "#{total_count}", '/content_hosts')%>
|
58
|
+
</td>
|
59
|
+
</tr>
|
60
|
+
</tbody>
|
61
|
+
</table>
|
62
|
+
<% end %>
|
@@ -14,9 +14,9 @@
|
|
14
14
|
<table class="table table-fixed table-striped table-bordered">
|
15
15
|
<thead>
|
16
16
|
<tr>
|
17
|
-
<th
|
18
|
-
<th
|
19
|
-
<th
|
17
|
+
<th><%= _("Product") %></th>
|
18
|
+
<th><%= _("Status") %></th>
|
19
|
+
<th><%= _("Finished") %></th>
|
20
20
|
</tr>
|
21
21
|
</thead>
|
22
22
|
<tbody>
|
@@ -22,6 +22,7 @@ service network restart
|
|
22
22
|
pm_set = @host.puppetmaster.empty? ? false : true
|
23
23
|
puppet_enabled = pm_set || @host.params['force-puppet']
|
24
24
|
salt_enabled = @host.params['salt_master'] ? true : false
|
25
|
+
chef_enabled = @host.respond_to?(:chef_proxy) && @host.chef_proxy
|
25
26
|
%>
|
26
27
|
|
27
28
|
<%= snippet "subscription_manager_registration" %>
|
@@ -44,29 +45,16 @@ yum -t -y -e 0 update
|
|
44
45
|
|
45
46
|
<%= snippet('remote_execution_ssh_keys') %>
|
46
47
|
|
47
|
-
<% if
|
48
|
-
|
49
|
-
cat > /etc/salt/minion << EOF
|
50
|
-
<%= snippet 'saltstack_minion' %>
|
51
|
-
EOF
|
52
|
-
# Setup salt-minion to run on system reboot
|
53
|
-
/sbin/chkconfig --level 345 salt-minion on
|
54
|
-
# Running salt-call to trigger key signing
|
55
|
-
salt-call --no-color --grains >/dev/null
|
48
|
+
<% if chef_enabled %>
|
49
|
+
<%= snippet 'chef_client' %>
|
56
50
|
<% end -%>
|
57
51
|
|
58
52
|
<% if puppet_enabled %>
|
59
|
-
|
60
|
-
|
61
|
-
cat > /etc/puppet/puppet.conf << EOF
|
62
|
-
<%= snippet 'puppet.conf' %>
|
63
|
-
EOF
|
64
|
-
|
65
|
-
# Setup puppet to run on system reboot
|
66
|
-
/sbin/chkconfig --level 345 puppet on
|
53
|
+
<%= snippet 'puppet_setup' %>
|
54
|
+
<% end -%>
|
67
55
|
|
68
|
-
|
69
|
-
|
56
|
+
<% if salt_enabled %>
|
57
|
+
<%= snippet 'saltstack_setup' %>
|
70
58
|
<% end -%>
|
71
59
|
|
72
60
|
exit 0
|
@@ -18,6 +18,7 @@ oses:
|
|
18
18
|
pm_set = @host.puppetmaster.empty? ? false : true
|
19
19
|
puppet_enabled = pm_set || @host.params['force-puppet']
|
20
20
|
salt_enabled = @host.params['salt_master'] ? true : false
|
21
|
+
chef_enabled = @host.respond_to?(:chef_proxy) && @host.chef_proxy
|
21
22
|
section_end = (rhel_compatible && os_major <= 5) ? '' : '%end'
|
22
23
|
%>
|
23
24
|
install
|
@@ -113,30 +114,16 @@ yum -t -y -e 0 update
|
|
113
114
|
|
114
115
|
<%= snippet('remote_execution_ssh_keys') %>
|
115
116
|
|
116
|
-
<% if
|
117
|
-
|
118
|
-
cat > /etc/salt/minion << EOF
|
119
|
-
<%= snippet 'saltstack_minion' %>
|
120
|
-
EOF
|
121
|
-
# Setup salt-minion to run on system reboot
|
122
|
-
/sbin/chkconfig --level 345 salt-minion on
|
123
|
-
# Running salt-call to trigger key signing
|
124
|
-
salt-call --no-color --grains >/dev/null
|
117
|
+
<% if chef_enabled %>
|
118
|
+
<%= snippet 'chef_client' %>
|
125
119
|
<% end -%>
|
126
120
|
|
127
121
|
<% if puppet_enabled %>
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
echo "Configuring puppet"
|
132
|
-
cat > /etc/puppet/puppet.conf << EOF
|
133
|
-
<%= snippet 'puppet.conf' %>
|
134
|
-
EOF
|
135
|
-
|
136
|
-
# Setup puppet to run on system reboot
|
137
|
-
/sbin/chkconfig --level 345 puppet on
|
122
|
+
<%= snippet 'puppet_setup' %>
|
123
|
+
<% end -%>
|
138
124
|
|
139
|
-
|
125
|
+
<% if salt_enabled %>
|
126
|
+
<%= snippet 'saltstack_setup' %>
|
140
127
|
<% end -%>
|
141
128
|
|
142
129
|
sync
|
@@ -63,31 +63,24 @@ write_files:
|
|
63
63
|
pm_set = @host.puppetmaster.empty? ? false : true
|
64
64
|
puppet_enabled = non_atomic && (pm_set || @host.params['force-puppet'])
|
65
65
|
salt_enabled = non_atomic && (@host.params['salt_master'] ? true : false)
|
66
|
+
chef_enabled = @host.respond_to?(:chef_proxy) && @host.chef_proxy
|
66
67
|
%>
|
67
|
-
<% if
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
snippet 'saltstack_minion'
|
72
|
-
end %>
|
73
|
-
EOF
|
74
|
-
# Setup salt-minion to run on system reboot
|
75
|
-
/sbin/chkconfig --level 345 salt-minion on
|
76
|
-
# Running salt-call to trigger key signing
|
77
|
-
salt-call --no-color --grains >/dev/null
|
68
|
+
<% if chef_enabled %>
|
69
|
+
<%= indent 4 do
|
70
|
+
snippet 'chef_client'
|
71
|
+
end %>
|
78
72
|
<% end -%>
|
73
|
+
|
79
74
|
<% if puppet_enabled %>
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
end %>
|
85
|
-
EOF
|
86
|
-
# Setup puppet to run on system reboot
|
87
|
-
/sbin/chkconfig --level 345 puppet on
|
75
|
+
<%= indent 4 do
|
76
|
+
snippet 'puppet_setup'
|
77
|
+
end %>
|
78
|
+
<% end -%>
|
88
79
|
|
89
|
-
|
90
|
-
|
80
|
+
<% if salt_enabled %>
|
81
|
+
<%= indent 4 do
|
82
|
+
snippet 'saltstack_setup'
|
83
|
+
end %>
|
91
84
|
<% end -%>
|
92
85
|
phone_home:
|
93
86
|
url: <%= foreman_url('built') %>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
select_tag env_select_id, lifecycle_environment_options(@hostgroup, :include_blank => blank_or_inherit_with_id(f, :lifecycle_environment)),
|
15
15
|
:class => 'form-control', :name => env_select_name
|
16
16
|
else
|
17
|
-
select_tag env_select_id, lifecycle_environment_options(@host, :selected_host_group => @hostgroup, :include_blank => blank_or_inherit_with_id(f, :lifecycle_environment)), :class => 'form-control', :name => env_select_name
|
17
|
+
select_tag env_select_id, lifecycle_environment_options(@host, :selected_host_group => @hostgroup || @host.hostgroup, :include_blank => blank_or_inherit_with_id(f, :lifecycle_environment)), :class => 'form-control', :name => env_select_name
|
18
18
|
end
|
19
19
|
end %>
|
20
20
|
|
@@ -26,7 +26,7 @@ end %>
|
|
26
26
|
select_tag cv_select_id, content_views_for_host(@hostgroup, :include_blank => blank_or_inherit_with_id(f, :content_view)), :data => {"spinner_path" => spinner_path},
|
27
27
|
:class => 'form-control', :name => cv_select_name
|
28
28
|
else
|
29
|
-
select_tag cv_select_id, content_views_for_host(@host, :selected_host_group => @hostgroup, :include_blank => blank_or_inherit_with_id(f, :content_view)), :data => {"spinner_path" => spinner_path}, :class => 'form-control', :name => cv_select_name
|
29
|
+
select_tag cv_select_id, content_views_for_host(@host, :selected_host_group => @hostgroup || @host.hostgroup, :include_blank => blank_or_inherit_with_id(f, :content_view)), :data => {"spinner_path" => spinner_path}, :class => 'form-control', :name => cv_select_name
|
30
30
|
end
|
31
31
|
end %>
|
32
32
|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
</h3>
|
8
8
|
|
9
9
|
<nav>
|
10
|
-
<ul class="nav nav-tabs">
|
10
|
+
<ul class="nav nav-tabs" ng-show="permitted('edit_content_views', contentView)">
|
11
11
|
<li ng-class="{active: isState('content-views.details.repositories.docker.list')}">
|
12
12
|
<a ui-sref="content-views.details.repositories.docker.list">
|
13
13
|
<span translate>
|
@@ -7,7 +7,7 @@
|
|
7
7
|
</h3>
|
8
8
|
|
9
9
|
<nav>
|
10
|
-
<ul class="nav nav-tabs">
|
10
|
+
<ul class="nav nav-tabs" ng-show="permitted('edit_content_views', contentView)">
|
11
11
|
<li ng-class="{active: isState('content-views.details.repositories.file.list')}">
|
12
12
|
<a ui-sref="content-views.details.repositories.file.list">
|
13
13
|
<span translate>
|
@@ -7,7 +7,7 @@
|
|
7
7
|
</h3>
|
8
8
|
|
9
9
|
<nav>
|
10
|
-
<ul class="nav nav-tabs">
|
10
|
+
<ul class="nav nav-tabs" ng-show="permitted('edit_content_views', contentView)">
|
11
11
|
<li ng-class="{active: isState('content-views.details.repositories.ostree.list')}">
|
12
12
|
<a ui-sref="content-views.details.repositories.ostree.list">
|
13
13
|
<span translate>
|
@@ -7,7 +7,7 @@
|
|
7
7
|
</h3>
|
8
8
|
|
9
9
|
<nav>
|
10
|
-
<ul class="nav nav-tabs">
|
10
|
+
<ul class="nav nav-tabs" ng-show="permitted('edit_content_views', contentView)">
|
11
11
|
<li ng-class="{active: isState('content-views.details.repositories.yum.list')}">
|
12
12
|
<a ui-sref="content-views.details.repositories.yum.list">
|
13
13
|
<span translate>
|
@@ -81,7 +81,7 @@ angular.module('Bastion.repositories').controller('RepositoryDetailsInfoControll
|
|
81
81
|
};
|
82
82
|
|
83
83
|
$scope.uploadContent = function (content) {
|
84
|
-
var returnData, error;
|
84
|
+
var returnData, error, uploaded;
|
85
85
|
|
86
86
|
if (content) {
|
87
87
|
try {
|
@@ -95,7 +95,8 @@ angular.module('Bastion.repositories').controller('RepositoryDetailsInfoControll
|
|
95
95
|
}
|
96
96
|
|
97
97
|
if (returnData !== null && returnData.status === 'success') {
|
98
|
-
|
98
|
+
uploaded = returnData.filenames.join(', ');
|
99
|
+
$scope.uploadSuccessMessages = [translate('Successfully uploaded content: ') + uploaded];
|
99
100
|
$scope.repository.$get();
|
100
101
|
updateRepositoriesTable();
|
101
102
|
} else {
|
@@ -18,7 +18,9 @@ angular.module('Bastion.subscriptions').controller('SubscriptionProductsControll
|
|
18
18
|
|
19
19
|
Product.queryUnpaged({'organization_id': CurrentOrganization,
|
20
20
|
'subscription_id': $scope.$stateParams.subscriptionId,
|
21
|
-
enabled: true
|
21
|
+
enabled: true,
|
22
|
+
'full_result': true,
|
23
|
+
'include_available_content': true
|
22
24
|
}, function (response) {
|
23
25
|
$scope.products = response.results;
|
24
26
|
$scope.displayArea.working = false;
|
data/lib/katello/engine.rb
CHANGED
@@ -172,7 +172,6 @@ module Katello
|
|
172
172
|
::Host::Managed.send :include, ::Katello::Concerns::SubscriptionFacetHostExtensions
|
173
173
|
::Hostgroup.send :include, Katello::Concerns::HostgroupExtensions
|
174
174
|
::Location.send :include, Katello::Concerns::LocationExtensions
|
175
|
-
::Medium.send :include, Katello::Concerns::MediumExtensions
|
176
175
|
::Redhat.send :include, Katello::Concerns::RedhatExtensions
|
177
176
|
::Operatingsystem.send :include, Katello::Concerns::OperatingsystemExtensions
|
178
177
|
::Organization.send :include, Katello::Concerns::OrganizationExtensions
|
data/lib/katello/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: katello
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.0.
|
4
|
+
version: 3.2.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- N/A
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -653,7 +653,6 @@ files:
|
|
653
653
|
- app/lib/actions/katello/repository/correct_checksum.rb
|
654
654
|
- app/lib/actions/katello/repository/create.rb
|
655
655
|
- app/lib/actions/katello/repository/destroy.rb
|
656
|
-
- app/lib/actions/katello/repository/destroy_medium.rb
|
657
656
|
- app/lib/actions/katello/repository/discover.rb
|
658
657
|
- app/lib/actions/katello/repository/errata_mail.rb
|
659
658
|
- app/lib/actions/katello/repository/export.rb
|
@@ -669,7 +668,6 @@ files:
|
|
669
668
|
- app/lib/actions/katello/repository/remove_content.rb
|
670
669
|
- app/lib/actions/katello/repository/sync.rb
|
671
670
|
- app/lib/actions/katello/repository/update.rb
|
672
|
-
- app/lib/actions/katello/repository/update_media.rb
|
673
671
|
- app/lib/actions/katello/repository/upload_errata.rb
|
674
672
|
- app/lib/actions/katello/repository/upload_files.rb
|
675
673
|
- app/lib/actions/katello/repository_set/disable_repository.rb
|
@@ -830,7 +828,6 @@ files:
|
|
830
828
|
- app/models/katello/concerns/host_managed_extensions.rb
|
831
829
|
- app/models/katello/concerns/hostgroup_extensions.rb
|
832
830
|
- app/models/katello/concerns/location_extensions.rb
|
833
|
-
- app/models/katello/concerns/medium_extensions.rb
|
834
831
|
- app/models/katello/concerns/operatingsystem_extensions.rb
|
835
832
|
- app/models/katello/concerns/organization_extensions.rb
|
836
833
|
- app/models/katello/concerns/pulp_database_unit.rb
|
@@ -1354,7 +1351,6 @@ files:
|
|
1354
1351
|
- db/seeds.d/106-mail_notifications.rb
|
1355
1352
|
- db/seeds.d/107-enable_dynflow.rb
|
1356
1353
|
- db/seeds.d/108-ensure_sync_notification.rb
|
1357
|
-
- db/seeds.d/109-atomic_os.rb
|
1358
1354
|
- db/seeds.d/75-job_templates.rb
|
1359
1355
|
- engines/bastion_katello/README.md
|
1360
1356
|
- engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/activation-key.factory.js
|
@@ -1990,7 +1986,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1990
1986
|
version: 1.3.1
|
1991
1987
|
requirements: []
|
1992
1988
|
rubyforge_project:
|
1993
|
-
rubygems_version: 2.
|
1989
|
+
rubygems_version: 2.2.5
|
1994
1990
|
signing_key:
|
1995
1991
|
specification_version: 4
|
1996
1992
|
summary: ''
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module Actions
|
2
|
-
module Katello
|
3
|
-
module Repository
|
4
|
-
class UpdateMedia < Actions::Base
|
5
|
-
input_format do
|
6
|
-
param :repo_id
|
7
|
-
param :contents_changed
|
8
|
-
end
|
9
|
-
|
10
|
-
def finalize
|
11
|
-
repo = ::Katello::Repository.find(input[:repo_id])
|
12
|
-
Medium.update_media(repo)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,79 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
module Concerns
|
3
|
-
module MediumExtensions
|
4
|
-
extend ActiveSupport::Concern
|
5
|
-
|
6
|
-
def destroy!
|
7
|
-
unless destroy
|
8
|
-
fail self.errors.full_messages.join('; ')
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
module ClassMethods
|
13
|
-
def update_media(repo)
|
14
|
-
return if repo.puppet?
|
15
|
-
|
16
|
-
medium_path = ::Medium.installation_media_path(repo.uri)
|
17
|
-
|
18
|
-
if (distribution = repo.distribution_bootable?)
|
19
|
-
return if ::Medium.find_by(:path => medium_path)
|
20
|
-
|
21
|
-
os = ::Redhat.find_or_create_operating_system(repo)
|
22
|
-
|
23
|
-
arch = ::Architecture.where(:name => repo.distribution_arch).first_or_create!
|
24
|
-
os.architectures << arch unless os.architectures.include?(arch)
|
25
|
-
|
26
|
-
medium_name = ::Medium.construct_name(repo, distribution)
|
27
|
-
medium = ::Medium.find_or_create_medium(repo.organization, medium_name, medium_path)
|
28
|
-
os.media << medium
|
29
|
-
|
30
|
-
os.save!
|
31
|
-
|
32
|
-
else
|
33
|
-
if (medium = ::Medium.find_by(:path => medium_path))
|
34
|
-
medium.destroy
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
def find_or_create_medium(org, medium_name, medium_path)
|
40
|
-
params = { :name => medium_name, :path => medium_path,
|
41
|
-
:os_family => 'Redhat' }
|
42
|
-
|
43
|
-
medium = ::Medium.joins(:organizations).where(params).where("taxonomies.id in (?)", [org.id]).first
|
44
|
-
medium = ::Medium.create!(params.merge(:organization_ids => [org.id])) unless medium
|
45
|
-
|
46
|
-
return medium
|
47
|
-
end
|
48
|
-
|
49
|
-
def find_medium(repo)
|
50
|
-
path = ::Medium.installation_media_path(repo.uri)
|
51
|
-
::Medium.find_by(:path => path)
|
52
|
-
end
|
53
|
-
|
54
|
-
def construct_name(repo, _distribution)
|
55
|
-
parts = [repo.organization.label, repo.environment.label]
|
56
|
-
if repo.content_view && !repo.content_view.default?
|
57
|
-
parts << repo.content_view.label
|
58
|
-
end
|
59
|
-
parts << repo.product.label
|
60
|
-
parts << repo.label
|
61
|
-
return normalize_name(parts.compact.join('/'))
|
62
|
-
end
|
63
|
-
|
64
|
-
# Foreman and Puppet uses RedHat name for Red Hat Enterprise Linux
|
65
|
-
def normalize_name(name)
|
66
|
-
name.sub('Red_Hat_Enterprise_Linux', 'Red_Hat')
|
67
|
-
end
|
68
|
-
|
69
|
-
# takes repo uri from Katello and makes installation media url
|
70
|
-
# suitable for provisioning from it
|
71
|
-
def installation_media_path(repo_uri)
|
72
|
-
path = repo_uri.sub(/\Ahttps/, 'http')
|
73
|
-
path << "/" unless path.end_with?('/')
|
74
|
-
return path
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
data/db/seeds.d/109-atomic_os.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
# This file should contain all the record creation needed to seed the database with its default values.
|
2
|
-
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
|
3
|
-
#
|
4
|
-
# !!! PLEASE KEEP THIS SCRIPT IDEMPOTENT !!!
|
5
|
-
#
|
6
|
-
|
7
|
-
::User.current = ::User.anonymous_api_admin
|
8
|
-
os_attributes = {:major => "7", :minor => "2", :name => ::Operatingsystem::REDHAT_ATOMIC_HOST_OS}
|
9
|
-
Operatingsystem.where(os_attributes).first_or_create!
|
10
|
-
|
11
|
-
::User.current = nil
|