katello 3.0.0.rc2 → 3.0.0.rc3
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/v2/content_view_versions_controller.rb +15 -7
- data/app/controllers/katello/api/v2/systems_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 +4 -4
- data/app/lib/actions/katello/content_view_version/incremental_update.rb +1 -1
- data/app/lib/actions/katello/repository/create.rb +5 -3
- data/app/lib/actions/pulp/consumer/content_install.rb +1 -1
- data/app/lib/katello/resources/candlepin.rb +2 -1
- data/app/models/katello/activation_key.rb +2 -2
- data/app/models/katello/concerns/pulp_database_unit.rb +1 -1
- data/app/models/katello/content_view.rb +1 -1
- data/app/models/katello/content_view_version.rb +5 -1
- data/app/models/katello/erratum.rb +2 -2
- data/app/models/katello/glue/candlepin/pool.rb +1 -1
- data/app/models/katello/gpg_key.rb +1 -1
- data/app/models/katello/host_collection.rb +1 -1
- data/app/models/katello/kt_environment.rb +1 -1
- data/app/models/katello/pool.rb +1 -1
- data/app/models/katello/product.rb +1 -1
- data/app/models/katello/sync_plan.rb +1 -1
- data/app/views/foreman/unattended/finish-katello.erb +1 -1
- data/app/views/foreman/unattended/kickstart-katello.erb +1 -1
- data/app/views/foreman/unattended/userdata-katello.erb +1 -1
- data/app/views/katello/api/v2/content_facet/base_with_root.json.rabl +1 -1
- data/app/views/katello/api/v2/content_facet/show.json.rabl +1 -1
- data/app/views/katello/api/v2/content_view_versions/base.json.rabl +2 -1
- data/app/views/katello/api/v2/subscription_facet/base_with_root.json.rabl +1 -1
- data/app/views/katello/api/v2/subscription_facet/show.json.rabl +1 -1
- data/db/migrate/20150930183738_migrate_content_hosts.rb +6 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-errata.controller.js +13 -13
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details-info.controller.js +9 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +20 -15
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +35 -35
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-subscriptions.html +7 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts-table-full.html +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version.controller.js +20 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version.html +14 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-add-hosts.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-hosts-list.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js +2 -2
- data/lib/katello/engine.rb +10 -1
- data/lib/katello/version.rb +1 -1
- data/vendor/assets/stylesheets/katello/{jquery.treeTable.css → jquery.treeTable.scss} +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcf466b607593accd6ccc627041d411c26cc1139
|
4
|
+
data.tar.gz: abdebb1a909e6c2c51d0dade21571f0342e8eb8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b44891c5cff52cb9f94c585e752d9a5d45687cdd9078b33bd24d8ff760e74a75dc212af47cbd35cb820e2c8d46a6eea4d1370a07683411e4a615fc99667651fb
|
7
|
+
data.tar.gz: 93876b0c4423e0ebf63506433bf91c1b6e4ba50e54705b083a4be0b5d83a34a4917854bfde1e4d0ae3c8c47b0cd75954a60f266642b5d7e23fb77e3176fe4cfb
|
@@ -108,7 +108,8 @@ module Katello
|
|
108
108
|
end
|
109
109
|
end
|
110
110
|
def incremental_update
|
111
|
-
|
111
|
+
any_environments = params[:content_view_version_environments].any? { |cvve| cvve[:environment_ids].try(:any?) }
|
112
|
+
if params[:add_content] && params[:add_content].key?(:errata_ids) && params[:update_hosts] && any_environments
|
112
113
|
hosts = calculate_hosts_for_incremental(params[:update_hosts], params[:propagate_to_composites])
|
113
114
|
else
|
114
115
|
hosts = []
|
@@ -126,9 +127,13 @@ module Katello
|
|
126
127
|
if bulk_params[:included].try(:[], :search)
|
127
128
|
version_environments = find_version_environments_for_hosts(use_composites)
|
128
129
|
restrict_hosts = lambda do |relation|
|
129
|
-
|
130
|
-
|
131
|
-
|
130
|
+
if version_environments.any?
|
131
|
+
errata = Erratum.with_identifiers(params[:add_content][:errata_ids])
|
132
|
+
content_facets = Host::ContentFacet.in_content_view_version_environments(version_environments).with_applicable_errata(errata)
|
133
|
+
relation.where(:id => content_facets.pluck(:host_id))
|
134
|
+
else
|
135
|
+
relation.where("1=0")
|
136
|
+
end
|
132
137
|
end
|
133
138
|
else
|
134
139
|
restrict_hosts = nil
|
@@ -171,8 +176,10 @@ module Katello
|
|
171
176
|
return deny_access(_("You are not allowed to promote to Environments %s") % un_promotable.map(&:name).join(', '))
|
172
177
|
end
|
173
178
|
|
174
|
-
|
175
|
-
|
179
|
+
unless combination[:environment_ids].blank?
|
180
|
+
not_found = combination[:environment_ids].map(&:to_s) - version_environment[:environments].map { |env| env.id.to_s }
|
181
|
+
fail _("Could not find Environment with ids: %s") % not_found.join(', ') unless not_found.empty?
|
182
|
+
end
|
176
183
|
|
177
184
|
if view.composite?
|
178
185
|
@composite_version_environments << version_environment
|
@@ -202,9 +209,10 @@ module Katello
|
|
202
209
|
:environments => composite_version.environments}
|
203
210
|
end
|
204
211
|
end
|
212
|
+
|
205
213
|
version_environments_for_systems_map.values
|
206
214
|
else
|
207
|
-
@version_environments
|
215
|
+
@version_environments.select { |ve| !ve[:environment_ids].blank? }
|
208
216
|
end
|
209
217
|
end
|
210
218
|
|
@@ -3,7 +3,7 @@ module Katello
|
|
3
3
|
include Katello::Concerns::FilteredAutoCompleteSearch
|
4
4
|
respond_to :json
|
5
5
|
|
6
|
-
wrap_parameters :include => (System.attribute_names + %w(type autoheal facts guest_ids host_collection_ids installed_products content_view environment))
|
6
|
+
wrap_parameters :include => (System.attribute_names + %w(type autoheal facts guest_ids host_collection_ids installed_products content_view environment service_level release_ver last_checkin))
|
7
7
|
|
8
8
|
skip_before_filter :set_default_response_format, :only => :report
|
9
9
|
|
@@ -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.full_path,
|
27
|
+
feed: repository.docker? ? repository.docker_feed_url(true) : repository.full_path,
|
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],
|
@@ -20,13 +20,13 @@ module Actions
|
|
20
20
|
fail _("Action not allowed for the default capsule.") if capsule_content.default_capsule?
|
21
21
|
|
22
22
|
need_updates = repos_needing_updates(capsule_content, environment, content_view)
|
23
|
-
need_updates.each do |repo|
|
24
|
-
plan_action(Pulp::Repository::Refresh, repo, capsule_id: capsule_content.capsule.id)
|
25
|
-
end
|
26
|
-
|
27
23
|
repository_ids = get_repository_ids(capsule_content, environment, content_view, repository)
|
28
24
|
unless repository_ids.blank?
|
29
25
|
sequence do
|
26
|
+
need_updates.each do |repo|
|
27
|
+
plan_action(Pulp::Repository::Refresh, repo, capsule_id: capsule_content.capsule.id)
|
28
|
+
end
|
29
|
+
|
30
30
|
plan_action(ConfigureCapsule, capsule_content, environment, content_view)
|
31
31
|
|
32
32
|
smart_proxy = SmartProxy.where(:content_host_id => capsule_content.consumer.id).first
|
@@ -108,7 +108,7 @@ module Actions
|
|
108
108
|
# given a composite version, and a list of new components, calculate the list of all components for the new version
|
109
109
|
def calculate_components(old_version, new_components)
|
110
110
|
old_components = old_version.components.select do |component|
|
111
|
-
!
|
111
|
+
!new_components.map(&:content_view_id).include?(component.content_view_id)
|
112
112
|
end
|
113
113
|
old_components + new_components
|
114
114
|
end
|
@@ -46,15 +46,17 @@ module Actions
|
|
46
46
|
|
47
47
|
concurrence do
|
48
48
|
plan_action(::Actions::Pulp::Repos::Update, repository.product) if repository.product.sync_plan
|
49
|
-
plan_self(:repository_id => repository.id
|
49
|
+
plan_self(:repository_id => repository.id, :clone => clone)
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
54
|
def run
|
55
55
|
::User.current = ::User.anonymous_api_admin
|
56
|
-
|
57
|
-
|
56
|
+
unless input[:clone]
|
57
|
+
repository = ::Katello::Repository.find(input[:repository_id])
|
58
|
+
ForemanTasks.async_task(Katello::Repository::MetadataGenerate, repository)
|
59
|
+
end
|
58
60
|
ensure
|
59
61
|
::User.current = nil
|
60
62
|
end
|
@@ -28,7 +28,7 @@ module Actions
|
|
28
28
|
output[:pulp_tasks].each do |pulp_task|
|
29
29
|
error_details = pulp_task.try(:[], "result").try(:[], "details").try(:[], "rpm").try(:[], "details").try(:[], "trace")
|
30
30
|
error_message = pulp_task.try(:[], "result").try(:[], "details").try(:[], "rpm").try(:[], "details").try(:[], "message")
|
31
|
-
if error_details.include?("YumDownloadError") && error_message
|
31
|
+
if error_details && error_details.include?("YumDownloadError") && error_message
|
32
32
|
fail _("An error occurred during the sync \n%{error_message}") % {:error_message => error_details}
|
33
33
|
end
|
34
34
|
end
|
@@ -105,9 +105,10 @@ module Katello
|
|
105
105
|
end
|
106
106
|
|
107
107
|
def create(env_id, parameters, activation_key_cp_ids)
|
108
|
+
parameters['installedProducts'] ||= [] #if installed products is nil, candlepin won't attach custom products
|
108
109
|
url = "/candlepin/environments/#{url_encode(env_id)}/consumers/"
|
109
|
-
|
110
110
|
url += "?activation_keys=" + activation_key_cp_ids.join(",") if activation_key_cp_ids.length > 0
|
111
|
+
|
111
112
|
response = self.post(url, parameters.to_json, self.default_headers).body
|
112
113
|
JSON.parse(response).with_indifferent_access
|
113
114
|
end
|
@@ -52,10 +52,10 @@ module Katello
|
|
52
52
|
scope :in_environment, ->(env) { where(:environment_id => env) }
|
53
53
|
|
54
54
|
scoped_search :on => :name, :complete_value => true
|
55
|
-
scoped_search :on => :organization_id, :complete_value => true
|
55
|
+
scoped_search :on => :organization_id, :complete_value => true, :only_explicit => true
|
56
56
|
scoped_search :rename => :environment, :on => :name, :in => :environment, :complete_value => true
|
57
57
|
scoped_search :rename => :content_view, :on => :name, :in => :content_view, :complete_value => true
|
58
|
-
scoped_search :on => :content_view_id, :complete_value => true
|
58
|
+
scoped_search :on => :content_view_id, :complete_value => true, :only_explicit => true
|
59
59
|
scoped_search :on => :description, :complete_value => true
|
60
60
|
|
61
61
|
def environment_exists
|
@@ -24,7 +24,7 @@ module Katello
|
|
24
24
|
ids = [ids] unless ids.is_a?(Array)
|
25
25
|
ids.map!(&:to_s)
|
26
26
|
id_integers = ids.map { |string| Integer(string) rescue -1 }
|
27
|
-
where("#{self.table_name}.id
|
27
|
+
where("#{self.table_name}.id in (?) or #{self.table_name}.uuid in (?)", id_integers, ids)
|
28
28
|
end
|
29
29
|
|
30
30
|
def in_repositories(repos)
|
@@ -63,7 +63,7 @@ module Katello
|
|
63
63
|
scope :non_composite, -> { where(:composite => [nil, false]) }
|
64
64
|
|
65
65
|
scoped_search :on => :name, :complete_value => true
|
66
|
-
scoped_search :on => :organization_id, :complete_value => true
|
66
|
+
scoped_search :on => :organization_id, :complete_value => true, :only_explicit => true
|
67
67
|
scoped_search :on => :composite, :complete_value => {true: true, false: false}
|
68
68
|
|
69
69
|
def self.in_environment(env)
|
@@ -42,7 +42,7 @@ module Katello
|
|
42
42
|
scope :default_view, -> { joins(:content_view).where("#{Katello::ContentView.table_name}.default" => true) }
|
43
43
|
scope :non_default_view, -> { joins(:content_view).where("#{Katello::ContentView.table_name}.default" => false) }
|
44
44
|
|
45
|
-
scoped_search :on => :content_view_id
|
45
|
+
scoped_search :on => :content_view_id, :only_explicit => true
|
46
46
|
scoped_search :on => :major, :rename => :version, :complete_value => true, :ext_method => :find_by_version
|
47
47
|
scoped_search :in => :repositories, :on => :name, :rename => :repository, :complete_value => true
|
48
48
|
|
@@ -256,6 +256,10 @@ module Katello
|
|
256
256
|
PackageGroup.in_repositories(archived_repos).uniq
|
257
257
|
end
|
258
258
|
|
259
|
+
def package_group_count
|
260
|
+
package_groups.count
|
261
|
+
end
|
262
|
+
|
259
263
|
def check_ready_to_promote!(to_env)
|
260
264
|
fail _("Default content view versions cannot be promoted") if default?
|
261
265
|
content_view.check_composite_action_allowed!(to_env)
|
@@ -20,7 +20,7 @@ module Katello
|
|
20
20
|
has_many :cves, :class_name => "Katello::ErratumCve", :dependent => :destroy, :inverse_of => :erratum
|
21
21
|
has_many :packages, :class_name => "Katello::ErratumPackage", :dependent => :destroy, :inverse_of => :erratum
|
22
22
|
|
23
|
-
scoped_search :on => :errata_id, :rename => :id, :complete_value => true
|
23
|
+
scoped_search :on => :errata_id, :rename => :id, :complete_value => true, :only_explicit => true
|
24
24
|
scoped_search :on => :title, :only_explicit => true
|
25
25
|
scoped_search :on => :severity, :complete_value => true
|
26
26
|
scoped_search :on => :errata_type, :rename => :type, :complete_value => true
|
@@ -58,7 +58,7 @@ module Katello
|
|
58
58
|
ids = [ids] unless ids.is_a?(Array)
|
59
59
|
ids.map!(&:to_s)
|
60
60
|
id_integers = ids.map { |string| Integer(string) rescue -1 }
|
61
|
-
where("#{self.table_name}.id
|
61
|
+
where("#{self.table_name}.id in (?) or #{self.table_name}.uuid in (?) or #{self.table_name}.errata_id in (?)", id_integers, ids, ids)
|
62
62
|
end
|
63
63
|
|
64
64
|
def hosts_applicable
|
@@ -124,7 +124,7 @@ module Katello
|
|
124
124
|
def create_activation_key_associations
|
125
125
|
keys = Resources::Candlepin::ActivationKey.get(nil, "?include=id&include=pools.pool.id")
|
126
126
|
activation_key_ids = keys.collect do |key|
|
127
|
-
key['id'] if key['pools'].any? { |pool| pool['pool']['id'] == cp_id }
|
127
|
+
key['id'] if key['pools'].present? && key['pools'].any? { |pool| pool['pool']['id'] == cp_id }
|
128
128
|
end
|
129
129
|
related_keys = ::Katello::ActivationKey.where(:cp_id => activation_key_ids.compact)
|
130
130
|
related_keys.each do |key|
|
@@ -21,7 +21,7 @@ module Katello
|
|
21
21
|
validates_with Validators::GpgKeyContentValidator, :attributes => :content, :if => proc { SETTINGS[:katello][:gpg_strict_validation] }
|
22
22
|
|
23
23
|
scoped_search :on => :name, :complete_value => true
|
24
|
-
scoped_search :on => :organization_id, :complete_value => true
|
24
|
+
scoped_search :on => :organization_id, :complete_value => true, :only_explicit => true
|
25
25
|
|
26
26
|
def as_json(options = {})
|
27
27
|
options ||= {}
|
@@ -28,7 +28,7 @@ module Katello
|
|
28
28
|
validate :max_hosts_not_exceeded, :on => :create
|
29
29
|
|
30
30
|
scoped_search :on => :name, :complete_value => true
|
31
|
-
scoped_search :on => :organization_id, :complete_value => true
|
31
|
+
scoped_search :on => :organization_id, :complete_value => true, :only_explicit => true
|
32
32
|
scoped_search :in => :hosts, :complete_value => false
|
33
33
|
|
34
34
|
def max_hosts_check
|
@@ -77,7 +77,7 @@ module Katello
|
|
77
77
|
ERROR_CLASS_NAME = "Environment"
|
78
78
|
|
79
79
|
scoped_search :on => :name, :complete_value => true
|
80
|
-
scoped_search :on => :organization_id, :complete_value => true
|
80
|
+
scoped_search :on => :organization_id, :complete_value => true, :only_explicit => true
|
81
81
|
|
82
82
|
def library?
|
83
83
|
self.library
|
data/app/models/katello/pool.rb
CHANGED
@@ -16,7 +16,7 @@ module Katello
|
|
16
16
|
include Glue::Candlepin::Pool
|
17
17
|
include Glue::Candlepin::CandlepinObject
|
18
18
|
|
19
|
-
scoped_search :on => :cp_id, :complete_value => true, :rename => :id
|
19
|
+
scoped_search :on => :cp_id, :complete_value => true, :rename => :id, :only_explicit => true
|
20
20
|
scoped_search :on => :quantity, :complete_value => true
|
21
21
|
scoped_search :on => :start_date, :complete_value => true, :rename => :starts
|
22
22
|
scoped_search :on => :end_date, :complete_value => true, :rename => :expires
|
@@ -29,7 +29,7 @@ module Katello
|
|
29
29
|
validates_with Validators::ProductUniqueAttributeValidator, :attributes => :label
|
30
30
|
|
31
31
|
scoped_search :on => :name, :complete_value => true
|
32
|
-
scoped_search :on => :organization_id, :complete_value => true
|
32
|
+
scoped_search :on => :organization_id, :complete_value => true, :only_explicit => true
|
33
33
|
scoped_search :on => :label, :complete_value => true
|
34
34
|
scoped_search :on => :description
|
35
35
|
scoped_search :in => :provider, :on => :provider_type, :rename => :redhat,
|
@@ -26,7 +26,7 @@ module Katello
|
|
26
26
|
validates_with Validators::KatelloNameFormatValidator, :attributes => :name
|
27
27
|
|
28
28
|
scoped_search :on => :name, :complete_value => true
|
29
|
-
scoped_search :on => :organization_id, :complete_value => true
|
29
|
+
scoped_search :on => :organization_id, :complete_value => true, :only_explicit => true
|
30
30
|
scoped_search :on => :interval, :complete_value => true
|
31
31
|
scoped_search :on => :enabled, :complete_value => true
|
32
32
|
|
@@ -35,7 +35,7 @@ echo "updating system time"
|
|
35
35
|
/usr/sbin/ntpdate -sub <%= @host.params['ntp-server'] || '0.fedora.pool.ntp.org' %>
|
36
36
|
/usr/sbin/hwclock --systohc
|
37
37
|
|
38
|
-
<% if @host.
|
38
|
+
<% if @host.info['parameters']['realm'] && @host.realm && @host.realm.realm_type == 'FreeIPA' -%>
|
39
39
|
<%= snippet "freeipa_register" %>
|
40
40
|
<% end -%>
|
41
41
|
|
@@ -104,7 +104,7 @@ echo "updating system time"
|
|
104
104
|
|
105
105
|
<%= snippet "subscription_manager_registration" %>
|
106
106
|
|
107
|
-
<% if @host.
|
107
|
+
<% if @host.info['parameters']['realm'] && @host.realm && @host.realm.realm_type == 'FreeIPA' -%>
|
108
108
|
<%= snippet "freeipa_register" %>
|
109
109
|
<% end -%>
|
110
110
|
|
@@ -29,7 +29,7 @@ write_files:
|
|
29
29
|
<%= indent 4 do
|
30
30
|
snippet 'subscription_manager_registration'
|
31
31
|
end %>
|
32
|
-
<% if @host.
|
32
|
+
<% if @host.info['parameters']['realm'] && @host.realm && @host.realm.realm_type == 'FreeIPA' -%>
|
33
33
|
<%= indent 4 do
|
34
34
|
snippet 'freeipa_register'
|
35
35
|
end %>
|
@@ -9,6 +9,7 @@ attributes :content_view_id
|
|
9
9
|
attributes :default
|
10
10
|
attributes :description
|
11
11
|
attributes :package_count
|
12
|
+
attributes :package_group_count
|
12
13
|
attributes :puppet_module_count
|
13
14
|
attributes :docker_manifest_count
|
14
15
|
attributes :docker_tag_count
|
@@ -61,7 +62,7 @@ child :environments => :environments do
|
|
61
62
|
end
|
62
63
|
|
63
64
|
child :archived_repos => :repositories do
|
64
|
-
attributes :id, :name, :label
|
65
|
+
attributes :id, :name, :label, :content_type
|
65
66
|
end
|
66
67
|
|
67
68
|
child :last_event => :last_event do
|
@@ -37,6 +37,9 @@ class MigrateContentHosts < ActiveRecord::Migration
|
|
37
37
|
class Repository < ActiveRecord::Base
|
38
38
|
self.table_name = "katello_repositories"
|
39
39
|
|
40
|
+
has_many :content_facet_repositories, :class_name => "MigrateContentHosts::ContentFacetRepository", :dependent => :destroy
|
41
|
+
has_many :content_facets, :through => :content_facet_repositories
|
42
|
+
|
40
43
|
has_many :system_repositories, :class_name => "MigrateContentHosts::SystemRepository", :dependent => :destroy
|
41
44
|
has_many :systems, :through => :system_repositories
|
42
45
|
end
|
@@ -131,8 +134,8 @@ class MigrateContentHosts < ActiveRecord::Migration
|
|
131
134
|
belongs_to :content_view, :inverse_of => :content_facets, :class_name => "MigrateContentHosts::ContentView"
|
132
135
|
belongs_to :lifecycle_environment, :inverse_of => :content_facets, :class_name => "MigrateContentHosts::KTEnvironment"
|
133
136
|
|
134
|
-
has_many :
|
135
|
-
has_many :content_facet_repositories, :class_name => "MigrateContentHosts::
|
137
|
+
has_many :content_facet_repositories, :class_name => "MigrateContentHosts::ContentFacetRepository", :dependent => :destroy, :inverse_of => :content_facets
|
138
|
+
has_many :bound_repositories, :through => :content_facet_repositories, :class_name => "MigrateContentHosts::Repository", :source => :content_facets
|
136
139
|
has_many :applicable_errata, :through => :content_facet_errata, :class_name => "MigrateContentHosts::Erratum", :source => :erratum
|
137
140
|
has_many :content_facet_errata, :class_name => "MigrateContentHosts::ContentFacetErratum", :dependent => :destroy, :inverse_of => :content_facet
|
138
141
|
end
|
@@ -190,6 +193,7 @@ class MigrateContentHosts < ActiveRecord::Migration
|
|
190
193
|
|
191
194
|
def get_systems_with_facts(systems)
|
192
195
|
systems_to_remove = []
|
196
|
+
systems = systems.to_a
|
193
197
|
|
194
198
|
systems.each do |system|
|
195
199
|
begin
|
@@ -49,12 +49,6 @@ angular.module('Bastion.content-hosts').controller('ContentHostErrataController'
|
|
49
49
|
$scope.errataOptions = [{name: "Current Environment", label: 'current'}, {name: 'foo', label: 'bar'}];
|
50
50
|
|
51
51
|
$scope.detailsTable.initialLoad = false;
|
52
|
-
$scope.host.$promise.then(function() {
|
53
|
-
if ($scope.host.content && $scope.host.id) {
|
54
|
-
errataNutupane.setParams({id: $scope.host.id});
|
55
|
-
errataNutupane.load();
|
56
|
-
}
|
57
|
-
});
|
58
52
|
|
59
53
|
$scope.setupErrataOptions = function (host) {
|
60
54
|
var libraryString = translate("Library Synced Content"),
|
@@ -62,18 +56,18 @@ angular.module('Bastion.content-hosts').controller('ContentHostErrataController'
|
|
62
56
|
previousEnv;
|
63
57
|
|
64
58
|
if (host.hasContent()) {
|
65
|
-
currentEnv = translate("Current Environment (%e/%cv)").replace("%e", host.
|
59
|
+
currentEnv = translate("Current Environment (%e/%cv)").replace("%e", host.content_facet_attributes.lifecycle_environment.name).replace("%cv", host.content_facet_attributes.content_view_name);
|
66
60
|
$scope.errataOptions = [{name: currentEnv, label: 'current', order: 3}];
|
67
61
|
|
68
|
-
if (!host.
|
69
|
-
Environment.get({id: host.
|
70
|
-
previousEnv = translate("Previous Environment (%e/%cv)").replace('%e', env.prior.name).replace("%cv", host.content_view_name);
|
62
|
+
if (!host.content_facet_attributes['lifecycle_environment_library?']) {
|
63
|
+
Environment.get({id: host.content_facet_attributes.lifecycle_environment.id}).$promise.then(function (env) {
|
64
|
+
previousEnv = translate("Previous Environment (%e/%cv)").replace('%e', env.prior.name).replace("%cv", host.content_facet_attributes.content_view_name);
|
71
65
|
$scope.errataOptions.push({name: previousEnv,
|
72
|
-
label: 'prior', order: 2, 'content_view_id': host.
|
66
|
+
label: 'prior', order: 2, 'content_view_id': host.content_facet_attributes.content_view_id, 'environment_id': env.prior.id});
|
73
67
|
|
74
68
|
});
|
75
69
|
}
|
76
|
-
if (!host.
|
70
|
+
if (!host.content_facet_attributes['content_view_default?']) {
|
77
71
|
Organization.get({id: host.organization_id}).$promise.then(function (org) {
|
78
72
|
$scope.errataOptions.push({name: libraryString, label: 'library', order: 1,
|
79
73
|
'content_view_id': org.default_content_view_id, 'environment_id': org.library_id});
|
@@ -82,7 +76,13 @@ angular.module('Bastion.content-hosts').controller('ContentHostErrataController'
|
|
82
76
|
}
|
83
77
|
};
|
84
78
|
|
85
|
-
$scope.host.$promise.then(
|
79
|
+
$scope.host.$promise.then(function() {
|
80
|
+
$scope.setupErrataOptions($scope.host);
|
81
|
+
if ($scope.host.content_facet_attributes && $scope.host.id) {
|
82
|
+
errataNutupane.setParams({id: $scope.host.id});
|
83
|
+
errataNutupane.load();
|
84
|
+
}
|
85
|
+
});
|
86
86
|
|
87
87
|
$scope.refreshErrata = function (selected) {
|
88
88
|
var option, errataParams;
|
@@ -37,7 +37,7 @@ angular.module('Bastion.content-hosts').controller('ContentHostDetailsInfoContro
|
|
37
37
|
$scope.host.$promise.then(function (host) {
|
38
38
|
$scope.hostFactsAsObject = doubleColonNotationToObject(host.facts);
|
39
39
|
if (host.hasContent()) {
|
40
|
-
$scope.originalEnvironment = host.
|
40
|
+
$scope.originalEnvironment = host.content_facet_attributes.lifecycle_environment;
|
41
41
|
}
|
42
42
|
});
|
43
43
|
|
@@ -51,7 +51,7 @@ angular.module('Bastion.content-hosts').controller('ContentHostDetailsInfoContro
|
|
51
51
|
|
52
52
|
$scope.environments = Organization.readableEnvironments({id: CurrentOrganization});
|
53
53
|
|
54
|
-
$scope.$watch('host.
|
54
|
+
$scope.$watch('host.content_facet_attributes.lifecycle_environment', function (environment) {
|
55
55
|
if (environment && $scope.originalEnvironment) {
|
56
56
|
if (environment.id !== $scope.originalEnvironment.id) {
|
57
57
|
$scope.editContentView = true;
|
@@ -67,7 +67,7 @@ angular.module('Bastion.content-hosts').controller('ContentHostDetailsInfoContro
|
|
67
67
|
$scope.cancelContentViewUpdate = function () {
|
68
68
|
if ($scope.editContentView) {
|
69
69
|
$scope.editContentView = false;
|
70
|
-
$scope.host.
|
70
|
+
$scope.host.content_facet_attributes['lifecycle_environment'] = $scope.originalEnvironment;
|
71
71
|
$scope.disableEnvironmentSelection = false;
|
72
72
|
}
|
73
73
|
};
|
@@ -76,7 +76,7 @@ angular.module('Bastion.content-hosts').controller('ContentHostDetailsInfoContro
|
|
76
76
|
$scope.editContentView = false;
|
77
77
|
|
78
78
|
$scope.saveContentFacet(host).then(function (response) {
|
79
|
-
$scope.originalEnvironment = response.
|
79
|
+
$scope.originalEnvironment = response.content_facet_attributes.lifecycle_environment;
|
80
80
|
});
|
81
81
|
$scope.disableEnvironmentSelection = false;
|
82
82
|
};
|
@@ -84,7 +84,7 @@ angular.module('Bastion.content-hosts').controller('ContentHostDetailsInfoContro
|
|
84
84
|
$scope.releaseVersions = function () {
|
85
85
|
var deferred = $q.defer();
|
86
86
|
|
87
|
-
ContentHost.releaseVersions({ id: $scope.host.
|
87
|
+
ContentHost.releaseVersions({ id: $scope.host.subscription_facet_attributes.uuid }, function (response) {
|
88
88
|
if (response.total === 0) {
|
89
89
|
$scope.showVersionAlert = true;
|
90
90
|
}
|
@@ -95,19 +95,19 @@ angular.module('Bastion.content-hosts').controller('ContentHostDetailsInfoContro
|
|
95
95
|
};
|
96
96
|
|
97
97
|
$scope.clearReleaseVersion = function () {
|
98
|
-
$scope.host.
|
98
|
+
$scope.host.subscription_facet_attributes['release_version'] = '';
|
99
99
|
$scope.saveSubscriptionFacet($scope.host);
|
100
100
|
};
|
101
101
|
|
102
102
|
$scope.clearServiceLevel = function () {
|
103
|
-
$scope.host.
|
103
|
+
$scope.host.subscription_facet_attributes['service_level'] = '';
|
104
104
|
$scope.saveSubscriptionFacet($scope.host);
|
105
105
|
};
|
106
106
|
|
107
107
|
$scope.contentViews = function () {
|
108
108
|
var deferred = $q.defer();
|
109
109
|
|
110
|
-
ContentView.queryUnpaged({ 'environment_id': $scope.host.
|
110
|
+
ContentView.queryUnpaged({ 'environment_id': $scope.host.content_facet_attributes.lifecycle_environment.id}, function (response) {
|
111
111
|
deferred.resolve(response.results);
|
112
112
|
$scope.contentViews = response.results;
|
113
113
|
});
|
@@ -123,7 +123,7 @@ angular.module('Bastion.content-hosts').controller('ContentHostDetailsInfoContro
|
|
123
123
|
|
124
124
|
$scope.virtualGuestIds = function (host) {
|
125
125
|
var ids = [];
|
126
|
-
angular.forEach(host.
|
126
|
+
angular.forEach(host.subscription_facet_attributes['virtual_guests'], function (guest) {
|
127
127
|
ids.push('name = %s'.replace('%s', guest.name));
|
128
128
|
});
|
129
129
|
|
@@ -36,26 +36,28 @@ angular.module('Bastion.content-hosts').controller('ContentHostDetailsController
|
|
36
36
|
// @TODO begin hack for content and subscript facets
|
37
37
|
// see http://projects.theforeman.org/issues/13763
|
38
38
|
$scope.saveContentFacet = function (host) {
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
'
|
39
|
+
var newHost = {id: host.id};
|
40
|
+
newHost['content_facet_attributes'] = {
|
41
|
+
id: host.content_facet_attributes.id,
|
42
|
+
'content_view_id': host.content_facet_attributes.content_view.id,
|
43
|
+
'lifecycle_environment_id': host.content_facet_attributes.lifecycle_environment.id
|
43
44
|
};
|
44
|
-
return $scope.save(
|
45
|
+
return $scope.save(newHost, true);
|
45
46
|
};
|
46
47
|
|
47
48
|
$scope.saveSubscriptionFacet = function (host) {
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
'
|
49
|
+
var newHost = {id: host.id};
|
50
|
+
newHost['subscription_facet_attributes'] = {
|
51
|
+
id: host.subscription_facet_attributes.id,
|
52
|
+
autoheal: host.subscription_facet_attributes.autoheal,
|
53
|
+
'service_level': host.subscription_facet_attributes.service_level,
|
54
|
+
'release_version': host.subscription_facet_attributes.release_version
|
53
55
|
};
|
54
|
-
return $scope.save(
|
56
|
+
return $scope.save(newHost, true);
|
55
57
|
};
|
56
58
|
// @TODO end hack
|
57
59
|
|
58
|
-
$scope.save = function (host) {
|
60
|
+
$scope.save = function (host, saveFacets) {
|
59
61
|
var deferred = $q.defer();
|
60
62
|
|
61
63
|
// @TODO begin hack needed to use the foreman host API, see the following bugs:
|
@@ -68,11 +70,14 @@ angular.module('Bastion.content-hosts').controller('ContentHostDetailsController
|
|
68
70
|
var whitelistedHostObject = {},
|
69
71
|
whitelist = [
|
70
72
|
"name",
|
71
|
-
"description"
|
72
|
-
"content_facet_attributes",
|
73
|
-
"subscription_facet_attributes"
|
73
|
+
"description"
|
74
74
|
];
|
75
75
|
|
76
|
+
if (saveFacets) {
|
77
|
+
whitelist.push("content_facet_attributes");
|
78
|
+
whitelist.push("subscription_facet_attributes");
|
79
|
+
}
|
80
|
+
|
76
81
|
angular.forEach(whitelist, function (key) {
|
77
82
|
whitelistedHostObject[key] = host[key];
|
78
83
|
});
|
@@ -20,7 +20,7 @@
|
|
20
20
|
|
21
21
|
<div class="detail">
|
22
22
|
<span class="info-label" translate>UUID</span>
|
23
|
-
<span class="info-value">{{ host.
|
23
|
+
<span class="info-value">{{ host.subscription_facet_attributes.uuid }}</span>
|
24
24
|
</div>
|
25
25
|
|
26
26
|
<div class="detail">
|
@@ -40,31 +40,31 @@
|
|
40
40
|
<div class="detail"
|
41
41
|
bst-feature-flag="remote_actions">
|
42
42
|
<span class="info-label" translate>Katello Agent</span>
|
43
|
-
<span class="info-value" ng-show="host.
|
43
|
+
<span class="info-value" ng-show="host.content_facet_attributes.katello_agent_installed">
|
44
44
|
<span class="fa fa-circle green"></span>
|
45
45
|
<span translate>Installed</span>
|
46
46
|
</span>
|
47
|
-
<span class="info-value" ng-hide="host.
|
47
|
+
<span class="info-value" ng-hide="host.content_facet_attributes.katello_agent_installed">
|
48
48
|
<span class="fa fa-circle yellow"></span>
|
49
49
|
<span translate>Not installed</span>
|
50
50
|
</span>
|
51
51
|
</div>
|
52
52
|
|
53
|
-
<div ng-show="host.
|
53
|
+
<div ng-show="host.subscription_facet_attributes.virtual_guests" class="detail">
|
54
54
|
<span class="info-label" translate>Virtual Guests</span>
|
55
55
|
<div class="info-value">
|
56
56
|
<a ng-click="reloadSearch(virtualGuestIds(host))"
|
57
|
-
translate translate-n="host.
|
58
|
-
translate-plural="{{ host.
|
57
|
+
translate translate-n="host.subscription_facet_attributes.virtual_guests.length"
|
58
|
+
translate-plural="{{ host.subscription_facet_attributes.virtual_guests.length }} Content Hosts">
|
59
59
|
1 Content Host
|
60
60
|
</a>
|
61
61
|
</div>
|
62
62
|
</div>
|
63
63
|
|
64
|
-
<div ng-show="host.
|
64
|
+
<div ng-show="host.subscription_facet_attributes.virtual_host" class="detail">
|
65
65
|
<span class="info-label" translate>Virtual Host</span>
|
66
66
|
<div class="info-value">
|
67
|
-
<a ui-sref="content-hosts.details.info({hostId: host.
|
67
|
+
<a ui-sref="content-hosts.details.info({hostId: host.subscription_facet_attributes.virtual_host.id })">{{ host.subscription_facet_attributes.virtual_host.name }}</a>
|
68
68
|
</div>
|
69
69
|
</div>
|
70
70
|
|
@@ -82,11 +82,11 @@
|
|
82
82
|
</span>
|
83
83
|
</div>
|
84
84
|
|
85
|
-
<div ng-show=" host.
|
85
|
+
<div ng-show=" host.subscription_facet_attributes.compliance_reasons.length > 0" class="detail">
|
86
86
|
<span class="info-label" translate>Details</span>
|
87
87
|
<div class="info-value">
|
88
88
|
<ul class="compliance-reasons">
|
89
|
-
<li ng-repeat="reason in host.
|
89
|
+
<li ng-repeat="reason in host.subscription_facet_attributes.compliance_reasons">{{ reason }}</li>
|
90
90
|
</ul>
|
91
91
|
</div>
|
92
92
|
</div>
|
@@ -94,7 +94,7 @@
|
|
94
94
|
<div class="detail">
|
95
95
|
<span class="info-label" translate>Auto-Attach</span>
|
96
96
|
<span class="info-value"
|
97
|
-
bst-edit-checkbox="host.
|
97
|
+
bst-edit-checkbox="host.subscription_facet_attributes.autoheal"
|
98
98
|
readonly="denied('edit_hosts', host)"
|
99
99
|
formatter="booleanToYesNo"
|
100
100
|
on-save="saveSubscriptionFacet(host)">
|
@@ -103,9 +103,9 @@
|
|
103
103
|
<div class="detail">
|
104
104
|
<span class="info-label" translate>Service Level</span>
|
105
105
|
<span class="info-value"
|
106
|
-
bst-edit-select="host.
|
106
|
+
bst-edit-select="host.subscription_facet_attributes.service_level"
|
107
107
|
readonly="denied('edit_hosts', host)"
|
108
|
-
selector="host.
|
108
|
+
selector="host.subscription_facet_attributes.service_level"
|
109
109
|
options="serviceLevels()"
|
110
110
|
options-format="option for option in options"
|
111
111
|
deletable="true"
|
@@ -146,12 +146,12 @@
|
|
146
146
|
<section ng-show="host.hasContent()">
|
147
147
|
<h4 translate>Installed Products</h4>
|
148
148
|
|
149
|
-
<p translate ng-show="!host.
|
149
|
+
<p translate ng-show="!host.subscription_facet_attributes.installed_products || host.subscription_facet_attributes.installed_products.length == 0">
|
150
150
|
You do not have any Installed Products
|
151
151
|
</p>
|
152
152
|
|
153
|
-
<div ng-show="host.
|
154
|
-
<div ng-repeat="product in host.
|
153
|
+
<div ng-show="host.subscription_facet_attributes.installed_products.length > 0">
|
154
|
+
<div ng-repeat="product in host.subscription_facet_attributes.installed_products" class="detail">
|
155
155
|
<span class="info-label" translate>Product</span>
|
156
156
|
<span class="info-value">{{ product.productName }} {{ product.version }}</span>
|
157
157
|
</div>
|
@@ -169,9 +169,9 @@
|
|
169
169
|
<span class="info-value">
|
170
170
|
<a ui-sref="content-hosts.details.errata.index({getSearch: 'type=security'})">
|
171
171
|
<i class="fa fa-warning inline-icon"
|
172
|
-
ng-class="{black: host.
|
172
|
+
ng-class="{black: host.content_facet_attributes.errata_counts.security === 0, red: host.content_facet_attributes.errata_counts.security > 0}"
|
173
173
|
title="{{ 'Security' | translate }}"></i>
|
174
|
-
{{ host.
|
174
|
+
{{ host.content_facet_attributes.errata_counts.security || 0 }}
|
175
175
|
</a>
|
176
176
|
</span>
|
177
177
|
</div>
|
@@ -181,9 +181,9 @@
|
|
181
181
|
<span class="info-value">
|
182
182
|
<a ui-sref="content-hosts.details.errata.index({getSearch: 'type=bugfix'})">
|
183
183
|
<i class="fa fa-bug inline-icon"
|
184
|
-
ng-class="{black: host.
|
184
|
+
ng-class="{black: host.content_facet_attributes.errata_counts.bugfix === 0, yellow: host.content_facet_attributes.errata_counts.bugfix > 0}"
|
185
185
|
title="{{ 'Bug Fix' | translate }}"></i>
|
186
|
-
{{ host.
|
186
|
+
{{ host.content_facet_attributes.errata_counts.bugfix || 0 }}
|
187
187
|
</a>
|
188
188
|
</span>
|
189
189
|
</div>
|
@@ -193,9 +193,9 @@
|
|
193
193
|
<span class="info-value">
|
194
194
|
<a ui-sref="content-hosts.details.errata.index({getSearch: 'type=enhancement'})">
|
195
195
|
<i class="fa fa-plus-square inline-icon"
|
196
|
-
ng-class="{black: host.
|
196
|
+
ng-class="{black: host.content_facet_attributes.errata_counts.enhancement === 0, yellow: host.content_facet_attributes.errata_counts.enhancement > 0}"
|
197
197
|
title="{{ 'Enhancement' | translate }}"></i>
|
198
|
-
{{ host.
|
198
|
+
{{ host.content_facet_attributes.errata_counts.enhancement || 0 }}
|
199
199
|
</a>
|
200
200
|
</span>
|
201
201
|
</div>
|
@@ -208,9 +208,9 @@
|
|
208
208
|
<div class="detail">
|
209
209
|
<span class="info-label" translate>Release Version</span>
|
210
210
|
<span class="info-value"
|
211
|
-
bst-edit-select="host.
|
211
|
+
bst-edit-select="host.subscription_facet_attributes.release_version"
|
212
212
|
readonly="denied('edit_hosts', host)"
|
213
|
-
selector="host.
|
213
|
+
selector="host.subscription_facet_attributes.release_version"
|
214
214
|
options="releaseVersions()"
|
215
215
|
options-format="option for option in options"
|
216
216
|
deletable="true"
|
@@ -220,7 +220,7 @@
|
|
220
220
|
</span>
|
221
221
|
<div alert type="'info'" ng-show="showVersionAlert">
|
222
222
|
<p translate>
|
223
|
-
No alternate release version choices are available. The available releases are based upon what is available in "{{ host.
|
223
|
+
No alternate release version choices are available. The available releases are based upon what is available in "{{ host.content_facet_attributes.content_view.name }}", the selected <a href="/content_views">content view</a> this content host is attached to for the given <a href="/lifecycle_environments">lifecycle environment</a>, "{{ host.content_facet_attributes.lifecycle_environment.name }}".
|
224
224
|
</p>
|
225
225
|
</div>
|
226
226
|
</div>
|
@@ -228,9 +228,9 @@
|
|
228
228
|
<div class="detail" bst-feature-flag="lifecycle_environments">
|
229
229
|
<span class="info-label" translate>Content View</span>
|
230
230
|
<span class="info-value"
|
231
|
-
bst-edit-select="host.
|
231
|
+
bst-edit-select="host.content_facet_attributes.content_view.name"
|
232
232
|
readonly="denied('edit_hosts', host)"
|
233
|
-
selector="host.
|
233
|
+
selector="host.content_facet_attributes.content_view.id"
|
234
234
|
options="contentViews()"
|
235
235
|
on-cancel="cancelContentViewUpdate()"
|
236
236
|
on-save="saveContentView(host)"
|
@@ -253,7 +253,7 @@
|
|
253
253
|
</div>
|
254
254
|
<span class="info-label" translate>Environment</span>
|
255
255
|
<span path-selector="environments"
|
256
|
-
ng-model="host.
|
256
|
+
ng-model="host.content_facet_attributes.lifecycle_environment"
|
257
257
|
mode="singleSelect"
|
258
258
|
disabled="denied('edit_hosts', host)"
|
259
259
|
disable-trigger="disableEnvironmentSelection">
|
@@ -268,26 +268,26 @@
|
|
268
268
|
|
269
269
|
<div class="detail">
|
270
270
|
<span class="info-label" translate>Registered</span>
|
271
|
-
<span class="info-value">{{
|
271
|
+
<span class="info-value">{{ host.created | date:'short' }}</span>
|
272
272
|
</div>
|
273
273
|
|
274
274
|
<div class="detail">
|
275
275
|
<span class="info-label" translate> Registered By</span>
|
276
276
|
<span class="info-value"
|
277
277
|
translate
|
278
|
-
ng-show="host.
|
278
|
+
ng-show="host.subscription_facet_attributes.activation_keys.length == 0">
|
279
279
|
{{ contentHost.registered_by }}
|
280
280
|
</span>
|
281
281
|
<span class="info-value"
|
282
|
-
ng-show="host.
|
282
|
+
ng-show="host.subscription_facet_attributes.activation_keys.length > 0"
|
283
283
|
translate
|
284
|
-
translate-n="host.
|
284
|
+
translate-n="host.subscription_facet_attributes.activation_keys.length"
|
285
285
|
translate-plural="Activation Keys">
|
286
286
|
Activation Key
|
287
287
|
</span>
|
288
288
|
<span class="info-value">
|
289
|
-
<ul ng-show="host.
|
290
|
-
<li ng-repeat="activation_key in host.
|
289
|
+
<ul ng-show="host.subscription_facet_attributes.activation_keys.length > 0">
|
290
|
+
<li ng-repeat="activation_key in host.subscription_facet_attributes.activation_keys">
|
291
291
|
<span>
|
292
292
|
<a ui-sref="activation-keys.details.info({activationKeyId: activation_key.id})">
|
293
293
|
{{ activation_key.name }}
|
@@ -301,7 +301,7 @@
|
|
301
301
|
|
302
302
|
<div class="detail">
|
303
303
|
<span class="info-label" translate>Last Checkin</span>
|
304
|
-
<span class="info-value">{{ (host.
|
304
|
+
<span class="info-value">{{ (host.subscription_facet_attributes.last_checkin | date:'short') || ("Never checked in" | translate) }}</span>
|
305
305
|
</div>
|
306
306
|
|
307
307
|
<div class="divider"></div>
|
@@ -22,16 +22,16 @@
|
|
22
22
|
<div class="detail">
|
23
23
|
<span class="info-label" translate>Status</span>
|
24
24
|
<span class="info-value">
|
25
|
-
<i class="fa fa-circle" ng-class="contentHostTable.getSubscriptionStatusColor(host.
|
26
|
-
{{ host.
|
25
|
+
<i class="fa fa-circle" ng-class="contentHostTable.getSubscriptionStatusColor(host.subscription_facet_attributes.subscription_status.color_code)"></i>
|
26
|
+
{{ host.subscription_facet_attributes.subscription_status.label }}
|
27
27
|
</span>
|
28
28
|
</div>
|
29
29
|
|
30
|
-
<div ng-show="host.
|
30
|
+
<div ng-show="host.subscription_facet_attributes.compliance_reasons.length > 0" class="detail">
|
31
31
|
<span class="info-label" translate>Details</span>
|
32
32
|
<div class="info-value">
|
33
33
|
<ul class="compliance-reasons">
|
34
|
-
<li ng-repeat="reason in host.
|
34
|
+
<li ng-repeat="reason in host.subscription_facet_attributes.compliance_reasons">{{ reason }}</li>
|
35
35
|
</ul>
|
36
36
|
</div>
|
37
37
|
</div>
|
@@ -39,7 +39,7 @@
|
|
39
39
|
<div class="detail">
|
40
40
|
<span class="info-label" translate>Auto-Attach</span>
|
41
41
|
<span class="info-value"
|
42
|
-
bst-edit-checkbox="host.
|
42
|
+
bst-edit-checkbox="host.subscription_facet_attributes.autoheal"
|
43
43
|
formatter="booleanToYesNo"
|
44
44
|
readonly="denied('edit_hosts', host)"
|
45
45
|
on-save="saveSubscriptionFacet(host)">
|
@@ -48,9 +48,9 @@
|
|
48
48
|
<div class="detail">
|
49
49
|
<span class="info-label" translate>Service Level</span>
|
50
50
|
<span class="info-value"
|
51
|
-
bst-edit-select="host.
|
51
|
+
bst-edit-select="host.subscription_facet_attributes.service_level"
|
52
52
|
readonly="denied('edit_hosts', host)"
|
53
|
-
selector="host.
|
53
|
+
selector="host.subscription_facet_attributes.service_level"
|
54
54
|
options="serviceLevels()"
|
55
55
|
options-format="option for option in options"
|
56
56
|
on-save="saveSubscriptionFacet(host)">
|
@@ -34,14 +34,14 @@
|
|
34
34
|
</td>
|
35
35
|
<td>
|
36
36
|
<a ui-sref="content-hosts.details.errata.index({hostId: host.id})">
|
37
|
-
<span class="aligned-errata-count" errata-counts="host.
|
37
|
+
<span class="aligned-errata-count" errata-counts="host.content_facet_attributes.errata_counts"></span>
|
38
38
|
</a>
|
39
39
|
</td>
|
40
40
|
<td bst-table-cell>{{ host.operatingsystem_name }}</td>
|
41
|
-
<td bst-table-cell>{{ host.
|
42
|
-
<td bst-table-cell>{{ host.
|
43
|
-
<td bst-table-cell>{{ (host.
|
44
|
-
<td bst-table-cell>{{ (host.
|
41
|
+
<td bst-table-cell>{{ host.content_facet_attributes.lifecycle_environment.name }}</td>
|
42
|
+
<td bst-table-cell>{{ host.content_facet_attributes.content_view.name || "" }}</td>
|
43
|
+
<td bst-table-cell>{{ (host.subscription_facet_attributes.registered_at | date:'short') || ("Never registered" | translate) }}</td>
|
44
|
+
<td bst-table-cell>{{ (host.subscription_facet_attributes.last_checkin | date:'short') || ("Never checked in" | translate) }}</td>
|
45
45
|
</tr>
|
46
46
|
</tbody>
|
47
47
|
</table>
|
@@ -13,6 +13,26 @@
|
|
13
13
|
|
14
14
|
$scope.version = ContentViewVersion.get({id: $scope.$stateParams.versionId});
|
15
15
|
|
16
|
+
$scope.hasRepositories = function (version, type) {
|
17
|
+
var found;
|
18
|
+
|
19
|
+
found = _.find(version.repositories, function (repository) {
|
20
|
+
return repository['content_type'] === type;
|
21
|
+
});
|
22
|
+
|
23
|
+
return found;
|
24
|
+
};
|
25
|
+
|
26
|
+
$scope.hasErrata = function (version) {
|
27
|
+
var found = false;
|
28
|
+
|
29
|
+
found = _.find(version['errata_counts'], function (counts) {
|
30
|
+
return counts !== 0;
|
31
|
+
});
|
32
|
+
|
33
|
+
return found;
|
34
|
+
};
|
35
|
+
|
16
36
|
}
|
17
37
|
|
18
38
|
angular
|
@@ -37,43 +37,50 @@
|
|
37
37
|
</a>
|
38
38
|
</li>
|
39
39
|
|
40
|
-
<li ng-class="{active: isState('content-views.details.version.yum')}"
|
40
|
+
<li ng-class="{active: isState('content-views.details.version.yum')}"
|
41
|
+
ng-show="hasRepositories(version, 'yum')">
|
41
42
|
<a ui-sref="content-views.details.version.yum({versionId: version.id})">
|
42
43
|
<span translate>Yum Repositories</span>
|
43
44
|
</a>
|
44
45
|
</li>
|
45
46
|
|
46
|
-
<li ng-class="{active: isState('content-views.details.version.packages')}"
|
47
|
+
<li ng-class="{active: isState('content-views.details.version.packages')}"
|
48
|
+
ng-show="version.package_count !== 0">
|
47
49
|
<a ui-sref="content-views.details.version.packages({versionId: version.id})">
|
48
50
|
<span translate>Packages</span>
|
49
51
|
</a>
|
50
52
|
</li>
|
51
53
|
|
52
|
-
<li ng-class="{active: isState('content-views.details.version.package-groups')}"
|
54
|
+
<li ng-class="{active: isState('content-views.details.version.package-groups')}"
|
55
|
+
ng-show="version.package_group_count !== 0">
|
53
56
|
<a ui-sref="content-views.details.version.package-groups({versionId: version.id})">
|
54
57
|
<span translate>Package Groups</span>
|
55
58
|
</a>
|
56
59
|
</li>
|
57
60
|
|
58
|
-
<li ng-class="{active: isState('content-views.details.version.errata')}"
|
61
|
+
<li ng-class="{active: isState('content-views.details.version.errata')}"
|
62
|
+
ng-show="hasErrata(version)">
|
59
63
|
<a ui-sref="content-views.details.version.errata({versionId: version.id})">
|
60
64
|
<span translate>Errata</span>
|
61
65
|
</a>
|
62
66
|
</li>
|
63
67
|
|
64
|
-
<li ng-class="{active: isState('content-views.details.version.puppet-modules')}"
|
68
|
+
<li ng-class="{active: isState('content-views.details.version.puppet-modules')}"
|
69
|
+
ng-show="version.puppet_module_count !== 0">
|
65
70
|
<a ui-sref="content-views.details.version.puppet-modules({versionId: version.id})">
|
66
71
|
<span translate>Puppet Modules</span>
|
67
72
|
</a>
|
68
73
|
</li>
|
69
74
|
|
70
|
-
<li ng-class="{active: isState('content-views.details.version.docker')}"
|
75
|
+
<li ng-class="{active: isState('content-views.details.version.docker')}"
|
76
|
+
ng-show="version.docker_tag_count !== 0 || version.docker_manifest_count !== 0">
|
71
77
|
<a ui-sref="content-views.details.version.docker({versionId: version.id})">
|
72
78
|
<span translate>Docker Repositories</span>
|
73
79
|
</a>
|
74
80
|
</li>
|
75
81
|
|
76
|
-
<li ng-class="{active: isState('content-views.details.version.ostree-branches')}"
|
82
|
+
<li ng-class="{active: isState('content-views.details.version.ostree-branches')}"
|
83
|
+
ng-show="version.ostree_branch_count !== 0">
|
77
84
|
<a ui-sref="content-views.details.version.ostree-branches({versionId: version.id})">
|
78
85
|
<span translate>OSTree Branches</span>
|
79
86
|
</a>
|
@@ -44,8 +44,8 @@
|
|
44
44
|
{{ host.name}}
|
45
45
|
</a>
|
46
46
|
</td>
|
47
|
-
<td bst-table-cell >{{ host.
|
48
|
-
<td bst-table-cell >{{ host.
|
47
|
+
<td bst-table-cell >{{ host.content_facet_attributes.lifecycle_environment.name}}</td>
|
48
|
+
<td bst-table-cell >{{ host.content_facet_attributes.name}}</td>
|
49
49
|
</tr>
|
50
50
|
|
51
51
|
</tbody>
|
@@ -43,8 +43,8 @@
|
|
43
43
|
{{ host.name}}
|
44
44
|
</a>
|
45
45
|
</td>
|
46
|
-
<td bst-table-cell >{{ host.
|
47
|
-
<td bst-table-cell >{{ host.
|
46
|
+
<td bst-table-cell >{{ host.content_facet_attributes.lifecycle_environment.name}}</td>
|
47
|
+
<td bst-table-cell >{{ host.content_facet_attributes.content_view.name}}</td>
|
48
48
|
</tr>
|
49
49
|
|
50
50
|
</tbody>
|
@@ -15,10 +15,10 @@ angular.module('Bastion.hosts').factory('Host',
|
|
15
15
|
autocomplete: {method: 'GET', isArray: true, params: {id: 'auto_complete_search'}}
|
16
16
|
});
|
17
17
|
resource.prototype.hasContent = function () {
|
18
|
-
return angular.isDefined(this.
|
18
|
+
return angular.isDefined(this.content_facet_attributes) && angular.isDefined(this.content_facet_attributes.uuid);
|
19
19
|
};
|
20
20
|
resource.prototype.hasSubscription = function () {
|
21
|
-
return angular.isDefined(this.
|
21
|
+
return angular.isDefined(this.subscription_facet_attributes) && angular.isDefined(this.subscription_facet_attributes.uuid);
|
22
22
|
};
|
23
23
|
return resource;
|
24
24
|
}]
|
data/lib/katello/engine.rb
CHANGED
@@ -44,7 +44,13 @@ module Katello
|
|
44
44
|
initializer 'katello.configure_assets', :group => :all do
|
45
45
|
def find_assets(args = {})
|
46
46
|
type = args.fetch(:type, nil)
|
47
|
-
|
47
|
+
vendor = args.fetch(:vendor, false)
|
48
|
+
|
49
|
+
if vendor
|
50
|
+
asset_dir = "#{Katello::Engine.root}/vendor/assets/#{type}/"
|
51
|
+
else
|
52
|
+
asset_dir = "#{Katello::Engine.root}/app/assets/#{type}/"
|
53
|
+
end
|
48
54
|
|
49
55
|
asset_paths = Dir[File.join(asset_dir, '**', '*')].reject { |file| File.directory?(file) }
|
50
56
|
asset_paths.each { |file| file.slice!(asset_dir) }
|
@@ -54,6 +60,7 @@ module Katello
|
|
54
60
|
|
55
61
|
javascripts = find_assets(:type => 'javascripts')
|
56
62
|
images = find_assets(:type => 'images')
|
63
|
+
vendor_images = find_assets(:type => 'images', :vendor => true)
|
57
64
|
|
58
65
|
precompile = [
|
59
66
|
'katello/katello.css',
|
@@ -62,8 +69,10 @@ module Katello
|
|
62
69
|
'bastion_katello/bastion_katello.js',
|
63
70
|
/bastion_katello\S+.(?:svg|eot|woff|ttf)$/
|
64
71
|
]
|
72
|
+
|
65
73
|
precompile.concat(javascripts)
|
66
74
|
precompile.concat(images)
|
75
|
+
precompile.concat(vendor_images)
|
67
76
|
|
68
77
|
SETTINGS[:katello] = {} unless SETTINGS.key?(:katello)
|
69
78
|
SETTINGS[:katello][:assets] = {:precompile => precompile}
|
data/lib/katello/version.rb
CHANGED
@@ -15,11 +15,11 @@
|
|
15
15
|
}
|
16
16
|
|
17
17
|
.treeTable tr.collapsed td .expander {
|
18
|
-
background-image: url(icons/expander-collapsed.png);
|
18
|
+
background-image: image-url("katello/icons/expander-collapsed.png");
|
19
19
|
}
|
20
20
|
|
21
21
|
.treeTable tr.expanded td .expander {
|
22
|
-
background-image: url(icons/expander-expanded.png);
|
22
|
+
background-image: image-url("katello/icons/expander-expanded.png");
|
23
23
|
}
|
24
24
|
|
25
25
|
/* jquery.treeTable.sortable
|
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.0.0.
|
4
|
+
version: 3.0.0.rc3
|
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-04-
|
11
|
+
date: 2016-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -1938,7 +1938,7 @@ files:
|
|
1938
1938
|
- vendor/assets/stylesheets/katello/jquery.loadmask.css
|
1939
1939
|
- vendor/assets/stylesheets/katello/jquery.multiselect.css
|
1940
1940
|
- vendor/assets/stylesheets/katello/jquery.multiselect.filter.css
|
1941
|
-
- vendor/assets/stylesheets/katello/jquery.treeTable.
|
1941
|
+
- vendor/assets/stylesheets/katello/jquery.treeTable.scss
|
1942
1942
|
- vendor/assets/stylesheets/katello/ui.spinner.css
|
1943
1943
|
homepage: http://www.katello.org
|
1944
1944
|
licenses: []
|