foreman_puppet 6.0.1 → 6.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/foreman_puppet/locale/ca/foreman_puppet.js +3 -3
  3. data/app/assets/javascripts/foreman_puppet/locale/cs_CZ/foreman_puppet.js +3 -3
  4. data/app/assets/javascripts/foreman_puppet/locale/de/foreman_puppet.js +3 -3
  5. data/app/assets/javascripts/foreman_puppet/locale/en/foreman_puppet.js +3 -3
  6. data/app/assets/javascripts/foreman_puppet/locale/en_GB/foreman_puppet.js +3 -3
  7. data/app/assets/javascripts/foreman_puppet/locale/es/foreman_puppet.js +3 -3
  8. data/app/assets/javascripts/foreman_puppet/locale/fr/foreman_puppet.js +3 -3
  9. data/app/assets/javascripts/foreman_puppet/locale/gl/foreman_puppet.js +3 -3
  10. data/app/assets/javascripts/foreman_puppet/locale/it/foreman_puppet.js +3 -3
  11. data/app/assets/javascripts/foreman_puppet/locale/ja/foreman_puppet.js +3 -3
  12. data/app/assets/javascripts/foreman_puppet/locale/ka/foreman_puppet.js +3 -3
  13. data/app/assets/javascripts/foreman_puppet/locale/ko/foreman_puppet.js +3 -3
  14. data/app/assets/javascripts/foreman_puppet/locale/nl_NL/foreman_puppet.js +3 -3
  15. data/app/assets/javascripts/foreman_puppet/locale/pl/foreman_puppet.js +3 -3
  16. data/app/assets/javascripts/foreman_puppet/locale/pt_BR/foreman_puppet.js +3 -3
  17. data/app/assets/javascripts/foreman_puppet/locale/ru/foreman_puppet.js +3 -3
  18. data/app/assets/javascripts/foreman_puppet/locale/sv_SE/foreman_puppet.js +3 -3
  19. data/app/assets/javascripts/foreman_puppet/locale/zh_CN/foreman_puppet.js +3 -3
  20. data/app/assets/javascripts/foreman_puppet/locale/zh_TW/foreman_puppet.js +3 -3
  21. data/app/models/concerns/foreman_puppet/extensions/host.rb +0 -7
  22. data/app/models/concerns/foreman_puppet/extensions/hostgroup.rb +21 -5
  23. data/app/models/foreman_puppet/config_group.rb +1 -1
  24. data/app/views/foreman_puppet/layouts/application_react.html.erb +1 -2
  25. data/lib/foreman_puppet/version.rb +1 -1
  26. data/locale/Makefile +3 -3
  27. data/locale/ca/foreman_puppet.edit.po +28 -28
  28. data/locale/cs_CZ/foreman_puppet.edit.po +28 -28
  29. data/locale/de/foreman_puppet.edit.po +28 -28
  30. data/locale/en/foreman_puppet.edit.po +28 -28
  31. data/locale/en_GB/foreman_puppet.edit.po +28 -28
  32. data/locale/es/foreman_puppet.edit.po +28 -28
  33. data/locale/foreman_puppet.pot +39 -33
  34. data/locale/fr/foreman_puppet.edit.po +28 -28
  35. data/locale/gl/foreman_puppet.edit.po +28 -28
  36. data/locale/it/foreman_puppet.edit.po +28 -28
  37. data/locale/ja/foreman_puppet.edit.po +28 -28
  38. data/locale/ka/foreman_puppet.edit.po +28 -28
  39. data/locale/ko/foreman_puppet.edit.po +28 -28
  40. data/locale/nl_NL/foreman_puppet.edit.po +28 -28
  41. data/locale/pl/foreman_puppet.edit.po +28 -28
  42. data/locale/pt_BR/foreman_puppet.edit.po +28 -28
  43. data/locale/ru/foreman_puppet.edit.po +28 -28
  44. data/locale/sv_SE/foreman_puppet.edit.po +28 -28
  45. data/locale/zh_CN/foreman_puppet.edit.po +28 -28
  46. data/locale/zh_TW/foreman_puppet.edit.po +28 -28
  47. data/test/models/foreman_puppet/host_test.rb +13 -5
  48. metadata +2 -2
@@ -48,23 +48,31 @@ module ForemanPuppet
48
48
  assert_equal results, results2
49
49
  end
50
50
 
51
+ test 'deprecated search by class throws error' do
52
+ exception = assert_raises(Exception) do
53
+ host
54
+ Host.search_for("class = #{host.puppet.puppetclass_names.first}")
55
+ end
56
+ assert_equal("Field 'class' not recognized for searching!", exception.message)
57
+ end
58
+
51
59
  test 'can be found by puppetclass' do
52
60
  host
53
- result = Host.search_for("class = #{host.puppet.puppetclass_names.first}")
61
+ result = Host.search_for("puppetclass = #{host.puppet.puppetclass_names.first}")
54
62
  assert_includes result, host
55
63
  end
56
64
 
57
65
  test 'search by puppetclass returns only host within that puppetclass' do
58
66
  host
59
67
  puppetclass = FactoryBot.create(:puppetclass)
60
- result = Host.search_for("class = #{puppetclass.name}")
68
+ result = Host.search_for("puppetclass = #{puppetclass.name}")
61
69
  assert_not_includes result, host
62
70
  end
63
71
 
64
72
  test 'search hosts by inherited puppetclass from a hostgroup' do
65
73
  hostgroup = FactoryBot.create(:hostgroup, :with_puppet_enc, :with_puppetclass)
66
74
  host_with_hg = FactoryBot.create(:host, hostgroup: hostgroup)
67
- result = Host.search_for("class = #{hostgroup.puppet.puppetclass_names.first}")
75
+ result = Host.search_for("puppetclass = #{hostgroup.puppet.puppetclass_names.first}")
68
76
  assert_includes result, host_with_hg
69
77
  end
70
78
 
@@ -72,7 +80,7 @@ module ForemanPuppet
72
80
  parent_hg = FactoryBot.create(:hostgroup, :with_puppet_enc, :with_puppetclass)
73
81
  hg = FactoryBot.create(:hostgroup, parent: parent_hg)
74
82
  host = FactoryBot.create(:host, hostgroup: hg)
75
- result = Host.search_for("class = #{parent_hg.puppet.puppetclass_names.first}")
83
+ result = Host.search_for("puppetclass = #{parent_hg.puppet.puppetclass_names.first}")
76
84
  assert_equal 1, result.count
77
85
  assert_includes result, host
78
86
  end
@@ -82,7 +90,7 @@ module ForemanPuppet
82
90
  host = FactoryBot.create(:host, :with_puppet_enc, hostgroup: hostgroup, environment: hostgroup.puppet.environment)
83
91
  config_group = FactoryBot.create(:config_group, :with_puppetclass)
84
92
  hostgroup.puppet.config_groups << config_group
85
- result = Host.search_for("class = #{config_group.puppetclass_names.first}")
93
+ result = Host.search_for("puppetclass = #{config_group.puppetclass_names.first}")
86
94
  assert_equal 1, result.count
87
95
  assert_includes result, host
88
96
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.1
4
+ version: 6.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Ezr
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-08-10 00:00:00.000000000 Z
12
+ date: 2023-12-01 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Allow assigning Puppet environments and classes to the Foreman Hosts.
15
15
  email: