foreman_discovery 22.0.4 → 23.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/foreman_discovery/locale/ca/foreman_discovery.js +847 -0
- data/app/assets/javascripts/foreman_discovery/locale/cs_CZ/foreman_discovery.js +847 -0
- data/app/assets/javascripts/foreman_discovery/locale/de/foreman_discovery.js +847 -0
- data/app/assets/javascripts/foreman_discovery/locale/en/foreman_discovery.js +846 -0
- data/app/assets/javascripts/foreman_discovery/locale/en_GB/foreman_discovery.js +847 -0
- data/app/assets/javascripts/foreman_discovery/locale/es/foreman_discovery.js +850 -0
- data/app/assets/javascripts/foreman_discovery/locale/fr/foreman_discovery.js +850 -0
- data/app/assets/javascripts/foreman_discovery/locale/gl/foreman_discovery.js +847 -0
- data/app/assets/javascripts/foreman_discovery/locale/it/foreman_discovery.js +847 -0
- data/app/assets/javascripts/foreman_discovery/locale/ja/foreman_discovery.js +844 -0
- data/app/assets/javascripts/foreman_discovery/locale/ka/foreman_discovery.js +847 -0
- data/app/assets/javascripts/foreman_discovery/locale/ko/foreman_discovery.js +847 -0
- data/app/assets/javascripts/foreman_discovery/locale/pt_BR/foreman_discovery.js +850 -0
- data/app/assets/javascripts/foreman_discovery/locale/ru/foreman_discovery.js +851 -0
- data/app/assets/javascripts/foreman_discovery/locale/sv_SE/foreman_discovery.js +847 -0
- data/app/assets/javascripts/foreman_discovery/locale/zh_CN/foreman_discovery.js +844 -0
- data/app/assets/javascripts/foreman_discovery/locale/zh_TW/foreman_discovery.js +847 -0
- data/app/controllers/discovered_hosts_controller.rb +4 -0
- data/app/helpers/discovered_hosts_helper.rb +9 -2
- data/app/services/foreman_discovery/node_api/node_resource.rb +5 -5
- data/app/services/foreman_discovery/ui_notifications/failed_discovery.rb +1 -1
- data/extra/discover-host +1 -1
- data/lib/foreman_discovery/engine.rb +2 -8
- data/lib/foreman_discovery/version.rb +1 -1
- data/locale/ca/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/ca/foreman_discovery.edit.po +1122 -0
- data/locale/ca/foreman_discovery.po +15 -3
- data/locale/cs_CZ/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/cs_CZ/foreman_discovery.edit.po +1120 -0
- data/locale/cs_CZ/foreman_discovery.po +846 -0
- data/locale/de/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/de/foreman_discovery.edit.po +1129 -0
- data/locale/de/foreman_discovery.po +17 -5
- data/locale/en/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/en/foreman_discovery.edit.po +1115 -0
- data/locale/en/foreman_discovery.po +15 -3
- data/locale/en_GB/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/en_GB/foreman_discovery.edit.po +1125 -0
- data/locale/en_GB/foreman_discovery.po +17 -5
- data/locale/es/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/es/foreman_discovery.edit.po +1130 -0
- data/locale/es/foreman_discovery.po +17 -5
- data/locale/foreman_discovery.pot +78 -59
- data/locale/fr/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/fr/foreman_discovery.edit.po +1126 -0
- data/locale/fr/foreman_discovery.po +17 -5
- data/locale/gl/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/gl/foreman_discovery.edit.po +1120 -0
- data/locale/gl/foreman_discovery.po +15 -3
- data/locale/it/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/it/foreman_discovery.edit.po +1123 -0
- data/locale/it/foreman_discovery.po +15 -3
- data/locale/ja/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/ja/foreman_discovery.edit.po +1119 -0
- data/locale/ja/foreman_discovery.po +17 -5
- data/locale/ka/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/ka/foreman_discovery.edit.po +1120 -0
- data/locale/ka/foreman_discovery.po +15 -3
- data/locale/ko/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/ko/foreman_discovery.edit.po +1119 -0
- data/locale/ko/foreman_discovery.po +16 -4
- data/locale/pt_BR/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/pt_BR/foreman_discovery.edit.po +1132 -0
- data/locale/pt_BR/foreman_discovery.po +17 -5
- data/locale/ru/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/ru/foreman_discovery.edit.po +1131 -0
- data/locale/ru/foreman_discovery.po +17 -5
- data/locale/sv_SE/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/sv_SE/foreman_discovery.edit.po +1123 -0
- data/locale/sv_SE/foreman_discovery.po +15 -3
- data/locale/zh_CN/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/zh_CN/foreman_discovery.edit.po +1117 -0
- data/locale/zh_CN/foreman_discovery.po +17 -5
- data/locale/zh_TW/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/zh_TW/foreman_discovery.edit.po +1120 -0
- data/locale/zh_TW/foreman_discovery.po +15 -3
- data/package.json +0 -1
- data/test/migrations/20221102075151_migrate_discovery_hostname_and_fact_column_to_array_test.rb +11 -25
- data/test/migrations/20221102075151_migrate_discovery_hostname_and_fact_column_to_array_test.rb.orig +81 -0
- data/webpack/src/ForemanDiscovery/DiscoveryRules/Components/EmptyState/EmptyState.js +1 -1
- metadata +54 -16
@@ -94,8 +94,15 @@ module DiscoveredHostsHelper
|
|
94
94
|
end
|
95
95
|
|
96
96
|
def host_path(host)
|
97
|
-
return
|
98
|
-
|
97
|
+
return discovered_host_path(host) if controller_name == 'discovered_hosts'
|
98
|
+
# This is a hack to fix the hostgroup selection on the discovered host edit page
|
99
|
+
# The hostgroup onChange action is replacing the form url from `/discovered_hosts/:id`
|
100
|
+
# to `/hosts/:id``, which is not correct (in this case) and it breaks the form submission
|
101
|
+
return discovered_host_path(host) if controller_name == 'hosts' &&
|
102
|
+
action_name == 'process_hostgroup' &&
|
103
|
+
Host::Discovered.find_by(id: host[:id])
|
104
|
+
|
105
|
+
super
|
99
106
|
end
|
100
107
|
|
101
108
|
def discovery_doc_version
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module ForemanDiscovery::NodeAPI
|
2
2
|
class NodeResource
|
3
3
|
def initialize(args)
|
4
|
-
raise ArgumentError, "Options must be hash" unless args.is_a?(Hash)
|
5
|
-
raise ArgumentError, "Option 'url' must be provided" unless args[:url]
|
4
|
+
raise ArgumentError, _("Options must be hash") unless args.is_a?(Hash)
|
5
|
+
raise ArgumentError, _("Option 'url' must be provided") unless args[:url]
|
6
6
|
@args = args
|
7
7
|
@connect_params = {
|
8
8
|
:headers => { :accept => :json },
|
@@ -38,19 +38,19 @@ module ForemanDiscovery::NodeAPI
|
|
38
38
|
def scheme
|
39
39
|
URI.parse(url).scheme
|
40
40
|
rescue Exception => e
|
41
|
-
raise ArgumentError, "Option 'url' must be valid URI:
|
41
|
+
raise ArgumentError, _("Option 'url' must be valid URI: %s") % e
|
42
42
|
end
|
43
43
|
|
44
44
|
def port
|
45
45
|
URI.parse(url).port
|
46
46
|
rescue Exception => e
|
47
|
-
raise ArgumentError, "Option 'url' must be valid URI:
|
47
|
+
raise ArgumentError, _("Option 'url' must be valid URI: %s") % e
|
48
48
|
end
|
49
49
|
|
50
50
|
def root_path
|
51
51
|
URI.parse(url).path
|
52
52
|
rescue Exception => e
|
53
|
-
raise ArgumentError, "Option 'url' must be valid URI:
|
53
|
+
raise ArgumentError, _("Option 'url' must be valid URI: %s") % e
|
54
54
|
end
|
55
55
|
|
56
56
|
def is_proxy?
|
@@ -21,7 +21,7 @@ module ForemanDiscovery
|
|
21
21
|
Notification.create!(
|
22
22
|
initiator: initiator,
|
23
23
|
audience: ::Notification::AUDIENCE_ADMIN,
|
24
|
-
message: _("One or more hosts with failed discovery due to error:
|
24
|
+
message: _("One or more hosts with failed discovery due to error: %s") % @message,
|
25
25
|
notification_blueprint: blueprint,
|
26
26
|
)
|
27
27
|
end
|
data/extra/discover-host
CHANGED
@@ -6,7 +6,7 @@ require 'rest-client'
|
|
6
6
|
def find_base name = "default"
|
7
7
|
return name if File.exist?(name)
|
8
8
|
|
9
|
-
file = File.absolute_path(File.dirname(__FILE__) + "
|
9
|
+
file = File.absolute_path(File.dirname(__FILE__) + "/../test/facts/#{name}.json")
|
10
10
|
raise "Unable to find file #{file}" unless File.exist?(file)
|
11
11
|
|
12
12
|
file
|
@@ -21,13 +21,6 @@ module ForemanDiscovery
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
initializer 'foreman_discovery.register_gettext', :after => :load_config_initializers do |app|
|
25
|
-
locale_dir = File.join(File.expand_path('../../..', __FILE__), 'locale')
|
26
|
-
locale_domain = 'foreman_discovery'
|
27
|
-
|
28
|
-
Foreman::Gettext::Support.add_text_domain locale_domain, locale_dir
|
29
|
-
end
|
30
|
-
|
31
24
|
# Add any db migrations
|
32
25
|
initializer "foreman_discovery.load_app_instance_data" do |app|
|
33
26
|
ForemanDiscovery::Engine.paths['db/migrate'].existent.each do |path|
|
@@ -37,7 +30,8 @@ module ForemanDiscovery
|
|
37
30
|
|
38
31
|
initializer 'foreman_discovery.register_plugin', :before => :finisher_hook do |app|
|
39
32
|
Foreman::Plugin.register :foreman_discovery do
|
40
|
-
requires_foreman '>= 3.
|
33
|
+
requires_foreman '>= 3.8'
|
34
|
+
register_gettext
|
41
35
|
|
42
36
|
# settings
|
43
37
|
settings do
|
Binary file
|