foreman_salt 13.2.1 → 14.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/app/controllers/foreman_salt/api/v2/salt_autosign_controller.rb +31 -1
- data/app/controllers/foreman_salt/api/v2/salt_variables_controller.rb +1 -2
- data/app/lib/proxy_api/salt.rb +16 -2
- data/app/models/foreman_salt/concerns/host_managed_extensions.rb +64 -15
- data/app/models/foreman_salt/salt_status.rb +12 -0
- data/app/services/foreman_salt/report_importer.rb +1 -1
- data/config/routes.rb +1 -0
- data/db/migrate/20210312150333_add_salt_autosign_to_host.rb +6 -0
- data/db/seeds.d/76-job_templates.rb +1 -1
- data/lib/foreman_salt/engine.rb +2 -4
- data/lib/foreman_salt/extensions.rb +0 -3
- data/lib/foreman_salt/version.rb +1 -1
- data/locale/ca/LC_MESSAGES/foreman_salt.mo +0 -0
- data/locale/ca/foreman_salt.po +541 -0
- data/locale/cs_CZ/LC_MESSAGES/foreman_salt.mo +0 -0
- data/locale/cs_CZ/foreman_salt.po +541 -0
- data/locale/de/LC_MESSAGES/foreman_salt.mo +0 -0
- data/locale/de/foreman_salt.po +0 -18
- data/locale/en/LC_MESSAGES/foreman_salt.mo +0 -0
- data/locale/en/foreman_salt.po +0 -18
- data/locale/en_GB/LC_MESSAGES/foreman_salt.mo +0 -0
- data/locale/en_GB/foreman_salt.po +541 -0
- data/locale/es/LC_MESSAGES/foreman_salt.mo +0 -0
- data/locale/es/foreman_salt.po +541 -0
- data/locale/foreman_salt.pot +22 -46
- data/locale/fr/LC_MESSAGES/foreman_salt.mo +0 -0
- data/locale/fr/foreman_salt.po +541 -0
- data/locale/gl/LC_MESSAGES/foreman_salt.mo +0 -0
- data/locale/gl/foreman_salt.po +541 -0
- data/locale/it/LC_MESSAGES/foreman_salt.mo +0 -0
- data/locale/it/foreman_salt.po +541 -0
- data/locale/ja/LC_MESSAGES/foreman_salt.mo +0 -0
- data/locale/ja/foreman_salt.po +541 -0
- data/locale/ko/LC_MESSAGES/foreman_salt.mo +0 -0
- data/locale/ko/foreman_salt.po +541 -0
- data/locale/nl_NL/LC_MESSAGES/foreman_salt.mo +0 -0
- data/locale/nl_NL/foreman_salt.po +541 -0
- data/locale/pl/LC_MESSAGES/foreman_salt.mo +0 -0
- data/locale/pl/foreman_salt.po +542 -0
- data/locale/pt_BR/LC_MESSAGES/foreman_salt.mo +0 -0
- data/locale/pt_BR/foreman_salt.po +541 -0
- data/locale/ru/LC_MESSAGES/foreman_salt.mo +0 -0
- data/locale/ru/foreman_salt.po +542 -0
- data/locale/sv_SE/LC_MESSAGES/foreman_salt.mo +0 -0
- data/locale/sv_SE/foreman_salt.po +541 -0
- data/locale/zh_CN/LC_MESSAGES/foreman_salt.mo +0 -0
- data/locale/zh_CN/foreman_salt.po +541 -0
- data/locale/zh_TW/LC_MESSAGES/foreman_salt.mo +0 -0
- data/locale/zh_TW/foreman_salt.po +541 -0
- data/test/functional/api/v2/salt_autosign_controller_test.rb +2 -0
- data/test/integration/salt_autosign_test.rb +2 -2
- data/test/integration/salt_keys_test.rb +2 -3
- data/test/unit/host_extensions_test.rb +55 -11
- metadata +40 -15
- data/app/models/foreman_salt/fact_name.rb +0 -14
- data/app/services/foreman_salt/fact_importer.rb +0 -15
- data/app/services/foreman_salt/fact_parser.rb +0 -114
- data/test/unit/grains_centos.json +0 -113
- data/test/unit/salt_fact_importer_test.rb +0 -24
- data/test/unit/salt_fact_parser_test.rb +0 -44
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'test_plugin_helper'
|
2
|
-
|
3
|
-
module ForemanSalt
|
4
|
-
class SaltFactImpoterTest < ActiveSupport::TestCase
|
5
|
-
def setup
|
6
|
-
@host = FactoryBot.build(:host)
|
7
|
-
end
|
8
|
-
|
9
|
-
test 'should have fact set' do
|
10
|
-
importer = FactImporter.new(@host, 'a' => 'b')
|
11
|
-
assert_equal({ 'a' => 'b' }, importer.send(:facts))
|
12
|
-
end
|
13
|
-
|
14
|
-
test 'should have Salt as origin' do
|
15
|
-
importer = FactImporter.new(@host, 'a' => 'b')
|
16
|
-
importer.stubs(:ensure_no_active_transaction).returns(true)
|
17
|
-
importer.import!
|
18
|
-
imported_fact = FactName.find_by_name('a')
|
19
|
-
assert_equal 'a', imported_fact.name
|
20
|
-
assert_equal 'Salt', imported_fact.origin
|
21
|
-
assert_equal 'foreman_salt/Salt', imported_fact.icon_path
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
require 'test_plugin_helper'
|
2
|
-
|
3
|
-
module ForemanSalt
|
4
|
-
class SaltFactsParserTest < ActiveSupport::TestCase
|
5
|
-
def setup
|
6
|
-
grains = JSON.parse(File.read(File.join(Engine.root, 'test', 'unit', 'grains_centos.json')))
|
7
|
-
@facts_parser = FactParser.new grains["facts"]
|
8
|
-
User.current = users :admin
|
9
|
-
end
|
10
|
-
|
11
|
-
test "should return list of interfaces" do
|
12
|
-
assert @facts_parser.interfaces.present?
|
13
|
-
assert_not_nil @facts_parser.suggested_primary_interface(FactoryBot.build(:host))
|
14
|
-
assert @facts_parser.interfaces.key?(@facts_parser.suggested_primary_interface(FactoryBot.build(:host)).first)
|
15
|
-
end
|
16
|
-
|
17
|
-
test "should set operatingsystem correctly" do
|
18
|
-
os = @facts_parser.operatingsystem
|
19
|
-
assert os.present?
|
20
|
-
assert_equal 'CentOS', os.name
|
21
|
-
assert_equal '6', os.major
|
22
|
-
assert_equal '5', os.minor
|
23
|
-
assert_equal 'CentOS 6.5', os.title
|
24
|
-
end
|
25
|
-
|
26
|
-
test "should set domain correctly" do
|
27
|
-
domain = @facts_parser.domain
|
28
|
-
assert domain.present?
|
29
|
-
assert_equal 'example.com', domain.name
|
30
|
-
end
|
31
|
-
|
32
|
-
test "should set ip correctly" do
|
33
|
-
assert_equal '10.7.13.141', @facts_parser.ip
|
34
|
-
end
|
35
|
-
|
36
|
-
test "should set primary_interface correctly" do
|
37
|
-
assert_equal 'eth0', @facts_parser.primary_interface
|
38
|
-
end
|
39
|
-
|
40
|
-
test "should set mac correctly" do
|
41
|
-
assert_equal '52:54:00:35:30:2a', @facts_parser.mac
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|