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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ddb41ece0ec9add7b77e958a35fe39da8ff7588a7cd6bb0900a09bbc5a9853b
4
- data.tar.gz: 5054407779deb586f36b4af5ef98a21031511c3f195d8365a2525fe2a5668de8
3
+ metadata.gz: 834756820191b5727c348fc6634bd16ba92814c724162acb08de5319c56bf396
4
+ data.tar.gz: 28bdc4e212e0a28abfc12408cab07b99dd1c13a65bef9a24db8d5fda8f289870
5
5
  SHA512:
6
- metadata.gz: c6c095009c3211f066ac1966190edf4598715c636a176ae824eccf3218f85a606c88f89672dd4cb4e6154b9b9a4fe58255e1799f214a5df8848b9e6a6656266d
7
- data.tar.gz: a3711124b1bfc9659070261f9a8aaa4ba4a6de3dc2c021967f80d481b29b35a582b12153ad27cc7a7d32c887c3733ef1550edcad43ee37054640b351250ee219
6
+ metadata.gz: 8b6484c60362fde0b41be50af04fc57cc3a7d14f9cde9fce6de2429657139ba7c3bf78a1dfaf98ead3b09aeecdbc53e2e639a213b02e7dd7425622c9dcf04314
7
+ data.tar.gz: da5b35f5796b9490597fff93c0938d94bfb39b557ea686146e20301173468b1e8bfce20272930e0b2a258b9eb2f51e58dcbe5a2b29984e44312641a3561d75e0
@@ -481,6 +481,9 @@
481
481
  "Changed environments": [
482
482
  ""
483
483
  ],
484
+ "Puppet Environments": [
485
+ "Entorns de Puppet"
486
+ ],
484
487
  "Select the changes you want to apply to Foreman": [
485
488
  ""
486
489
  ],
@@ -589,9 +592,6 @@
589
592
  "Organizations": [
590
593
  "Organitzacions"
591
594
  ],
592
- "Puppet Environments": [
593
- "Entorns de Puppet"
594
- ],
595
595
  "Environment|Name": [
596
596
  "Nom"
597
597
  ],
@@ -481,6 +481,9 @@
481
481
  "Changed environments": [
482
482
  "Změněná prostředí"
483
483
  ],
484
+ "Puppet Environments": [
485
+ "Puppet prostředí"
486
+ ],
484
487
  "Select the changes you want to apply to Foreman": [
485
488
  "Vyberte změny které chcete uplatnit na Forman"
486
489
  ],
@@ -589,9 +592,6 @@
589
592
  "Organizations": [
590
593
  "Organizace"
591
594
  ],
592
- "Puppet Environments": [
593
- "Puppet prostředí"
594
- ],
595
595
  "Environment|Name": [
596
596
  "Environment|Název"
597
597
  ],
@@ -481,6 +481,9 @@
481
481
  "Changed environments": [
482
482
  "Geänderte Umgebungen"
483
483
  ],
484
+ "Puppet Environments": [
485
+ "Puppet-Umgebungen"
486
+ ],
484
487
  "Select the changes you want to apply to Foreman": [
485
488
  "Wählen Sie die Änderungen, die Sie in Foreman anwenden möchten"
486
489
  ],
@@ -589,9 +592,6 @@
589
592
  "Organizations": [
590
593
  "Organisationen"
591
594
  ],
592
- "Puppet Environments": [
593
- "Puppet-Umgebungen"
594
- ],
595
595
  "Environment|Name": [
596
596
  "Name"
597
597
  ],
@@ -481,6 +481,9 @@
481
481
  "Changed environments": [
482
482
  ""
483
483
  ],
484
+ "Puppet Environments": [
485
+ ""
486
+ ],
484
487
  "Select the changes you want to apply to Foreman": [
485
488
  ""
486
489
  ],
@@ -589,9 +592,6 @@
589
592
  "Organizations": [
590
593
  ""
591
594
  ],
592
- "Puppet Environments": [
593
- ""
594
- ],
595
595
  "Environment|Name": [
596
596
  ""
597
597
  ],
@@ -481,6 +481,9 @@
481
481
  "Changed environments": [
482
482
  ""
483
483
  ],
484
+ "Puppet Environments": [
485
+ ""
486
+ ],
484
487
  "Select the changes you want to apply to Foreman": [
485
488
  ""
486
489
  ],
@@ -589,9 +592,6 @@
589
592
  "Organizations": [
590
593
  "Organisations"
591
594
  ],
592
- "Puppet Environments": [
593
- ""
594
- ],
595
595
  "Environment|Name": [
596
596
  "Name"
597
597
  ],
@@ -481,6 +481,9 @@
481
481
  "Changed environments": [
482
482
  "Entornos modificados"
483
483
  ],
484
+ "Puppet Environments": [
485
+ "Entornos Puppet"
486
+ ],
484
487
  "Select the changes you want to apply to Foreman": [
485
488
  "Seleccione los cambios que desea aplicar a Foreman"
486
489
  ],
@@ -589,9 +592,6 @@
589
592
  "Organizations": [
590
593
  "Organizaciones"
591
594
  ],
592
- "Puppet Environments": [
593
- "Entornos Puppet"
594
- ],
595
595
  "Environment|Name": [
596
596
  "Nombre"
597
597
  ],
@@ -483,6 +483,9 @@
483
483
  "Changed environments": [
484
484
  "Environnements modifiés"
485
485
  ],
486
+ "Puppet Environments": [
487
+ "Environnements Puppet"
488
+ ],
486
489
  "Select the changes you want to apply to Foreman": [
487
490
  "Sélectionner les changements que vous souhaitez appliquer à Foreman"
488
491
  ],
@@ -591,9 +594,6 @@
591
594
  "Organizations": [
592
595
  "Organisations"
593
596
  ],
594
- "Puppet Environments": [
595
- "Environnements Puppet"
596
- ],
597
597
  "Environment|Name": [
598
598
  "Nom"
599
599
  ],
@@ -481,6 +481,9 @@
481
481
  "Changed environments": [
482
482
  ""
483
483
  ],
484
+ "Puppet Environments": [
485
+ "Entornos Puppet"
486
+ ],
484
487
  "Select the changes you want to apply to Foreman": [
485
488
  ""
486
489
  ],
@@ -589,9 +592,6 @@
589
592
  "Organizations": [
590
593
  "Organizacións"
591
594
  ],
592
- "Puppet Environments": [
593
- "Entornos Puppet"
594
- ],
595
595
  "Environment|Name": [
596
596
  "Nome"
597
597
  ],
@@ -481,6 +481,9 @@
481
481
  "Changed environments": [
482
482
  "Ambienti modificati"
483
483
  ],
484
+ "Puppet Environments": [
485
+ "Ambienti del puppet"
486
+ ],
484
487
  "Select the changes you want to apply to Foreman": [
485
488
  ""
486
489
  ],
@@ -589,9 +592,6 @@
589
592
  "Organizations": [
590
593
  "Organizzazioni"
591
594
  ],
592
- "Puppet Environments": [
593
- "Ambienti del puppet"
594
- ],
595
595
  "Environment|Name": [
596
596
  "Nome"
597
597
  ],
@@ -479,6 +479,9 @@
479
479
  "Changed environments": [
480
480
  "変更済みの環境"
481
481
  ],
482
+ "Puppet Environments": [
483
+ "Puppet 環境"
484
+ ],
482
485
  "Select the changes you want to apply to Foreman": [
483
486
  "Foreman に適用する変更を選択してください"
484
487
  ],
@@ -587,9 +590,6 @@
587
590
  "Organizations": [
588
591
  "組織"
589
592
  ],
590
- "Puppet Environments": [
591
- "Puppet 環境"
592
- ],
593
593
  "Environment|Name": [
594
594
  "名前"
595
595
  ],
@@ -481,6 +481,9 @@
481
481
  "Changed environments": [
482
482
  "შეცვლილი გარემოები"
483
483
  ],
484
+ "Puppet Environments": [
485
+ "Puppet-ის გარემოები"
486
+ ],
484
487
  "Select the changes you want to apply to Foreman": [
485
488
  "აირჩიეთ ცვლილებები, რომლებიც გნებავთ Foreman-ს გადაატაროთ"
486
489
  ],
@@ -589,9 +592,6 @@
589
592
  "Organizations": [
590
593
  "ორგანიზაციები"
591
594
  ],
592
- "Puppet Environments": [
593
- "Puppet-ის გარემოები"
594
- ],
595
595
  "Environment|Name": [
596
596
  "გარემო|სახელი"
597
597
  ],
@@ -481,6 +481,9 @@
481
481
  "Changed environments": [
482
482
  "변경된 환경 "
483
483
  ],
484
+ "Puppet Environments": [
485
+ "Puppet 환경"
486
+ ],
484
487
  "Select the changes you want to apply to Foreman": [
485
488
  ""
486
489
  ],
@@ -589,9 +592,6 @@
589
592
  "Organizations": [
590
593
  "조직"
591
594
  ],
592
- "Puppet Environments": [
593
- "Puppet 환경"
594
- ],
595
595
  "Environment|Name": [
596
596
  "이름 "
597
597
  ],
@@ -481,6 +481,9 @@
481
481
  "Changed environments": [
482
482
  "Gewijzigde omgevingen"
483
483
  ],
484
+ "Puppet Environments": [
485
+ ""
486
+ ],
484
487
  "Select the changes you want to apply to Foreman": [
485
488
  ""
486
489
  ],
@@ -589,9 +592,6 @@
589
592
  "Organizations": [
590
593
  ""
591
594
  ],
592
- "Puppet Environments": [
593
- ""
594
- ],
595
595
  "Environment|Name": [
596
596
  ""
597
597
  ],
@@ -481,6 +481,9 @@
481
481
  "Changed environments": [
482
482
  "Zmieniono środowisko"
483
483
  ],
484
+ "Puppet Environments": [
485
+ "Środowiska Puppet"
486
+ ],
484
487
  "Select the changes you want to apply to Foreman": [
485
488
  ""
486
489
  ],
@@ -589,9 +592,6 @@
589
592
  "Organizations": [
590
593
  "Organizacje"
591
594
  ],
592
- "Puppet Environments": [
593
- "Środowiska Puppet"
594
- ],
595
595
  "Environment|Name": [
596
596
  "Środowisko|Nazwa"
597
597
  ],
@@ -481,6 +481,9 @@
481
481
  "Changed environments": [
482
482
  "Ambientes modificados"
483
483
  ],
484
+ "Puppet Environments": [
485
+ "Ambientes Puppet"
486
+ ],
484
487
  "Select the changes you want to apply to Foreman": [
485
488
  "Selecione as alterações que deseja aplicar ao Foreman"
486
489
  ],
@@ -589,9 +592,6 @@
589
592
  "Organizations": [
590
593
  "Organizações"
591
594
  ],
592
- "Puppet Environments": [
593
- "Ambientes Puppet"
594
- ],
595
595
  "Environment|Name": [
596
596
  "Nome"
597
597
  ],
@@ -481,6 +481,9 @@
481
481
  "Changed environments": [
482
482
  "Изменение окружений"
483
483
  ],
484
+ "Puppet Environments": [
485
+ "Окружения Puppet"
486
+ ],
484
487
  "Select the changes you want to apply to Foreman": [
485
488
  ""
486
489
  ],
@@ -589,9 +592,6 @@
589
592
  "Organizations": [
590
593
  "Организации"
591
594
  ],
592
- "Puppet Environments": [
593
- "Окружения Puppet"
594
- ],
595
595
  "Environment|Name": [
596
596
  "Имя"
597
597
  ],
@@ -481,6 +481,9 @@
481
481
  "Changed environments": [
482
482
  "Ändrade miljöer"
483
483
  ],
484
+ "Puppet Environments": [
485
+ "Puppet Miljöer"
486
+ ],
484
487
  "Select the changes you want to apply to Foreman": [
485
488
  ""
486
489
  ],
@@ -589,9 +592,6 @@
589
592
  "Organizations": [
590
593
  "Organisationer"
591
594
  ],
