katello 3.2.0 → 3.2.1

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.

Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +1 -2
  3. data/app/controllers/katello/api/v2/host_collections_controller.rb +2 -2
  4. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +1 -2
  5. data/app/lib/actions/candlepin/consumer/create.rb +5 -1
  6. data/app/lib/actions/candlepin/consumer/update.rb +4 -0
  7. data/app/lib/actions/katello/capsule_content/sync.rb +7 -3
  8. data/app/lib/actions/katello/repository/finish_upload.rb +1 -1
  9. data/app/lib/actions/pulp/repository/sync.rb +6 -1
  10. data/app/lib/katello/resources/candlepin.rb +3 -3
  11. data/app/models/katello/activation_key.rb +5 -1
  12. data/app/models/katello/authorization/pool.rb +1 -1
  13. data/app/models/katello/concerns/hostgroup_extensions.rb +2 -1
  14. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +2 -0
  15. data/app/models/katello/content_view.rb +1 -1
  16. data/app/models/katello/content_view_erratum_filter.rb +2 -2
  17. data/app/models/katello/glue/candlepin/product.rb +6 -4
  18. data/app/models/katello/glue/pulp/repo.rb +13 -2
  19. data/app/models/katello/host/subscription_facet.rb +11 -2
  20. data/app/models/katello/repository.rb +3 -0
  21. data/app/models/katello/rhsm_fact_parser.rb +8 -1
  22. data/app/models/katello/subscription.rb +4 -0
  23. data/app/models/setting/content.rb +5 -1
  24. data/app/services/katello/candlepin/consumer.rb +4 -0
  25. data/db/migrate/20161021072346_fix_subscription_permissions.rb +11 -0
  26. data/db/migrate/20161026191118_fix_invalid_interfaces.rb +15 -0
  27. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-provisioning-info.html +1 -1
  28. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-subscriptions-list.html +1 -1
  29. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-version-deletion-activation-keys.controller.js +8 -1
  30. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-version-deletion.controller.js +4 -0
  31. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/errata-content-hosts.controller.js +1 -1
  32. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/errata-details-content-hosts.html +1 -1
  33. data/lib/katello/engine.rb +1 -3
  34. data/lib/katello/permissions/subscription_permissions.rb +5 -5
  35. data/lib/katello/tasks/upgrade_check.rake +5 -1
  36. data/lib/katello/version.rb +1 -1
  37. metadata +7 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 983bb2638d8d7bda5fc1c721754d3783b51b2213
4
- data.tar.gz: c9c271f48b0a3adc7d40d73a252dcaa16e656931
3
+ metadata.gz: e03e5aae1b2a39ce51d7e7747a5667d2ac7bd7fe
4
+ data.tar.gz: 4aeb37ebdb66b19eb1447ec81f89ee364957170d
5
5
  SHA512:
6
- metadata.gz: 14384c56ad55ef1a681de20b03c977720fb6bbb34e677add158939666d3ebdfd1c2f9b3b09c5ef040fb944c913473645c9f323581c6f7dac2daf02e675672c5c
7
- data.tar.gz: 3b076defead2957ad7a632275e5868484305dd4afd8d3d40b39b792d3d5ebd2f40b6b27d3993b3c89c09d458ac9d7c15e64d740e11e80ceb6a063f83a6cb9371
6
+ metadata.gz: ef2a411f01d495e018a9078cc6683d55a09ab1ea3d2e862b7054b8a37a644d4a7ea0e2ad2e2b441dae473067fa02ef499ce1666a26a24578120362b69ad700d3
7
+ data.tar.gz: 0399cb1ce7259e2667590c15422645631e634c9e8b2e0d5f7f9880e462b5dea4fe8c3294820620413505384cafa21ae36c86e2911806628f21699df07929fc7d
@@ -249,8 +249,7 @@ module Katello
249
249
 
250
250
  def facts
251
251
  User.as_anonymous_admin do
252
- sync_task(::Actions::Katello::Host::Update, @host, rhsm_params.except(:facts))
253
- Katello::Host::SubscriptionFacet.update_facts(@host, rhsm_params[:facts]) unless rhsm_params[:facts].nil?
252
+ sync_task(::Actions::Katello::Host::Update, @host, rhsm_params)
254
253
  update_host_registered_through(@host, request.headers)
255
254
  end
256
255
  render :json => {:content => _("Facts successfully updated.")}, :status => 200
@@ -87,7 +87,7 @@ module Katello
87
87
  host_ids = params[:host_ids].map(&:to_i)
88
88
 
89
89
  @hosts = ::Host::Managed.where(id: host_ids)
90
- @editable_hosts = @hosts.authorized(:edit_host)
90
+ @editable_hosts = @hosts.authorized(:edit_hosts)
91
91
 
92
92
  already_added_host_ids = @host_collection.host_ids & host_ids
93
93
  unfound_host_ids = host_ids - @hosts.pluck(:id)
@@ -121,7 +121,7 @@ module Katello
121
121
  host_ids = params[:host_ids].map(&:to_i)
122
122
 
123
123
  @hosts = ::Host::Managed.where(id: host_ids)
124
- @editable_hosts = @hosts.authorized(:edit_host)
124
+ @editable_hosts = @hosts.authorized(:edit_hosts)
125
125
 
126
126
  already_removed_host_ids = @hosts.pluck(:id) - @host_collection.host_ids
127
127
  unfound_host_ids = host_ids - @hosts.pluck(:id)
@@ -69,9 +69,8 @@ module Katello
69
69
  param :content_view_id, Integer, :desc => N_("Content View ID"), :required => true
70
70
  def create
71
71
  rhsm_params = params_to_rhsm_params
72
- name = rhsm_params[:facts]['network.hostname']
73
72
 
74
- host = Katello::Host::SubscriptionFacet.find_or_create_host(name, @content_view_environment.environment.organization, rhsm_params)
73
+ host = Katello::Host::SubscriptionFacet.find_or_create_host(@content_view_environment.environment.organization, rhsm_params)
75
74
  sync_task(::Actions::Katello::Host::Register, host, rhsm_params, @content_view_environment)
76
75
  host.reload
77
76
  ::Katello::Host::SubscriptionFacet.update_facts(host, rhsm_params[:facts]) unless rhsm_params[:facts].blank?
@@ -18,10 +18,14 @@ module Actions
18
18
 
19
19
  def run
20
20
  # we still keep the output interface the same for case there is other
21
- # way how to check the ability to subscribe the system with the actiovation key
21
+ # way how to check the ability to subscribe the system with the activation key
22
22
  # or we have better support for rolling back in Dynflow
23
23
  output[:response] = input[:response]
24
24
  end
25
+
26
+ def finalize
27
+ input[:consumer_parameters][:facts] = 'TRIMMED'
28
+ end
25
29
  end
26
30
  end
27
31
  end
@@ -10,6 +10,10 @@ module Actions
10
10
  def run
11
11
  ::Katello::Resources::Candlepin::Consumer.update(input[:uuid], input[:consumer_params])
12
12
  end
13
+
14
+ def finalize
15
+ input[:consumer_params][:facts] = 'TRIMMED'
16
+ end
13
17
  end
14
18
  end
15
19
  end
@@ -20,7 +20,7 @@ module Actions
20
20
 
21
21
  fail _("Action not allowed for the default capsule.") if capsule_content.default_capsule?
22
22
 
23
- need_updates = repos_needing_updates(capsule_content, environment, content_view)
23
+ need_updates = repos_needing_updates(capsule_content, environment, content_view, repository)
24
24
  repository_ids = get_repository_ids(capsule_content, environment, content_view, repository)
25
25
  unless repository_ids.blank?
26
26
  sequence do
@@ -73,8 +73,12 @@ module Actions
73
73
  repository_ids
74
74
  end
75
75
 
76
- def repos_needing_updates(capsule_content, environment, content_view)
77
- repos = capsule_content.repos_available_to_capsule(environment, content_view)
76
+ def repos_needing_updates(capsule_content, environment, content_view, repository)
77
+ repos = if repository
78
+ [repository]
79
+ else
80
+ capsule_content.repos_available_to_capsule(environment, content_view)
81
+ end
78
82
  need_importer_update = ::Katello::Repository.needs_importer_updates(repos, capsule_content)
79
83
  need_distributor_update = ::Katello::Repository.needs_distributor_updates(repos, capsule_content)
80
84
  (need_distributor_update + need_importer_update).uniq
@@ -5,7 +5,7 @@ module Actions
5
5
  def plan(repository, dependency = nil)
6
6
  plan_action(Katello::Repository::MetadataGenerate, repository, nil, dependency)
7
7
 
8
- recent_range = 5.minutes.ago.iso8601
8
+ recent_range = 5.minutes.ago.utc.iso8601
9
9
  plan_action(Katello::Repository::FilteredIndexContent,
10
10
  id: repository.id,
11
11
  filter: {:association => {:created => {"$gt" => recent_range}}},
@@ -66,7 +66,12 @@ module Actions
66
66
  end
67
67
 
68
68
  if sync_task && sync_task['state'] == 'finished' && sync_task[:result]
69
- sync_task['result']['added_count'] > 0 || sync_task['result']['removed_count'] > 0 || sync_task['result']['updated_count'] > 0
69
+ if sync_task['result']['added_count'] > 0 || sync_task['result']['removed_count'] > 0 || sync_task['result']['updated_count'] > 0
70
+ true
71
+ else
72
+ repo = ::Katello::Repository.find_by(:pulp_id => sync_task['result']['repo_id'])
73
+ repo ? repo.pulp_counts_differ? : true
74
+ end
70
75
  else
71
76
  true #if we can't figure it out, assume something changed
72
77
  end
@@ -639,7 +639,7 @@ module Katello
639
639
  ::Katello::Util::Data.array_with_indifferent_access products
640
640
  end
641
641
 
642
- def _certificate_and_key(id, owner)
642
+ def product_certificate(id, owner)
643
643
  subscriptions_json = Candlepin::CandlepinResource.get("/candlepin/owners/#{owner}/subscriptions", self.default_headers).body
644
644
  subscriptions = JSON.parse(subscriptions_json)
645
645
 
@@ -655,11 +655,11 @@ module Katello
655
655
  end
656
656
 
657
657
  def certificate(id, owner)
658
- self._certificate_and_key(id, owner).try :[], 'cert'
658
+ self.product_certificate(id, owner).try :[], 'cert'
659
659
  end
660
660
 
661
661
  def key(id, owner)
662
- self._certificate_and_key(id, owner).try :[], 'key'
662
+ self.product_certificate(id, owner).try :[], 'key'
663
663
  end
664
664
 
665
665
  def destroy(product_id)
@@ -98,7 +98,11 @@ module Katello
98
98
  if cp_pools
99
99
  pools = cp_pools.collect { |cp_pool| Pool.find_by(:cp_id => cp_pool['id']) }
100
100
  pools.each do |pool|
101
- all_products << pool.subscription.products
101
+ if pool.subscription
102
+ all_products << pool.subscription.products
103
+ else
104
+ Rails.logger.error("Pool #{pool.id} is missing its subscription id.")
105
+ end
102
106
  end
103
107
  end
104
108
  all_products.flatten!
@@ -6,7 +6,7 @@ module Katello
6
6
 
7
7
  module ClassMethods
8
8
  def readable
9
- where(:subscription_id => Katello::Subscription.authorized(:view_subscription))
9
+ where(:subscription_id => Katello::Subscription.authorized(:view_subscriptions))
10
10
  end
11
11
  end
12
12
  end
@@ -5,7 +5,8 @@ module Katello
5
5
 
6
6
  included do
7
7
  before_save :add_organization_for_environment
8
- belongs_to :kickstart_repository, :class_name => "::Katello::Repository", :foreign_key => :kickstart_repository_id
8
+ belongs_to :kickstart_repository, :class_name => "::Katello::Repository",
9
+ :foreign_key => :kickstart_repository_id, :inverse_of => :kickstart_hostgroups
9
10
  belongs_to :content_source, :class_name => "::SmartProxy", :foreign_key => :content_source_id, :inverse_of => :hostgroups
10
11
  belongs_to :content_view, :inverse_of => :hostgroups, :class_name => "::Katello::ContentView"
11
12
  belongs_to :lifecycle_environment, :inverse_of => :hostgroups, :class_name => "::Katello::KTEnvironment"
@@ -12,6 +12,8 @@ module Katello
12
12
  :unknown => Katello::SubscriptionStatus::UNKNOWN
13
13
  }.freeze
