foreman_discovery 24.0.1 → 25.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/api/v2/discovered_hosts_controller.rb +1 -1
  3. data/app/helpers/discovered_hosts_helper.rb +1 -1
  4. data/app/models/host/discovered.rb +1 -1
  5. data/app/views/discovered_hosts/show.html.erb +23 -21
  6. data/app/views/discovery_rules/_form.html.erb +0 -6
  7. data/config/initializers/inflections.rb +5 -0
  8. data/db/migrate/20141223142759_fill_discovery_attribute_sets_for_existing_hosts.rb +1 -1
  9. data/db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb +1 -1
  10. data/lib/foreman_discovery/engine.rb +300 -305
  11. data/lib/foreman_discovery/version.rb +1 -1
  12. data/lib/foreman_discovery.rake +1 -5
  13. data/locale/ca/foreman_discovery.edit.po +64 -64
  14. data/locale/cs_CZ/foreman_discovery.edit.po +64 -64
  15. data/locale/de/foreman_discovery.edit.po +64 -64
  16. data/locale/en/foreman_discovery.edit.po +64 -64
  17. data/locale/en_GB/foreman_discovery.edit.po +64 -64
  18. data/locale/es/foreman_discovery.edit.po +64 -64
  19. data/locale/foreman_discovery.pot +68 -68
  20. data/locale/fr/foreman_discovery.edit.po +64 -64
  21. data/locale/gl/foreman_discovery.edit.po +64 -64
  22. data/locale/it/foreman_discovery.edit.po +64 -64
  23. data/locale/ja/foreman_discovery.edit.po +64 -64
  24. data/locale/ka/foreman_discovery.edit.po +64 -64
  25. data/locale/ko/foreman_discovery.edit.po +64 -64
  26. data/locale/pt_BR/foreman_discovery.edit.po +64 -64
  27. data/locale/ru/foreman_discovery.edit.po +64 -64
  28. data/locale/sv_SE/foreman_discovery.edit.po +64 -64
  29. data/locale/zh_CN/foreman_discovery.edit.po +64 -64
  30. data/locale/zh_TW/foreman_discovery.edit.po +64 -64
  31. data/package.json +0 -2
  32. data/test/functional/discovered_hosts_controller_test.rb +1 -1
  33. metadata +14 -15
  34. data/test/migrations/20221102075151_migrate_discovery_hostname_and_fact_column_to_array_test.rb.orig +0 -81
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fea157692374486c03ed7c9a3185704468ea18c30919abe85a1579eda158113e
4
- data.tar.gz: 5fcf2c407782870e9513460057f7be04903073c0dfe11842f3a9038794014e68
3
+ metadata.gz: 8eee62d61a02887b7fae697853ef06410a24f4a364b3ded2d5f1ae8e6c8037e2
4
+ data.tar.gz: 1270edfbdd2a140773f7d5673ee399d0037bc1b5a5b140873284632236f1323d
5
5
  SHA512:
6
- metadata.gz: 5517f989fb2bad25c8f55a6df4a2f19209f3f0e2b227c56d00bc2a088a9c71ee316fb211cd0ec9ddfb0184905c884498e2cbe0f53a0f2f062935b3f9619a232e
7
- data.tar.gz: 7c383bc8724080672a9bcf62501356aa6389bf69444b4aef23388649627074f5d17ee3e60fba033d869762e734afe96841fddf0bb698e9e24ad21bd5721ab2d1
6
+ metadata.gz: 02ad926fda08a7bba1f0d479beb6905779903890dc0364975ccd16958767c6fd76b94dbc699951347783d55cd952735a4f591a4d98563cb2cb776c2d2bc56cdf
7
+ data.tar.gz: 66d2015d31098d376ab4e747bf72d5b46fb097740723d36823e032d6fb72b7ee1fdf38cda29c6f6f75260e9d59a3815e64d500a788759fbe53b572cc528f0569
@@ -162,7 +162,7 @@ module Api
162
162
 
163
163
  total_count = 0
164
164
  overall_errors = ""
165
- Host::Discovered.all.each do |discovered_host|
165
+ Host::Discovered.all.find_each do |discovered_host|
166
166
  if rule = find_discovery_rule(discovered_host)
167
167
  result &= perform_auto_provision(discovered_host, rule)
168
168
  unless discovered_host.errors.empty?
@@ -40,7 +40,7 @@ module DiscoveredHostsHelper
40
40
  end
41
41
 
42
42
  def turn_zero_to_not_available(value)
43
- value == 0 ? 'N/A' : value
43
+ (value == 0) ? 'N/A' : value
44
44
  end
45
45
 
46
46
  def discovery_attribute(host, attr, default_value = _('N/A'))
@@ -222,7 +222,7 @@ class Host::Discovered < ::Host::Base
222
222
  end
223
223
 
224
224
  def self.normalize_string_for_hostname(hostname)
225
- hostname = hostname.to_s.downcase.gsub(/(^[^a-z0-9]*|[^a-z0-9\-]|[^a-z0-9]*$)/,'')
225
+ hostname = hostname.to_s.downcase.gsub(/(^[^a-z0-9]*|[^a-z0-9-]|[^a-z0-9]*$)/,'')
226
226
  raise(::Foreman::Exception.new(N_("Invalid hostname: Could not normalize the hostname"))) unless hostname && hostname.present?
227
227
  hostname
228
228
  end
@@ -96,28 +96,30 @@
96
96
  </div>
97
97
  </div>
98
98
 
99
- <script type="text/javascript" charset="utf-8">
100
- $(document).ready(function(){
101
- $("table").css('padding', '0');
102
- $("table").css("cssText", 'margin-bottom: 0 !important;');
99
+ <% content_for(:javascripts) do -%>
100
+ <script type="text/javascript" charset="utf-8">
101
+ $(document).ready(function(){
102
+ $("table").css('padding', '0');
103
+ $("table").css("cssText", 'margin-bottom: 0 !important;');
103
104
 
104
- provision_class = 'active'
105
- primary_class = 'active'
106
- var flag_primary = '<i class="glyphicon glyphicon glyphicon-tag primary-flag '+ primary_class +'" title="" data-original-title="'+ __('Primary') +'"></i>';
107
- var flags_provision = '<i class="glyphicon glyphicon glyphicon-hdd provision-flag '+ provision_class +'" title="" data-original-title="'+ __('Provisioning') +'"></i>';
105
+ provision_class = 'active'
106
+ primary_class = 'active'
107
+ var flag_primary = '<i class="glyphicon glyphicon glyphicon-tag primary-flag '+ primary_class +'" title="" data-original-title="'+ __('Primary') +'"></i>';
108
+ var flags_provision = '<i class="glyphicon glyphicon glyphicon-hdd provision-flag '+ provision_class +'" title="" data-original-title="'+ __('Provisioning') +'"></i>';
108
109
 
109
- $('.flag-primary').html(flag_primary);
110
- $('.flag-provision').append(flags_provision);
111
- $('.primary-flag').tooltip();
112
- $('.provision-flag').tooltip();
110
+ $('.flag-primary').html(flag_primary);
111
+ $('.flag-provision').append(flags_provision);
112
+ $('.primary-flag').tooltip();
113
+ $('.provision-flag').tooltip();
113
114
 
114
- expand_all_toggle_action = { 'Expand All': 'show', 'Collapse All': 'hide' };
115
- $('#expand_all').on('click', function () {
116
- $(this).text(function(i, text){
117
- $('#accordion .panel-collapse').collapse(expand_all_toggle_action[text]);
118
- return text === "Expand All" ? "Collapse All" : "Expand All";
119
- })
120
- });
115
+ expand_all_toggle_action = { 'Expand All': 'show', 'Collapse All': 'hide' };
116
+ $('#expand_all').on('click', function () {
117
+ $(this).text(function(i, text){
118
+ $('#accordion .panel-collapse').collapse(expand_all_toggle_action[text]);
119
+ return text === "Expand All" ? "Collapse All" : "Expand All";
120
+ })
121
+ });
121
122
 
122
- });
123
- </script>
123
+ });
124
+ </script>
125
+ <% end %>
@@ -31,9 +31,3 @@
31
31
  </div>
32
32
  <%= submit_or_cancel f %>
33
33
  <% end %>
34
-
35
- <script type="text/javascript" charset="utf-8">
36
- $(document).ready(function() {
37
- $('input.counter_spinner').spinner();
38
- });
39
- </script>
@@ -0,0 +1,5 @@
1
+ Rails.autoloaders.each do |autoloader|
2
+ autoloader.inflector.inflect(
3
+ 'node_api' => 'NodeAPI'
4
+ )
5
+ end
@@ -4,7 +4,7 @@ end
4
4
 
5
5
  class FillDiscoveryAttributeSetsForExistingHosts < ActiveRecord::Migration[4.2]
6
6
  def up
7
- FakeDiscoveredHost.where(:type => "Host::Discovered").all.each do |host|
7
+ FakeDiscoveredHost.where(:type => "Host::Discovered").all.find_each do |host|
8
8
  begin
9
9
  say "Populating attribute set for discovered host #{host.name}"
10
10
  ForemanDiscovery::ImportHooks::DiscoveryAttribute.new(host: host, facts: host.facts_hash).after_populate
@@ -1,6 +1,6 @@
1
1
  class RemoveOldDiscoveryReaderPermissions < ActiveRecord::Migration[4.2]
2
2
  def up
3
- Permission.where("name like '%_discovery_rules' and resource_type is null").each do |permission|
3
+ Permission.where("name like '%_discovery_rules' and resource_type is null").find_each do |permission|
4
4
  permission.update(:resource_type => 'DiscoveryRule')
5
5
  end
6
6
  end