foreman_puppet 2.0.3 → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -1
  3. data/app/controllers/concerns/foreman_puppet/extensions/api_smart_proxies_controller.rb +7 -2
  4. data/app/controllers/concerns/foreman_puppet/extensions/hosts_controller_extensions.rb +1 -1
  5. data/app/models/concerns/foreman_puppet/extensions/provisioning_template.rb +1 -1
  6. data/app/services/foreman_puppet/host_info_providers/puppet_info.rb +1 -1
  7. data/app/views/foreman_puppet/config_groups/_config_group.html.erb +5 -1
  8. data/app/views/hosts/_form_puppet_enc_tab.html.erb +5 -4
  9. data/lib/foreman_puppet/version.rb +1 -1
  10. data/locale/ca/LC_MESSAGES/foreman_puppet.mo +0 -0
  11. data/locale/ca/foreman_puppet.edit.po +1095 -0
  12. data/locale/ca/foreman_puppet.po +70 -1
  13. data/locale/ca/foreman_puppet.po.time_stamp +0 -0
  14. data/locale/cs_CZ/LC_MESSAGES/foreman_puppet.mo +0 -0
  15. data/locale/cs_CZ/foreman_puppet.edit.po +199 -184
  16. data/locale/cs_CZ/foreman_puppet.po +13 -2
  17. data/locale/de/LC_MESSAGES/foreman_puppet.mo +0 -0
  18. data/locale/de/foreman_puppet.edit.po +1122 -0
  19. data/locale/de/foreman_puppet.po +25 -13
  20. data/locale/de/foreman_puppet.po.time_stamp +0 -0
  21. data/locale/en/LC_MESSAGES/foreman_puppet.mo +0 -0
  22. data/locale/en/foreman_puppet.edit.po +33 -25
  23. data/locale/en/foreman_puppet.po +13 -1
  24. data/locale/en_GB/LC_MESSAGES/foreman_puppet.mo +0 -0
  25. data/locale/en_GB/foreman_puppet.edit.po +1097 -0
  26. data/locale/en_GB/foreman_puppet.po +13 -2
  27. data/locale/en_GB/foreman_puppet.po.time_stamp +0 -0
  28. data/locale/es/LC_MESSAGES/foreman_puppet.mo +0 -0
  29. data/locale/es/foreman_puppet.edit.po +1104 -0
  30. data/locale/es/foreman_puppet.po +13 -2
  31. data/locale/es/foreman_puppet.po.time_stamp +0 -0
  32. data/locale/foreman_puppet.pot +48 -25
  33. data/locale/fr/LC_MESSAGES/foreman_puppet.mo +0 -0
  34. data/locale/fr/foreman_puppet.edit.po +1112 -0
  35. data/locale/fr/foreman_puppet.po +13 -2
  36. data/locale/fr/foreman_puppet.po.time_stamp +0 -0
  37. data/locale/gl/LC_MESSAGES/foreman_puppet.mo +0 -0
  38. data/locale/gl/foreman_puppet.edit.po +1095 -0
  39. data/locale/gl/foreman_puppet.po +13 -2
  40. data/locale/gl/foreman_puppet.po.time_stamp +0 -0
  41. data/locale/it/LC_MESSAGES/foreman_puppet.mo +0 -0
  42. data/locale/it/foreman_puppet.edit.po +1099 -0
  43. data/locale/it/foreman_puppet.po +13 -2
  44. data/locale/it/foreman_puppet.po.time_stamp +0 -0
  45. data/locale/ja/LC_MESSAGES/foreman_puppet.mo +0 -0
  46. data/locale/ja/foreman_puppet.edit.po +1107 -0
  47. data/locale/ja/foreman_puppet.po +15 -4
  48. data/locale/ja/foreman_puppet.po.time_stamp +0 -0
  49. data/locale/ko/LC_MESSAGES/foreman_puppet.mo +0 -0
  50. data/locale/ko/foreman_puppet.edit.po +1096 -0
  51. data/locale/ko/foreman_puppet.po +13 -2
  52. data/locale/ko/foreman_puppet.po.time_stamp +0 -0
  53. data/locale/nl_NL/LC_MESSAGES/foreman_puppet.mo +0 -0
  54. data/locale/nl_NL/foreman_puppet.edit.po +1100 -0
  55. data/locale/nl_NL/foreman_puppet.po +13 -2
  56. data/locale/nl_NL/foreman_puppet.po.time_stamp +0 -0
  57. data/locale/pl/LC_MESSAGES/foreman_puppet.mo +0 -0
  58. data/locale/pl/foreman_puppet.edit.po +1099 -0
  59. data/locale/pl/foreman_puppet.po +13 -2
  60. data/locale/pl/foreman_puppet.po.time_stamp +0 -0
  61. data/locale/pt_BR/LC_MESSAGES/foreman_puppet.mo +0 -0
  62. data/locale/pt_BR/foreman_puppet.edit.po +1103 -0
  63. data/locale/pt_BR/foreman_puppet.po +13 -2
  64. data/locale/pt_BR/foreman_puppet.po.time_stamp +0 -0
  65. data/locale/ru/LC_MESSAGES/foreman_puppet.mo +0 -0
  66. data/locale/ru/foreman_puppet.edit.po +1104 -0
  67. data/locale/ru/foreman_puppet.po +15 -4
  68. data/locale/ru/foreman_puppet.po.time_stamp +0 -0
  69. data/locale/sv_SE/LC_MESSAGES/foreman_puppet.mo +0 -0
  70. data/locale/sv_SE/foreman_puppet.edit.po +1099 -0
  71. data/locale/sv_SE/foreman_puppet.po +13 -2
  72. data/locale/sv_SE/foreman_puppet.po.time_stamp +0 -0
  73. data/locale/zh_CN/LC_MESSAGES/foreman_puppet.mo +0 -0
  74. data/locale/zh_CN/foreman_puppet.edit.po +1108 -0
  75. data/locale/zh_CN/foreman_puppet.po +16 -5
  76. data/locale/zh_CN/foreman_puppet.po.time_stamp +0 -0
  77. data/locale/zh_TW/LC_MESSAGES/foreman_puppet.mo +0 -0
  78. data/locale/zh_TW/foreman_puppet.edit.po +1098 -0
  79. data/locale/zh_TW/foreman_puppet.po +13 -2
  80. data/locale/zh_TW/foreman_puppet.po.time_stamp +0 -0
  81. data/test/controllers/foreman_puppet/api/v2/environments_controller_test.rb +24 -18
  82. data/test/controllers/foreman_puppet/api/v2/hosts_controller_test.rb +10 -0
  83. data/test/controllers/foreman_puppet/api/v2/smart_class_parameters_controller_test.rb +2 -2
  84. data/test/controllers/foreman_puppet/environments_controller_test.rb +1 -1
  85. data/test/controllers/foreman_puppet/hosts_controller_test.rb +4 -27
  86. data/test/graphql/queries/environment_query_test.rb +4 -4
  87. data/test/graphql/queries/puppetclass_query_test.rb +4 -4
  88. data/test/integration/foreman_puppet/dashboard_js_test.rb +1 -2
  89. data/test/integration/foreman_puppet/environment_js_test.rb +1 -2
  90. data/test/integration/foreman_puppet/host_js_test.rb +31 -27
  91. data/test/integration/foreman_puppet/hostgroup_js_test.rb +1 -2
  92. data/test/integration/foreman_puppet/puppetclass_js_test.rb +1 -2
  93. data/test/integration/foreman_puppet/smartclass_parameter_js_test.rb +1 -2
  94. data/test/integration_puppet_helper.rb +3 -0
  95. data/test/models/foreman_puppet/host_puppet_facet_test.rb +13 -2
  96. data/test/models/foreman_puppet/host_test.rb +22 -22
  97. data/test/models/foreman_puppet/provisioning_template_test.rb +3 -3
  98. data/test/models/foreman_puppet/puppetclass_test.rb +1 -1
  99. data/test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb +1 -1
  100. data/test/services/foreman_puppet/host_info_providers/puppet_info_test.rb +3 -3
  101. data/test/unit/foreman_puppet/template_rendering_test.rb +1 -1
  102. metadata +36 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 83861f53b9f2944dda945591b245097569b4477df77ed2760f42cb1d92bd3ed0
4
- data.tar.gz: 620b8fb7524015970cd4aa1e42ea130483434ccb0af7474a1a4ca23ca8d8199f
3
+ metadata.gz: 58ee61350aa65a2356723d032bbc56f894d2d00453f58fe01a6c5e9e05909c86
4
+ data.tar.gz: 1df9c5d674dea6b7bb5316c843925998fa748c77d3cb07864ebb399c46672421
5
5
  SHA512:
6
- metadata.gz: 9ac189449b5b6f819e82ee4f14dbccfdf0da012dd0a8345441225b76f062912a9b3f184bc7f2c87715dd5e460d1deadc6943f45e060a4bf109d8d3ba87ce8bc7
7
- data.tar.gz: 13157df73faa3eb07f8e1299ad9367bd09d6292e45ff59741d2c6e108542bb239ad25ba04eb8fae97125b54cba6f452248c91b9bddffda1c0829b2e8953fdb57
6
+ metadata.gz: c2be066de5444cd669b80687eaa7f8d1cf9a0735a01a739ff2daa464144b5015e0501d602afe881a3cb04915d1ea5202531b065a630b45b72df1e19dea2fc66a
7
+ data.tar.gz: f43cf893d84772b5b38ba13eff4a2e5c1b7a0374bfecf5fa69fba18b8197744bfe1f7b51a7f4983949f56c799bdf97b6b04f59d6a44e7d9210fbe64f4642071a
data/README.md CHANGED
@@ -37,7 +37,9 @@ You can install it on Foreman 2.5 to prepare for the Foreman update.
37
37
 
38
38
  |Foreman version|Plugin version|Notes |
39
39
  |---------------|--------------|------------------------------------------|
40
- | >= 3.0 | ~> 1.0 | Required |
40
+ | >= 3.2 | ~> 3.0 | Required |
41
+ | ~> 3.1 | ~> 2.0 | Required |
42
+ | ~> 3.0 | ~> 1.0 | Required |
41
43
  | >= 2.5 | ~> 0.1 | Optional; replaces Core features |
42
44
  | < 2.5 | - | Not supported (functionality is in Core) |
43
45
 
@@ -3,6 +3,8 @@ module ForemanPuppet
3
3
  module ApiSmartProxiesController
4
4
  extend ActiveSupport::Concern
5
5
 
6
+ NewEnvironment = Struct.new('Environment', :name)
7
+
6
8
  included do
7
9
  before_action :find_required_puppet_proxy, only: [:import_puppetclasses]
8
10
  before_action :find_environment_id, only: [:import_puppetclasses]
@@ -70,7 +72,7 @@ module ForemanPuppet
70
72
  @changed['updated'].keys + @changed['ignored'].keys).uniq.sort
71
73
 
72
74
  @environments = environment_names.map do |name|
73
- OpenStruct.new(name: name)
75
+ NewEnvironment.new(name)
74
76
  end
75
77
 
76
78
  unless @environments.any?
@@ -87,6 +89,7 @@ module ForemanPuppet
87
89
  @environments.any?
88
90
  end
89
91
 
92
+ # rubocop:disable Metrics/MethodLength
90
93
  def import_changed_proxy_environments
91
94
  opts = { url: @smart_proxy.url }
92
95
  opts[:env] = if @environment.present?
@@ -98,7 +101,8 @@ module ForemanPuppet
98
101
  changed = @importer.changes
99
102
 
100
103
  # check if environemnt id passed in URL is name of NEW environment in puppetmaster that doesn't exist in db
101
- if @environment || (changed['new'].key?(@env_id) && (@environment ||= OpenStruct.new(name: @env_id)))
104
+ @environment ||= NewEnvironment.new(@env_id) if changed['new'].key?(@env_id)
105
+ if @environment
102
106
  # only return :keys equal to @environment in @changed hash
103
107
  %w[new obsolete updated ignored].each do |kind|
104
108
  changed[kind].slice!(@environment.name) unless changed[kind].empty?
@@ -115,6 +119,7 @@ module ForemanPuppet
115
119
  render_message(msg, status: :internal_server_error)
116
120
  nil
117
121
  end
122
+ # rubocop:enable Metrics/MethodLength
118
123
 
119
124
  def find_required_puppet_proxy
120
125
  id = params.key?('smart_proxy_id') ? params['smart_proxy_id'] : params['id']
@@ -3,7 +3,7 @@ module ForemanPuppet
3
3
  module HostsControllerExtensions
4
4
  extend ActiveSupport::Concern
5
5
 
6
- PUPPETMASTER_ACTIONS = %i[externalNodes lookup].freeze
6
+ PUPPETMASTER_ACTIONS = %i[externalNodes].freeze
7
7
  PUPPET_AJAX_REQUESTS = %w[hostgroup_or_environment_selected puppetclass_parameters].freeze
8
8
 
9
9
  MULTIPLE_EDIT_ACTIONS = %w[select_multiple_environment update_multiple_environment
@@ -5,7 +5,7 @@ module ForemanPuppet
5
5
 
6
6
  included do
7
7
  has_many :environments, through: :template_combinations
8
- before_destroy ActiveRecord::Base::EnsureNotUsedBy.new(:environments)
8
+ before_destroy EnsureNotUsedBy.new(:environments)
9
9
 
10
10
  scoped_search relation: :environments, on: :name, rename: :environment, complete_value: true
11
11
 
@@ -45,7 +45,7 @@ module ForemanPuppet
45
45
  end
46
46
 
47
47
  def ca_defined?
48
- SETTINGS[:unattended] && host.puppetca_exists?
48
+ host.puppetca_exists?
49
49
  end
50
50
 
51
51
  def has_environment?
@@ -1,4 +1,8 @@
1
- <%= content_tag_for :li, config_group, (added ? :selected : nil), :id => "config_group_#{config_group.id}", :class => css_class.to_s do %>
1
+ <%
2
+ li_id = "#{added ? 'selected_' : '' }config_group_#{config_group.id}"
3
+ li_class = "#{added ? 'selected_config_group' : 'config_group'} #{css_class}"
4
+ %>
5
+ <%= content_tag :li, id: li_id, class: li_class do %>
2
6
  <%= hidden_field_tag("#{type}[config_group_ids][]", config_group.id) if added == 'manually' %>
3
7
  <span>
4
8
  <%= link_to(icon_text('plus', config_group.name), '#', :rel=>'twipsy', :class => 'config_group_name',
@@ -11,13 +11,14 @@
11
11
  <% end %>
12
12
 
13
13
  <%= render 'foreman_puppet/puppetclasses/class_selection', obj: obj, resource_type: resource_type %>
14
+
15
+ <fieldset id="puppet_klasses_parameters" data-url="<%= foreman_puppet.url_for(controller: resource_type.to_s.pluralize.to_sym, action: :puppetclass_parameters, only_path: true) %>">
16
+ <h2><%= _('Puppet Class Parameters') %></h2>
17
+ <%= render 'foreman_puppet/puppetclasses/classes_parameters', obj: subject %>
18
+ </fieldset>
14
19
  <% else %>
15
20
  <%= alert(class: alert_class(:info),
16
21
  header: _('Notice'),
17
22
  text: _('Please select an environment first')) %>
18
23
  <% end %>
19
24
 
20
- <fieldset id="puppet_klasses_parameters" data-url="<%= foreman_puppet.url_for(controller: resource_type.to_s.pluralize.to_sym, action: :puppetclass_parameters, only_path: true) %>">
21
- <h2><%= _('Puppet Class Parameters') %></h2>
22
- <%= render 'foreman_puppet/puppetclasses/classes_parameters', obj: subject %>
23
- </fieldset>
@@ -1,3 +1,3 @@
1
1
  module ForemanPuppet
2
- VERSION = '2.0.3'.freeze
2
+ VERSION = '3.0.3'.freeze
3
3
  end