14
14
 
15
+ accepts_nested_attributes_for :subscription_facet, :update_only => true, :reject_if => lambda { |attrs| attrs.values.compact.empty? }
16
+
15
17
  has_one :subscription_facet, :class_name => '::Katello::Host::SubscriptionFacet', :foreign_key => :host_id, :inverse_of => :host, :dependent => :destroy
16
18
 
17
19
  has_many :activation_keys, :through => :subscription_facet
@@ -42,7 +42,7 @@ module Katello
42
42
  has_many :hosts, :class_name => "::Host::Managed", :through => :content_facets,
43
43
  :inverse_of => :content_view
44
44
  has_many :hostgroups, :class_name => "::Hostgroup", :foreign_key => :content_view_id,
45
- :inverse_of => :content_view, :dependent => :restrict_with_exception
45
+ :inverse_of => :content_view, :dependent => :nullify
46
46
 
47
47
  validates_lengths_from_database :except => [:label]
48
48
  validates :label, :uniqueness => {:scope => :organization_id},
@@ -26,8 +26,8 @@ module Katello
26
26
 
27
27
  unless start_date.blank? && end_date.blank?
28
28
  date_range = {}
29
- date_range["$gte"] = start_date.to_time.as_json unless start_date.blank?
30
- date_range["$lte"] = end_date.to_time.as_json unless end_date.blank?
29
+ date_range["$gte"] = start_date.to_time.utc.as_json unless start_date.blank?
30
+ date_range["$lte"] = end_date.to_time.utc.as_json unless end_date.blank?
31
31
  rule_clauses << { erratum_rules.first.pulp_date_type => date_range }
32
32
  end
33
33
  unless types.blank?
@@ -7,12 +7,14 @@ module Katello
7
7
  base.class_eval do
8
8
  lazy_accessor :productContent, :multiplier, :href, :attrs,
9
9
  :initializer => lambda { |_s| convert_from_cp_fields(Resources::Candlepin::Product.get(cp_id)[0]) }
10
- # Entitlement Certificate for this product
11
- lazy_accessor :certificate,
12
- :initializer => lambda { |_s| Resources::Candlepin::Product.certificate(cp_id, self.organization.label) },
10
+ # Certificate for this product - used for SSL certificate and key
11
+ lazy_accessor :product_certificate,
12
+ :initializer => lambda { |_s| Resources::Candlepin::Product.product_certificate(cp_id, self.organization.label) },
13
13
  :unless => lambda { |_s| cp_id.nil? }
14
+ # Entitlement Certificate for this product
15
+ lazy_accessor :certificate, :initializer => lambda { |_s| product_certificate['cert'] if product_certificate }
14
16
  # Entitlement Key for this product
15
- lazy_accessor :key, :initializer => lambda { |_s| Resources::Candlepin::Product.key(cp_id, self.organization.label) }, :unless => lambda { |_s| cp_id.nil? }
17
+ lazy_accessor :key, :initializer => lambda { |_s| product_certificate['key'] if product_certificate }
16
18
 
17
19
  # we must store custom logger object during product importing so we can log status
18
20
  # from various places like callbacks
@@ -54,7 +54,7 @@ module Katello
54
54
  else
55
55
  filename = file
56
56
  end
57
- filename.include?("vmlinuz") || filename.include?("pxeboot")
57
+ filename.include?('vmlinuz') || filename.include?('pxeboot') || filename.include?('kernel.img') || filename.include?('initrd.img')
58
58
  end
59
59
  end
60
60
 
@@ -71,7 +71,7 @@ module Katello
71
71
  repos.select do |repo|
72
72
  repo_details = capsule ? capsule.pulp_repo_facts(repo.pulp_id) : repo.pulp_repo_facts
73
73
  next unless repo_details
74
- !repo.distributors_match?(repo_details["distributors"], capsule)
74
+ !repo.distributors_match?(repo_details["distributors"], capsule.try(:capsule))
75
75
  end
76
76
  end
77
77
  end
@@ -113,6 +113,17 @@ module Katello
113
113
  find_distributor['config']['checksum_type'] if self.try(:yum?) && find_distributor
114
114
  end
115
115
 
116
+ def pulp_counts_differ?
117
+ pulp_counts = pulp_repo_facts[:content_unit_counts]
118
+ rpms.count != pulp_counts['rpm'].to_i ||
119
+ errata.count != pulp_counts['erratum'].to_i ||
120
+ package_groups.count != pulp_counts['package_group'].to_i ||
121
+ puppet_modules.count != pulp_counts['puppet_module'].to_i ||
122
+ docker_manifests.count != pulp_counts['docker_manifest'].to_i ||
123
+ docker_tags.count != pulp_counts['docker_tag'].to_i ||
124
+ ostree_branches.count != pulp_counts['ostree'].to_i
125
+ end
126
+
116
127
  def create_pulp_repo
117
128
  #if we are in library, no need for an distributor, but need to sync
118
129
  if self.environment.try(:library?)
@@ -91,11 +91,20 @@ module Katello
91
91
  end
92
92
 
93
93
  def self.propose_name_from_facts(facts)
94
- facts['network.fqdn'] || facts['network.hostname-override'] || facts['network.hostname']
94
+ setting_fact = Setting[:register_hostname_fact]
95
+ if !setting_fact.blank? && facts[setting_fact]
96
+ facts[setting_fact]
97
+ else
98
+ Rails.logger.warn(_("register_hostname_fact set for %s, but no fact found.") % setting_fact) unless setting_fact.blank?
99
+ facts['network.fqdn'] || facts['network.hostname-override'] || facts['network.hostname']
100
+ end
95
101
  end
96
102
 
97
103
  def self.propose_existing_hostname(facts)
98
- if ::Host.where(:name => facts['network.hostname'].downcase).any?
104
+ setting_fact = Setting[:register_hostname_fact]
105
+ if !setting_fact.blank? && !facts[setting_fact].blank? && ::Host.where(:name => setting_fact.downcase).any?
106
+ name = facts[setting_fact]
107
+ elsif ::Host.where(:name => facts['network.hostname'].downcase).any?
99
108
  name = facts['network.hostname']
100
109
  elsif facts['network.fqdn'] && ::Host.where(:name => facts['network.fqdn'].downcase).any?
101
110
  name = facts['network.fqdn']
@@ -67,6 +67,9 @@ module Katello
67
67
  has_many :kickstart_content_facets, :class_name => "Katello::Host::ContentFacet", :foreign_key => :kickstart_repository_id,
68
68
  :inverse_of => :kickstart_repository, :dependent => :nullify
69
69
 
70
+ has_many :kickstart_hostgroups, :class_name => "::Hostgroup", :foreign_key => :kickstart_repository_id,
71
+ :inverse_of => :kickstart_repository, :dependent => :nullify
72
+
70
73
  # rubocop:disable HasAndBelongsToMany
71
74
  # TODO: change this into has_many :through association
72
75
  has_and_belongs_to_many :filters, :class_name => "Katello::ContentViewFilter",
@@ -23,7 +23,7 @@ module Katello
23
23
  {
24
24
  'link' => true,
25
25
  'macaddress' => facts["net.interface.#{interface}.mac_address"],
26
- 'ipaddress' => facts["net.interface.#{interface}.ipv4_address"]
26
+ 'ipaddress' => get_rhsm_ip(interface)
27
27
  }
28
28
  end
29
29
 
@@ -71,5 +71,12 @@ module Katello
71
71
 
72
72
  def ipmi_interface
73
73
  end
74
+
75
+ private
76
+
77
+ def get_rhsm_ip(interface)
78
+ ip = facts["net.interface.#{interface}.ipv4_address"]
79
+ Net::Validations.validate_ip(ip) ? ip : nil
80
+ end
74
81
  end
75
82
  end
@@ -32,5 +32,9 @@ module Katello
32
32
  def recently_expired?
33
33
  pools.any?(&:recently_expired?)
34
34
  end
35
+
36
+ def self.humanize_class_name(_name = nil)
37
+ _("Subscription")
38
+ end
35
39
  end
36
40
  end
@@ -3,6 +3,8 @@ class Setting::Content < Setting
3
3
  def self.load_defaults
4
4
  return unless super
5
5
 
6
+ BLANK_ATTRS << 'register_hostname_fact'
7
+
6
8
  self.transaction do
7
9
  [
8
10
  self.set('katello_default_provision', N_("Default provisioning template for new Operating Systems"), 'Katello Kickstart Default'),
@@ -29,7 +31,9 @@ class Setting::Content < Setting
29
31
  self.set('pulp_client_cert', N_("Path for ssl cert used for pulp server auth"), "/etc/pki/katello/certs/pulp-client.crt"),
30
32
  self.set('remote_execution_by_default', N_("If set to true, use the remote execution over katello-agent for remote actions"), false),
31
33
  self.set('use_pulp_oauth', N_("use oauth authentication for pulp instead of the default cert based authentication"), false),
32
- self.set('unregister_delete_host', N_("When unregistering host via subscription-manager, also delete server-side host record"), false)
34
+ self.set('unregister_delete_host', N_("When unregistering host via subscription-manager, also delete server-side host record"), false),
35
+ self.set('register_hostname_fact', N_("When registering a host via subscription-manager, force use the specified fact (in the form of 'fact.fact')"),
36
+ '', N_('Subscription manager name registration fact'), nil)
33
37
  ].each { |s| self.create! s.update(:category => "Setting::Content") }
34
38
  end
35
39
  true
@@ -38,6 +38,10 @@ module Katello
38
38
  consumer_attributes[:entitlementStatus]
39
39
  end
40
40
 
41
+ def update(params)
42
+ ::Katello::Resources::Candlepin::Consumer.update(uuid, params)
43
+ end
44
+
41
45
  def filtered_pools(match_attached, match_host, match_installed, no_overlap)
42
46
  if match_host
43
47
  pools = self.available_pools
@@ -0,0 +1,11 @@
1
+ class FixSubscriptionPermissions < ActiveRecord::Migration
2
+ def up
3
+ permission_names = [:view_subscriptions, :attach_subscriptions, :unattach_subscriptions, :import_manifest, :delete_manifest]
4
+ Permission.where(:resource_type => 'Organization', :name => permission_names).update_all(resource_type: 'Katello::Subscription')
5
+ end
6
+
7
+ def down
8
+ permission_names = [:view_subscriptions, :attach_subscriptions, :unattach_subscriptions, :import_manifest, :delete_manifest]
9
+ Permission.where(:resource_type => 'Katello::Subscription', :name => permission_names).update_all(resource_type: 'Organization')
10
+ end
11
+ end
@@ -0,0 +1,15 @@
1
+ class FixInvalidInterfaces < ActiveRecord::Migration
2
+ class FakeNic < ActiveRecord::Base
3
+ self.table_name = 'nics'
4
+
5
+ def type
6
+ Nic::Base
7
+ end
8
+ end
9
+
10
+ def up
11
+ FakeNic.where(:ip => "Unknown").each do |nic|
12
+ nic.update_attributes(:ip => nil)
13
+ end
14
+ end
15
+ end
@@ -9,7 +9,7 @@
9
9
  <div class="detail">
10
10
  <span class="info-label" translate>Name</span>
11
11
  <span class="info-value">
12
- <a href="/hosts/{{ contentHost.host.name }}">
12
+ <a href="/hosts/{{ host.name }}">
13
13
  {{ host.name }}
14
14
  </a>
15
15
  </span>
@@ -60,7 +60,7 @@
60
60
  <tr class="grey-table-row" bst-table-row ng-repeat-end ng-repeat="subscription in subscriptions" row-select="subscription">
61
61
  <td bst-table-cell>{{ subscription.quantity_consumed }}</td>
62
62
  <td bst-table-cell>
63
- <a ui-sref="subscriptions.details.info({subscriptionId: subscription.subscription_id})">
63
+ <a ui-sref="subscriptions.details.info({subscriptionId: subscription.id})">
64
64
  {{ subscription | subscriptionConsumedFilter }}
65
65
  </a>
66
66
  </td>