592
- "Puppet Environments": [
593
- "Puppet Miljöer"
594
- ],
595
595
  "Environment|Name": [
596
596
  "Namn"
597
597
  ],
@@ -479,6 +479,9 @@
479
479
  "Changed environments": [
480
480
  "修改的环境"
481
481
  ],
482
+ "Puppet Environments": [
483
+ "Puppet 环境"
484
+ ],
482
485
  "Select the changes you want to apply to Foreman": [
483
486
  "选择您要应用到 Foreman 的更改"
484
487
  ],
@@ -587,9 +590,6 @@
587
590
  "Organizations": [
588
591
  "机构"
589
592
  ],
590
- "Puppet Environments": [
591
- "Puppet 环境"
592
- ],
593
593
  "Environment|Name": [
594
594
  "名称"
595
595
  ],
@@ -481,6 +481,9 @@
481
481
  "Changed environments": [
482
482
  "已更改的環境"
483
483
  ],
484
+ "Puppet Environments": [
485
+ "Puppet 環境"
486
+ ],
484
487
  "Select the changes you want to apply to Foreman": [
485
488
  ""
486
489
  ],
@@ -589,9 +592,6 @@
589
592
  "Organizations": [
590
593
  "組織"
591
594
  ],
592
- "Puppet Environments": [
593
- "Puppet 環境"
594
- ],
595
595
  "Environment|Name": [
596
596
  "名稱"
597
597
  ],
@@ -13,8 +13,6 @@ module ForemanPuppet
13
13
  include_in_clone puppet: %i[config_groups host_config_groups host_classes]
14
14
 
15
15
  scoped_search relation: :environment, on: :name, complete_value: true, rename: :environment
16
- scoped_search relation: :puppetclasses, on: :name, complete_value: true, rename: :class, only_explicit: true, operators: ['= ', '~ '],
17
- ext_method: :search_by_deprecated_class
18
16
  scoped_search relation: :puppetclasses, on: :name, complete_value: true, rename: :puppetclass, only_explicit: true, operators: ['= ', '~ '],
19
17
  ext_method: :search_by_puppetclass
20
18
  scoped_search relation: :config_groups, on: :name, complete_value: true, rename: :config_group, only_explicit: true, operators: ['= ', '~ '],
@@ -22,11 +20,6 @@ module ForemanPuppet
22
20
  end
23
21
 
24
22
  class_methods do
25
- def search_by_deprecated_class(key, operator, value)
26
- Foreman::Deprecation.deprecation_warning('3.2', 'search by `class` has been deprecated, please search by `puppetclass` instead')
27
- search_by_puppetclass(key, operator, value)
28
- end
29
-
30
23
  def search_by_puppetclass(_key, operator, value)
31
24
  conditions = sanitize_sql_for_conditions(["puppetclasses.name #{operator} ?", value_to_sql(operator, value)])
32
25
  config_group_ids = ForemanPuppet::ConfigGroup.joins(:puppetclasses).where(conditions).pluck(:id)
@@ -16,7 +16,12 @@ module ForemanPuppet
16
16
 
17
17
  # will need through relation to work properly
18
18
  scoped_search relation: :environment, on: :name, complete_value: true, rename: :environment, only_explicit: true
19
- scoped_search relation: :puppetclasses, on: :name, complete_value: true, rename: :class, only_explicit: true, operators: ['= ', '~ ']
19
+ scoped_search relation: :puppetclasses, on: :name,
20
+ complete_value: true,
21
+ rename: :puppetclass,
22
+ only_explicit: true,
23
+ operators: ['= ', '~ '],
24
+ ext_method: :search_by_puppetclass
20
25
  scoped_search relation: :config_groups, on: :name,
21
26
  complete_value: true,
22
27
  rename: :config_group,
@@ -29,11 +34,22 @@ module ForemanPuppet
29
34
  module PatchedClassMethods
30
35
  def search_by_config_group(_key, operator, value)
31
36
  conditions = sanitize_sql_for_conditions(["config_groups.name #{operator} ?", value_to_sql(operator, value)])
32
- hostgroup_ids = ::Hostgroup.unscoped.with_taxonomy_scope.joins(puppet: :config_groups).where(conditions).map(&:subtree_ids).flatten.uniq
37
+ hostgroup_ids = ::Hostgroup.joins(puppet: :config_groups).where(conditions).map(&:subtree_ids).flatten.uniq
38
+
39
+ conds = 'hostgroups.id < 0'
40
+ conds = "hostgroups.id IN(#{hostgroup_ids.join(',')})" if hostgroup_ids.present?
41
+
42
+ { conditions: conds }
43
+ end
44
+
45
+ def search_by_puppetclass(_key, operator, value)
46
+ conditions = sanitize_sql_for_conditions(["puppetclasses.name #{operator} ?", value_to_sql(operator, value)])
47
+ hostgroup_ids = ::Hostgroup.joins(puppet: :puppetclasses).where(conditions).map(&:subtree_ids)
48
+
49
+ conds = []
50
+ conds << "hostgroups.id IN (#{hostgroup_ids.join(',')})" if hostgroup_ids.present?
33
51
 
34
- opts = 'hostgroups.id < 0'
35
- opts = "hostgroups.id IN(#{hostgroup_ids.join(',')})" if hostgroup_ids.present?
36
- { conditions: opts }
52
+ { conditions: conds.join(' OR ').presence || 'hostgroups.id < 0' }
37
53
  end
38
54
  end
39
55
  end
@@ -17,7 +17,7 @@ module ForemanPuppet
17
17
  validates :name, presence: true, uniqueness: true
18
18
 
19
19
  scoped_search on: :name, complete_value: true
20
- scoped_search relation: :puppetclasses, on: :name, complete_value: true, rename: :class, only_explicit: true, operators: ['= ', '~ ']
20
+ scoped_search relation: :puppetclasses, on: :name, complete_value: true, rename: :puppetclass, only_explicit: true, operators: ['= ', '~ ']
21
21
 
22
22
  default_scope -> { order('config_groups.name') }
23
23
 
@@ -7,9 +7,8 @@
7
7
  <% end %>
8
8
 
9
9
  <% content_for(:content) do %>
10
- <%= notifications %>
11
10
  <div id="organization-id" data-id="<%= Organization.current.id if Organization.current %>" ></div>
12
11
  <div id="user-id" data-id="<%= User.current.id if User.current %>" ></div>
13
12
  <%= react_component('ForemanPuppet') %>
14
13
  <% end %>
15
- <%= render file: "layouts/base" %>
14
+ <%= render template: "layouts/base" %>
@@ -1,3 +1,3 @@
1
1
  module ForemanPuppet
2
- VERSION = '6.0.1'.freeze
2
+ VERSION = '6.1.1'.freeze
3
3
  end
data/locale/Makefile CHANGED
@@ -6,8 +6,8 @@
6
6
  # make tx-update - download and merge translations from Transifex
7
7
  # make clean - clean everything
8
8
  #
9
- DOMAIN = foreman_puppet
10
- VERSION = $(shell ruby -e 'require "rubygems";spec = Gem::Specification::load(Dir.glob("../*.gemspec")[0]);puts spec.version')
9
+ DOMAIN = $(shell ruby -rrubygems -e 'puts Gem::Specification::load(Dir.glob("../*.gemspec")[0]).name')
10
+ VERSION = $(shell ruby -rrubygems -e 'puts Gem::Specification::load(Dir.glob("../*.gemspec")[0]).version')
11
11
  POTFILE = $(DOMAIN).pot
12
12
  MOFILE = $(DOMAIN).mo
13
13
  POFILES = $(shell find . -name '$(DOMAIN).po')
@@ -43,7 +43,7 @@ uniq-po:
43
43
  done
44
44
 
45
45
  tx-pull: $(EDITFILES)
46
- cd .. && tx pull -f
46
+ cd .. && tx pull -f --all
47
47
  for f in $(EDITFILES) ; do \
48
48
  sed -i 's/^\("Project-Id-Version: \).*$$/\1$(DOMAIN) $(VERSION)\\n"/' $$f; \
49
49
  done