@@ -28,7 +28,14 @@ angular.module('Bastion.content-views').controller('ContentViewVersionDeletionAc
28
28
  nutupane = new Nutupane(ActivationKey, params);
29
29
 
30
30
  nutupane.searchTransform = function (term) {
31
- var addition = "(environment_id:(" + $scope.selectedEnvironmentIds().join(" OR ") + "))";
31
+ var addition,
32
+ envClausses = [];
33
+
34
+ angular.forEach($scope.selectedEnvironmentNames(), function(env) {
35
+ envClausses.push("environment = " + env);
36
+ });
37
+ addition = '(' + envClausses.join(" OR ") + ')';
38
+ addition = addition + " AND content_view_id = " + $scope.contentView.id;
32
39
  if (term === "" || angular.isUndefined(term)) {
33
40
  return addition;
34
41
  }
@@ -109,6 +109,10 @@ angular.module('Bastion.content-views').controller('ContentViewVersionDeletionCo
109
109
  return _.pluck($scope.deleteOptions.environments, 'id');
110
110
  };
111
111
 
112
+ $scope.selectedEnvironmentNames = function () {
113
+ return _.map($scope.deleteOptions.environments, 'name');
114
+ };
115
+
112
116
  $scope.totalHostCount = function () {
113
117
  return _.reduce($scope.deleteOptions.environments, function (sum, env) {
114
118
  return sum + env['host_count'];
@@ -34,7 +34,7 @@ angular.module('Bastion.errata').controller('ErrataContentHostsController',
34
34
  $scope.detailsTable = nutupane.table;
35
35
  $scope.nutupane.searchTransform = function(term) {
36
36
  var addition = '( ' + $scope.errataSearchString($scope.restrictInstallable) + ' )';
37
- if (angular.isDefined($scope.environment_id)) {
37
+ if (angular.isDefined($scope.environmentId)) {
38
38
  addition = addition + ' and lifecycle_environment_id = ' + $scope.environmentId;
39
39
  }
40
40
 
@@ -38,7 +38,7 @@
38
38
  </div>
39
39
 
40
40
  <div class="col-md-1">
41
- <a ng-show="environmentFilter" ng-click="selectEnvironment(null)">
41
+ <a ng-show="environmentFilter" ng-click="selectEnvironment(undefined)">
42
42
  <i class="fa fa-remove"></i>
43
43
  </a>
44
44
  </div>
@@ -168,8 +168,6 @@ module Katello
168
168
  # Model extensions
169
169
  ::Environment.send :include, Katello::Concerns::EnvironmentExtensions
170
170
  ::Host::Managed.send :include, Katello::Concerns::HostManagedExtensions
171
- ::Host::Managed.send :include, ::Katello::Concerns::ContentFacetHostExtensions
172
- ::Host::Managed.send :include, ::Katello::Concerns::SubscriptionFacetHostExtensions
173
171
  ::Hostgroup.send :include, Katello::Concerns::HostgroupExtensions
174
172
  ::Location.send :include, Katello::Concerns::LocationExtensions
175
173
  ::Redhat.send :include, Katello::Concerns::RedhatExtensions
@@ -177,7 +175,6 @@ module Katello
177
175
  ::Organization.send :include, Katello::Concerns::OrganizationExtensions
178
176
  ::User.send :include, Katello::Concerns::UserExtensions
179
177
  ::Setting.send :include, Katello::Concerns::SettingExtensions
180
-
181
178
  ::Container.send :include, Katello::Concerns::ContainerExtensions
182
179
  ::DockerContainerWizardState.send :include, Katello::Concerns::DockerContainerWizardStateExtensions
183
180
 
@@ -237,6 +234,7 @@ module Katello
237
234
  end
238
235
 
239
236
  ::Host::Managed.send :include, ::Katello::Concerns::SubscriptionFacetHostExtensions
237
+ ::Host::Managed.send :include, ::Katello::Concerns::ContentFacetHostExtensions
240
238
 
241
239
  #Api controller extensions
242
240
  ::Api::V2::HostsController.send :include, Katello::Concerns::Api::V2::HostsControllerExtensions
@@ -6,17 +6,17 @@ Foreman::Plugin.find(:katello).security_block :subscriptions do
6
6
  'katello/api/v2/subscriptions' => [:index, :show, :available, :manifest_history, :auto_complete_search],
7
7
  'katello/api/v2/repository_sets' => [:index, :show, :available_repositories]
8
8
  },
9
- :resource_type => 'Organization'
9
+ :resource_type => 'Katello::Subscription'
10
10
  permission :attach_subscriptions,
11
11
  {
12
12
  'katello/api/v2/subscriptions' => [:create]
13
13
  },
14
- :resource_type => 'Organization'
14
+ :resource_type => 'Katello::Subscription'
15
15
  permission :unattach_subscriptions,
16
16
  {
17
17
  'katello/api/v2/subscriptions' => [:destroy]
18
18
  },
19
- :resource_type => 'Organization'
19
+ :resource_type => 'Katello::Subscription'
20
20
  permission :import_manifest,
21
21
  {
22
22
  'katello/products' => [:available_repositories, :toggle_repository],
@@ -24,10 +24,10 @@ Foreman::Plugin.find(:katello).security_block :subscriptions do
24
24
  'katello/api/v2/subscriptions' => [:upload, :refresh_manifest],
25
25
  'katello/api/v2/repository_sets' => [:enable, :disable]
26
26
  },
27
- :resource_type => 'Organization'
27
+ :resource_type => 'Katello::Subscription'
28
28
  permission :delete_manifest,
29
29
  {
30
30
  'katello/api/v2/subscriptions' => [:delete_manifest]
31
31
  },
32
- :resource_type => 'Organization'
32
+ :resource_type => 'Katello::Subscription'
33
33
  end
@@ -14,6 +14,10 @@ namespace :katello do
14
14
  task_status = task_count > 0 ? fail : success
15
15
  puts "Checking for running tasks..."
16
16
  puts "[#{task_status}] - There are #{task_count} active tasks. "
17
- puts " Please wait for these to complete or cancel them from the Monitor tab.\n\n"
17
+ if task_count > 0
18
+ puts " Please wait for these to complete or cancel them from the Monitor tab.\n\n"
19
+ else
20
+ puts " You may proceed with the upgrade.\n\n"
21
+ end
18
22
  end
19
23
  end
@@ -1,3 +1,3 @@
1
1
  module Katello
2
- VERSION = "3.2.0".freeze
2
+ VERSION = "3.2.1".freeze
3
3
  end
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.1
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-10 00:00:00.000000000 Z
11
+ date: 2016-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -208,22 +208,16 @@ dependencies:
208
208
  name: bastion
209
209
  requirement: !ruby/object:Gem::Requirement
210
210
  requirements:
211
- - - ">="
211
+ - - '='
212
212
  - !ruby/object:Gem::Version
213
213
  version: 3.3.4
214
- - - "<"
215
- - !ruby/object:Gem::Version
216
- version: 4.0.0
217
214
  type: :runtime
218
215
  prerelease: false
219
216
  version_requirements: !ruby/object:Gem::Requirement
220
217
  requirements:
221
- - - ">="
218
+ - - '='
222
219
  - !ruby/object:Gem::Version
223
220
  version: 3.3.4
224
- - - "<"
225
- - !ruby/object:Gem::Version
226
- version: 4.0.0
227
221
  - !ruby/object:Gem::Dependency
228
222
  name: factory_girl_rails
229
223
  requirement: !ruby/object:Gem::Requirement
@@ -1345,6 +1339,8 @@ files:
1345
1339
  - db/migrate/20160808002834_add_files.rb
1346
1340
  - db/migrate/20160906181923_add_puppet_path_to_smart_proxy.rb
1347
1341
  - db/migrate/20161003204325_add_user_to_katello_subscription_facets.rb
1342
+ - db/migrate/20161021072346_fix_subscription_permissions.rb
1343
+ - db/migrate/20161026191118_fix_invalid_interfaces.rb
1348
1344
  - db/migrate/20161028153131_sub_facet_user_index_not_uniq.rb
1349
1345
  - db/seeds.d/101-locations.rb
1350
1346
  - db/seeds.d/102-organizations.rb
@@ -1988,7 +1984,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1988
1984
  version: '0'
1989
1985
  requirements: []
1990
1986
  rubyforge_project:
1991
- rubygems_version: 2.4.8
1987
+ rubygems_version: 2.5.0
1992
1988
  signing_key:
1993
1989
  specification_version: 4
1994
1990
  summary: ''