foreman_openscap 3.0.1 → 4.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/api/v2/compliance/scap_contents_controller.rb +1 -1
  3. data/app/controllers/api/v2/compliance/tailoring_files_controller.rb +1 -1
  4. data/app/controllers/scap_contents_controller.rb +1 -1
  5. data/app/controllers/tailoring_files_controller.rb +1 -1
  6. data/app/models/concerns/foreman_openscap/hostgroup_extensions.rb +4 -12
  7. data/app/models/concerns/foreman_openscap/openscap_proxy_core_extensions.rb +0 -4
  8. data/app/models/foreman_openscap/policy.rb +2 -2
  9. data/db/migrate/20200803065041_migrate_port_overrides_for_ansible.rb +34 -0
  10. data/db/seeds.d/75-job_templates.rb +2 -2
  11. data/lib/foreman_openscap/version.rb +1 -1
  12. data/locale/action_names.rb +2 -7
  13. data/locale/de/LC_MESSAGES/foreman_openscap.mo +0 -0
  14. data/locale/de/foreman_openscap.po +2 -17
  15. data/locale/en_GB/LC_MESSAGES/foreman_openscap.mo +0 -0
  16. data/locale/en_GB/foreman_openscap.po +2 -17
  17. data/locale/es/LC_MESSAGES/foreman_openscap.mo +0 -0
  18. data/locale/es/foreman_openscap.po +1 -16
  19. data/locale/foreman_openscap.pot +6 -26
  20. data/locale/fr/LC_MESSAGES/foreman_openscap.mo +0 -0
  21. data/locale/fr/foreman_openscap.po +1 -16
  22. data/locale/gl/LC_MESSAGES/foreman_openscap.mo +0 -0
  23. data/locale/gl/foreman_openscap.po +2 -17
  24. data/locale/it/LC_MESSAGES/foreman_openscap.mo +0 -0
  25. data/locale/it/foreman_openscap.po +2 -17
  26. data/locale/ja/LC_MESSAGES/foreman_openscap.mo +0 -0
  27. data/locale/ja/foreman_openscap.po +1 -16
  28. data/locale/ko/LC_MESSAGES/foreman_openscap.mo +0 -0
  29. data/locale/ko/foreman_openscap.po +2 -17
  30. data/locale/pt_BR/LC_MESSAGES/foreman_openscap.mo +0 -0
  31. data/locale/pt_BR/foreman_openscap.po +1 -16
  32. data/locale/ru/LC_MESSAGES/foreman_openscap.mo +0 -0
  33. data/locale/ru/foreman_openscap.po +2 -17
  34. data/locale/sv_SE/LC_MESSAGES/foreman_openscap.mo +0 -0
  35. data/locale/sv_SE/foreman_openscap.po +2 -17
  36. data/locale/zh_CN/LC_MESSAGES/foreman_openscap.mo +0 -0
  37. data/locale/zh_CN/foreman_openscap.po +1 -16
  38. data/locale/zh_TW/LC_MESSAGES/foreman_openscap.mo +0 -0
  39. data/locale/zh_TW/foreman_openscap.po +2 -17
  40. data/test/unit/policy_test.rb +9 -0
  41. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c9022cadb1e56bd7bf36523d096543e50bcadb360327e0f930d00a8308774203
4
- data.tar.gz: a1cf2ae2a6bfd3dd77de305ea65312e07ca51ec61ceed96c625e48a170306183
3
+ metadata.gz: f4a4ecc74498e831daaf3b06da9a2ab475c1eac67f34ef698fe7aabc949e7fa3
4
+ data.tar.gz: b917c3d1c392311306404f261541bbabbc63fcabdfb5ee277a25a794eb3cf0f2
5
5
  SHA512:
6
- metadata.gz: 43d354207d9200b8d230312cd6259ff76b27ee75a87bcace113df7b323fad7bc4be4012ea15fd1aa1134fc91e9fff6aa93a2e07deeef2acd4f358e4cd031b63c
7
- data.tar.gz: fda20c152e9bf85fc7a42d85e1d8472386ea8b1fa9fc516373f144019c39cd797db4b49f60312165b154e4c59f63cf948ae7cb364990c020687a28020434b12c
6
+ metadata.gz: 2f50b5057eac300b2f23d006d2523d0a1241d1133ce108a2836f4833a1b491a8b365ba3bb9428b9a120b7c89bf1278274844eb8e02304d2dc8edc37952477629
7
+ data.tar.gz: d7c772636e3a3406cf1df32cdb6521716800acc61b31825ed7a9c1d4819411ca4047aaf43c16c346eb715b83c7778b5b37daf6d41ad38a20b89435be4b5466c0
@@ -51,7 +51,7 @@ module Api::V2
51
51
  param_group :scap_content
52
52
 
53
53
  def update
54
- process_response @scap_content.update_attributes(scap_content_params)
54
+ process_response @scap_content.update(scap_content_params)
55
55
  end
56
56
 
57
57
  api :DELETE, '/compliance/scap_contents/:id', N_('Deletes an SCAP content')
@@ -52,7 +52,7 @@ module Api::V2
52
52
  param_group :tailoring_file
53
53
 
54
54
  def update
55
- process_response @tailoring_file.update_attributes(tailoring_file_params)
55
+ process_response @tailoring_file.update(tailoring_file_params)
56
56
  end
57
57
 
58
58
  api :DELETE, '/compliance/tailoring_files/:id', N_('Deletes a Tailoring file')
@@ -33,7 +33,7 @@ class ScapContentsController < ApplicationController
33
33
  end
34
34
 
35
35
  def update
36
- if @scap_content.update_attributes(scap_content_params)
36
+ if @scap_content.update(scap_content_params)
37
37
  process_success
38
38
  else
39
39
  process_error
@@ -30,7 +30,7 @@ class TailoringFilesController < ApplicationController
30
30
  end
31
31
 
32
32
  def update
33
- if @tailoring_file.update_attributes(tailoring_file_params)
33
+ if @tailoring_file.update(tailoring_file_params)
34
34
  process_success
35
35
  else
36
36
  process_error
@@ -22,18 +22,10 @@ module ForemanOpenscap
22
22
  end
23
23
 
24
24
  def inherited_openscap_proxy_id
25
- inherited_ancestry_attribute(:openscap_proxy_id)
26
- end
27
-
28
- unless defined?(Katello::System)
29
- private
30
-
31
- def inherited_ancestry_attribute(attribute)
32
- if ancestry.present?
33
- self[attribute] || self.class.sort_by_ancestry(ancestors.where("#{attribute} is not NULL")).last.try(attribute)
34
- else
35
- self.send(attribute)
36
- end
25
+ if ancestry.present?
26
+ self[:openscap_proxy_id] || self.class.sort_by_ancestry(ancestors.where.not(openscap_proxy_id: nil)).last.try(:openscap_proxy_id)
27
+ else
28
+ self.send(:openscap_proxy_id)
37
29
  end
38
30
  end
39
31
  end
@@ -33,10 +33,6 @@ module ForemanOpenscap
33
33
  end
34
34
  end
35
35
 
36
- def inherited_openscap_proxy_id
37
- inherited_ancestry_attribute(:openscap_proxy_id)
38
- end
39
-
40
36
  private
41
37
 
42
38
  def scap_client_lookup_values_for(lookup_keys, model_match)
@@ -67,7 +67,7 @@ module ForemanOpenscap
67
67
  ForemanOpenscap::LookupKeyOverrider.new(self).override
68
68
  end
69
69
 
70
- errors.none? && update_attributes(params)
70
+ errors.none? && update(params)
71
71
  end
72
72
  end
73
73
 
@@ -312,7 +312,7 @@ module ForemanOpenscap
312
312
  end
313
313
 
314
314
  def assign_ids(ids, class_name)
315
- new_assets = ids.reject { |id| id.respond_to?(:empty?) && id.empty? }.reduce([]) do |memo, id|
315
+ new_assets = ids.uniq.reject { |id| id.respond_to?(:empty?) && id.empty? }.reduce([]) do |memo, id|
316
316
  memo << assets.where(:assetable_type => class_name, :assetable_id => id).first_or_initialize
317
317
  end
318
318
  complimentary_class_name = class_name == 'Host::Base' ? 'Hostgroup' : 'Host::Base'
@@ -0,0 +1,34 @@
1
+ class MigratePortOverridesForAnsible < ActiveRecord::Migration[6.0]
2
+ def up
3
+ transform_lookup_values :to_i
4
+ end
5
+
6
+ def down
7
+ transform_lookup_values :to_s
8
+ end
9
+
10
+ private
11
+
12
+ def transform_lookup_values(method)
13
+ return unless defined?(ForemanAnsible)
14
+ role = AnsibleRole.find_by :name => 'theforeman.foreman_scap_client'
15
+ return unless role
16
+ port_key = role.ansible_variables.find_by :key => 'foreman_scap_client_port'
17
+ return unless port_key
18
+ if method == :to_i
19
+ port_key.key_type = "integer"
20
+ port_key.default_value = 8080
21
+ else
22
+ port_key.key_type == "string"
23
+ port_key.default_value = ""
24
+ end
25
+
26
+ port_key.save
27
+ port_key.lookup_values.in_batches do |batch|
28
+ batch.each do |lookup_value|
29
+ lookup_value.value = lookup_value.value.send(method)
30
+ lookup_value.save
31
+ end
32
+ end
33
+ end
34
+ end
@@ -7,9 +7,9 @@ if ForemanOpenscap.with_remote_execution?
7
7
  sync = !Rails.env.test? && Setting[:remote_execution_sync_templates]
8
8
  # import! was renamed to import_raw! around 1.3.1
9
9
  if JobTemplate.respond_to?('import_raw!')
10
- template = JobTemplate.import_raw!(File.read(template), :default => true, :locked => true, :update => sync)
10
+ template = JobTemplate.import_raw!(File.read(template), :default => true, :lock => true, :update => sync)
11
11
  else
12
- template = JobTemplate.import!(File.read(template), :default => true, :locked => true, :update => sync)
12
+ template = JobTemplate.import!(File.read(template), :default => true, :lock => true, :update => sync)
13
13
  end
14
14
  template.organizations = organizations if SETTINGS[:organizations_enabled] && template.present?
15
15
  template.locations = locations if SETTINGS[:locations_enabled] && template.present?
@@ -1,3 +1,3 @@
1
1
  module ForemanOpenscap
2
- VERSION = "3.0.1".freeze
2
+ VERSION = "4.0.4".freeze
3
3
  end
@@ -1,10 +1,5 @@
1
1
  # Autogenerated!
2
- _("Import Puppet classes")
3
- _("Remote action:")
4
2
  _("Action with sub plans")
5
3
  _("Import facts")
6
- _("Delete host")
7
- _("Update host")
8
- _("Update node")
9
- _("Create client")
10
- _("Delete client")
4
+ _("Import Puppet classes")
5
+ _("Remote action:")
@@ -11,8 +11,8 @@ msgid ""
11
11
  msgstr ""
12
12
  "Project-Id-Version: Foreman\n"
13
13
  "Report-Msgid-Bugs-To: \n"
14
- "PO-Revision-Date: 2020-02-11 07:20+0000\n"
15
- "Last-Translator: Ludwig B <lbayerlein@lbayerlein.de>\n"
14
+ "PO-Revision-Date: 2020-03-02 20:59+0000\n"
15
+ "Last-Translator: Crited <Alexander.Stoll@netways.de>\n"
16
16
  "Language-Team: German (http://www.transifex.com/foreman/foreman/language/de/)\n"
17
17
  "MIME-Version: 1.0\n"
18
18
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -166,9 +166,6 @@ msgstr "Richtlinie erstellen"
166
166
  msgid "Create a Tailoring file"
167
167
  msgstr ""
168
168
 
169
- msgid "Create client"
170
- msgstr ""
171
-
172
169
  msgid "Dashboard"
173
170
  msgstr "Übersichtsseite"
174
171
 
@@ -190,18 +187,12 @@ msgstr "Richtlinie löschen"
190
187
  msgid "Delete an ARF Report"
191
188
  msgstr "ARF-Bericht löschen"
192
189
 
193
- msgid "Delete client"
194
- msgstr ""
195
-
196
190
  msgid "Delete compliance policy %s with all of its reports?"
197
191
  msgstr "Compliance-Richtline %s löschen mit allen Berichten?"
198
192
 
199
193
  msgid "Delete compliance report for %s?"
200
194
  msgstr "Compliance-Bericht von %s löschen?"
201
195
 
202
- msgid "Delete host"
203
- msgstr ""
204
-
205
196
  msgid "Delete reports"
206
197
  msgstr "Berichte löschen"
207
198
 
@@ -834,12 +825,6 @@ msgstr ""
834
825
  msgid "Update an SCAP content"
835
826
  msgstr "Einen SCAP-Inhalt aktualisieren "
836
827
 
837
- msgid "Update host"
838
- msgstr ""
839
-
840
- msgid "Update node"
841
- msgstr ""
842
-
843
828
  msgid "Updated hosts: Assigned with OpenSCAP Proxy: %s"
844
829
  msgstr "Host aktualisiert: Zugewiesen mit OpenSCAP Proxy: %s"
845
830
 
@@ -7,8 +7,8 @@ msgid ""
7
7
  msgstr ""
8
8
  "Project-Id-Version: Foreman\n"
9
9
  "Report-Msgid-Bugs-To: \n"
10
- "PO-Revision-Date: 2019-12-23 01:05+0000\n"
11
- "Last-Translator: Andi Chandler <andi@gowling.com>\n"
10
+ "PO-Revision-Date: 2020-03-02 20:59+0000\n"
11
+ "Last-Translator: Lukáš Zapletal\n"
12
12
  "Language-Team: English (United Kingdom) (http://www.transifex.com/foreman/fore"
13
13
  "man/language/en_GB/)\n"
14
14
  "MIME-Version: 1.0\n"
@@ -163,9 +163,6 @@ msgstr ""
163
163
  msgid "Create a Tailoring file"
164
164
  msgstr ""
165
165
 
166
- msgid "Create client"
167
- msgstr ""
168
-
169
166
  msgid "Dashboard"
170
167
  msgstr ""
171
168
 
@@ -187,18 +184,12 @@ msgstr ""
187
184
  msgid "Delete an ARF Report"
188
185
  msgstr ""
189
186
 
190
- msgid "Delete client"
191
- msgstr ""
192
-
193
187
  msgid "Delete compliance policy %s with all of its reports?"
194
188
  msgstr ""
195
189
 
196
190
  msgid "Delete compliance report for %s?"
197
191
  msgstr ""
198
192
 
199
- msgid "Delete host"
200
- msgstr ""
201
-
202
193
  msgid "Delete reports"
203
194
  msgstr ""
204
195
 
@@ -831,12 +822,6 @@ msgstr ""
831
822
  msgid "Update an SCAP content"
832
823
  msgstr ""
833
824
 
834
- msgid "Update host"
835
- msgstr ""
836
-
837
- msgid "Update node"
838
- msgstr ""
839
-
840
825
  msgid "Updated hosts: Assigned with OpenSCAP Proxy: %s"
841
826
  msgstr ""
842
827
 
@@ -9,7 +9,7 @@ msgid ""
9
9
  msgstr ""
10
10
  "Project-Id-Version: Foreman\n"
11
11
  "Report-Msgid-Bugs-To: \n"
12
- "PO-Revision-Date: 2019-10-23 20:36+0000\n"
12
+ "PO-Revision-Date: 2020-03-02 20:59+0000\n"
13
13
  "Last-Translator: Bryan Kearney <bryan.kearney@gmail.com>\n"
14
14
  "Language-Team: Spanish (http://www.transifex.com/foreman/foreman/language/es/)"
15
15
  "\n"
@@ -165,9 +165,6 @@ msgstr "Crear una política"
165
165
  msgid "Create a Tailoring file"
166
166
  msgstr "Crear un archivo de personalización"
167
167
 
168
- msgid "Create client"
169
- msgstr ""
170
-
171
168
  msgid "Dashboard"
172
169
  msgstr "Tablero de mandos"
173
170
 
@@ -189,18 +186,12 @@ msgstr "Eliminar una política"
189
186
  msgid "Delete an ARF Report"
190
187
  msgstr "Eliminar un informe ARF"
191
188
 
192
- msgid "Delete client"
193
- msgstr ""
194
-
195
189
  msgid "Delete compliance policy %s with all of its reports?"
196
190
  msgstr "¿Eliminar política de cumplimiento %s junto con todos sus informes?"
197
191
 
198
192
  msgid "Delete compliance report for %s?"
199
193
  msgstr "¿Eliminar el informe de cumplimiento para %s?"
200
194
 
201
- msgid "Delete host"
202
- msgstr ""
203
-
204
195
  msgid "Delete reports"
205
196
  msgstr "Eliminar informes"
206
197
 
@@ -833,12 +824,6 @@ msgstr "Actualizar un archivo de personalización"
833
824
  msgid "Update an SCAP content"
834
825
  msgstr "Actualizar el contenido de SCAP"
835
826
 
836
- msgid "Update host"
837
- msgstr ""
838
-
839
- msgid "Update node"
840
- msgstr ""
841
-
842
827
  msgid "Updated hosts: Assigned with OpenSCAP Proxy: %s"
843
828
  msgstr "Hosts actualizados: Asignados con proxy OpenSCAP: %s"
844
829
 
@@ -8,8 +8,8 @@ msgid ""
8
8
  msgstr ""
9
9
  "Project-Id-Version: foreman_openscap 1.0.0\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
- "POT-Creation-Date: 2020-03-02 13:32+0000\n"
12
- "PO-Revision-Date: 2020-03-02 13:32+0000\n"
11
+ "POT-Creation-Date: 2020-05-11 18:31+0530\n"
12
+ "PO-Revision-Date: 2020-05-11 18:31+0530\n"
13
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
15
  "Language: \n"
@@ -1295,37 +1295,17 @@ msgid "Run OpenSCAP scan"
1295
1295
  msgstr ""
1296
1296
 
1297
1297
  #: action_names.rb:2
1298
- msgid "Import Puppet classes"
1298
+ msgid "Action with sub plans"
1299
1299
  msgstr ""
1300
1300
 
1301
1301
  #: action_names.rb:3
1302
- msgid "Remote action:"
1302
+ msgid "Import facts"
1303
1303
  msgstr ""
1304
1304
 
1305
1305
  #: action_names.rb:4
1306
- msgid "Action with sub plans"
1306
+ msgid "Import Puppet classes"
1307
1307
  msgstr ""
1308
1308
 
1309
1309
  #: action_names.rb:5
1310
- msgid "Import facts"
1311
- msgstr ""
1312
-
1313
- #: action_names.rb:6
1314
- msgid "Delete host"
1315
- msgstr ""
1316
-
1317
- #: action_names.rb:7
1318
- msgid "Update host"
1319
- msgstr ""
1320
-
1321
- #: action_names.rb:8
1322
- msgid "Update node"
1323
- msgstr ""
1324
-
1325
- #: action_names.rb:9
1326
- msgid "Create client"
1327
- msgstr ""
1328
-
1329
- #: action_names.rb:10
1330
- msgid "Delete client"
1310
+ msgid "Remote action:"
1331
1311
  msgstr ""
@@ -10,7 +10,7 @@ msgid ""
10
10
  msgstr ""
11
11
  "Project-Id-Version: Foreman\n"
12
12
  "Report-Msgid-Bugs-To: \n"
13
- "PO-Revision-Date: 2019-10-23 20:36+0000\n"
13
+ "PO-Revision-Date: 2020-03-02 20:59+0000\n"
14
14
  "Last-Translator: Bryan Kearney <bryan.kearney@gmail.com>\n"
15
15
  "Language-Team: French (http://www.transifex.com/foreman/foreman/language/fr/)\n"
16
16
  "MIME-Version: 1.0\n"
@@ -165,9 +165,6 @@ msgstr "Créer une stratégie"
165
165
  msgid "Create a Tailoring file"
166
166
  msgstr "Créer un fichier de personnalisation"
167
167
 
168
- msgid "Create client"
169
- msgstr ""
170
-
171
168
  msgid "Dashboard"
172
169
  msgstr "Tableau de bord"
173
170
 
@@ -189,18 +186,12 @@ msgstr "Supprimer une Stratégie"
189
186
  msgid "Delete an ARF Report"
190
187
  msgstr "Supprimer un rapport ARF"
191
188
 
192
- msgid "Delete client"
193
- msgstr ""
194
-
195
189
  msgid "Delete compliance policy %s with all of its reports?"
196
190
  msgstr "Souhaitez-vous supprimer la stratégie de conformité %s avec tous ses rapports ?"
197
191
 
198
192
  msgid "Delete compliance report for %s?"
199
193
  msgstr "Supprimer les rapports de conformité pour %s ?"
200
194
 
201
- msgid "Delete host"
202
- msgstr ""
203
-
204
195
  msgid "Delete reports"
205
196
  msgstr "Supprimer les rapports"
206
197
 
@@ -839,12 +830,6 @@ msgstr "Mettre à jour un fichier de personnalisation"
839
830
  msgid "Update an SCAP content"
840
831
  msgstr "Mettre à jour un contenu SCAP"
841
832
 
842
- msgid "Update host"
843
- msgstr ""
844
-
845
- msgid "Update node"
846
- msgstr ""
847
-
848
833
  msgid "Updated hosts: Assigned with OpenSCAP Proxy: %s"
849
834
  msgstr "Hôtes mis à jour : attribué avec le proxy OpenSCAP : %s"
850
835
 
@@ -7,8 +7,8 @@ msgid ""
7
7
  msgstr ""
8
8
  "Project-Id-Version: Foreman\n"
9
9
  "Report-Msgid-Bugs-To: \n"
10
- "PO-Revision-Date: 2019-10-23 20:36+0000\n"
11
- "Last-Translator: Carmela Rubiños <carmela.rubinos@gmail.com>\n"
10
+ "PO-Revision-Date: 2020-03-02 20:59+0000\n"
11
+ "Last-Translator: Lukáš Zapletal\n"
12
12
  "Language-Team: Galician (http://www.transifex.com/foreman/foreman/language/gl/"
13
13
  ")\n"
14
14
  "MIME-Version: 1.0\n"
@@ -163,9 +163,6 @@ msgstr ""
163
163
  msgid "Create a Tailoring file"
164
164
  msgstr ""
165
165
 
166
- msgid "Create client"
167
- msgstr ""
168
-
169
166
  msgid "Dashboard"
170
167
  msgstr "Escritorio"
171
168
 
@@ -187,18 +184,12 @@ msgstr ""
187
184
  msgid "Delete an ARF Report"
188
185
  msgstr ""
189
186
 
190
- msgid "Delete client"
191
- msgstr ""
192
-
193
187
  msgid "Delete compliance policy %s with all of its reports?"
194
188
  msgstr ""
195
189
 
196
190
  msgid "Delete compliance report for %s?"
197
191
  msgstr ""
198
192
 
199
- msgid "Delete host"
200
- msgstr ""
201
-
202
193
  msgid "Delete reports"
203
194
  msgstr ""
204
195
 
@@ -831,12 +822,6 @@ msgstr ""
831
822
  msgid "Update an SCAP content"
832
823
  msgstr ""
833
824
 
834
- msgid "Update host"
835
- msgstr ""
836
-
837
- msgid "Update node"
838
- msgstr ""
839
-
840
825
  msgid "Updated hosts: Assigned with OpenSCAP Proxy: %s"
841
826
  msgstr ""
842
827
 
@@ -8,8 +8,8 @@ msgid ""
8
8
  msgstr ""
9
9
  "Project-Id-Version: Foreman\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
- "PO-Revision-Date: 2019-10-23 20:36+0000\n"
12
- "Last-Translator: Bryan Kearney <bryan.kearney@gmail.com>\n"
11
+ "PO-Revision-Date: 2020-03-02 20:59+0000\n"
12
+ "Last-Translator: Lukáš Zapletal\n"
13
13
  "Language-Team: Italian (http://www.transifex.com/foreman/foreman/language/it/)"
14
14
  "\n"
15
15
  "MIME-Version: 1.0\n"
@@ -164,9 +164,6 @@ msgstr ""
164
164
  msgid "Create a Tailoring file"
165
165
  msgstr ""
166
166
 
167
- msgid "Create client"
168
- msgstr ""
169
-
170
167
  msgid "Dashboard"
171
168
  msgstr "Dashboard"
172
169
 
@@ -188,18 +185,12 @@ msgstr ""
188
185
  msgid "Delete an ARF Report"
189
186
  msgstr ""
190
187
 
191
- msgid "Delete client"
192
- msgstr ""
193
-
194
188
  msgid "Delete compliance policy %s with all of its reports?"
195
189
  msgstr ""
196
190
 
197
191
  msgid "Delete compliance report for %s?"
198
192
  msgstr ""
199
193
 
200
- msgid "Delete host"
201
- msgstr ""
202
-
203
194
  msgid "Delete reports"
204
195
  msgstr ""
205
196
 
@@ -832,12 +823,6 @@ msgstr ""
832
823
  msgid "Update an SCAP content"
833
824
  msgstr ""
834
825
 
835
- msgid "Update host"
836
- msgstr ""
837
-
838
- msgid "Update node"
839
- msgstr ""
840
-
841
826
  msgid "Updated hosts: Assigned with OpenSCAP Proxy: %s"
842
827
  msgstr ""
843
828
 
@@ -9,7 +9,7 @@ msgid ""
9
9
  msgstr ""
10
10
  "Project-Id-Version: Foreman\n"
11
11
  "Report-Msgid-Bugs-To: \n"
12
- "PO-Revision-Date: 2019-10-23 20:36+0000\n"
12
+ "PO-Revision-Date: 2020-03-02 20:59+0000\n"
13
13
  "Last-Translator: Bryan Kearney <bryan.kearney@gmail.com>\n"
14
14
  "Language-Team: Japanese (http://www.transifex.com/foreman/foreman/language/ja/"
15
15
  ")\n"
@@ -165,9 +165,6 @@ msgstr "ポリシーの作成"
165
165
  msgid "Create a Tailoring file"
166
166
  msgstr "テーラリングファイルの作成"
167
167
 
168
- msgid "Create client"
169
- msgstr ""
170
-
171
168
  msgid "Dashboard"
172
169
  msgstr "ダッシュボード"
173
170
 
@@ -189,18 +186,12 @@ msgstr "ポリシーの削除"
189
186
  msgid "Delete an ARF Report"
190
187
  msgstr "ARF レポートの定義"
191
188
 
192
- msgid "Delete client"
193
- msgstr ""
194
-
195
189
  msgid "Delete compliance policy %s with all of its reports?"
196
190
  msgstr "すべてのレポートでコンプライアンスポリシー %s を削除しますか?"
197
191
 
198
192
  msgid "Delete compliance report for %s?"
199
193
  msgstr "%s のコンプライアンスレポートを削除しますか?"
200
194
 
201
- msgid "Delete host"
202
- msgstr ""
203
-
204
195
  msgid "Delete reports"
205
196
  msgstr "レポートを削除"
206
197
 
@@ -833,12 +824,6 @@ msgstr "テーラリングファイルの更新"
833
824
  msgid "Update an SCAP content"
834
825
  msgstr "SCAP コンテンツの更新"
835
826
 
836
- msgid "Update host"
837
- msgstr ""
838
-
839
- msgid "Update node"
840
- msgstr ""
841
-
842
827
  msgid "Updated hosts: Assigned with OpenSCAP Proxy: %s"
843
828
  msgstr "更新済みホスト: OpenSCAP プロキシーで割り当て済み: %s"
844
829
 
@@ -8,8 +8,8 @@ msgid ""
8
8
  msgstr ""
9
9
  "Project-Id-Version: Foreman\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
- "PO-Revision-Date: 2019-10-23 20:36+0000\n"
12
- "Last-Translator: Bryan Kearney <bryan.kearney@gmail.com>\n"
11
+ "PO-Revision-Date: 2020-03-02 20:59+0000\n"
12
+ "Last-Translator: Lukáš Zapletal\n"
13
13
  "Language-Team: Korean (http://www.transifex.com/foreman/foreman/language/ko/)\n"
14
14
  "MIME-Version: 1.0\n"
15
15
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -163,9 +163,6 @@ msgstr ""
163
163
  msgid "Create a Tailoring file"
164
164
  msgstr ""
165
165
 
166
- msgid "Create client"
167
- msgstr ""
168
-
169
166
  msgid "Dashboard"
170
167
  msgstr "대시보드 "
171
168
 
@@ -187,18 +184,12 @@ msgstr ""
187
184
  msgid "Delete an ARF Report"
188
185
  msgstr ""
189
186
 
190
- msgid "Delete client"
191
- msgstr ""
192
-
193
187
  msgid "Delete compliance policy %s with all of its reports?"
194
188
  msgstr ""
195
189
 
196
190
  msgid "Delete compliance report for %s?"
197
191
  msgstr "%s에 대한 컴플라이언스 보고서를 삭제하시겠습니까?"
198
192
 
199
- msgid "Delete host"
200
- msgstr ""
201
-
202
193
  msgid "Delete reports"
203
194
  msgstr "보고서 삭제"
204
195
 
@@ -831,12 +822,6 @@ msgstr ""
831
822
  msgid "Update an SCAP content"
832
823
  msgstr "SCAP 컨텐츠 업데이트"
833
824
 
834
- msgid "Update host"
835
- msgstr ""
836
-
837
- msgid "Update node"
838
- msgstr ""
839
-
840
825
  msgid "Updated hosts: Assigned with OpenSCAP Proxy: %s"
841
826
  msgstr ""
842
827
 
@@ -8,7 +8,7 @@ msgid ""
8
8
  msgstr ""
9
9
  "Project-Id-Version: Foreman\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
- "PO-Revision-Date: 2019-10-23 20:36+0000\n"
11
+ "PO-Revision-Date: 2020-03-02 20:59+0000\n"
12
12
  "Last-Translator: Bryan Kearney <bryan.kearney@gmail.com>\n"
13
13
  "Language-Team: Portuguese (Brazil) (http://www.transifex.com/foreman/foreman/l"
14
14
  "anguage/pt_BR/)\n"
@@ -164,9 +164,6 @@ msgstr "Criar uma política"
164
164
  msgid "Create a Tailoring file"
165
165
  msgstr "Criar um arquivo de personalização"
166
166
 
167
- msgid "Create client"
168
- msgstr ""
169
-
170
167
  msgid "Dashboard"
171
168
  msgstr "Painel"
172
169
 
@@ -188,18 +185,12 @@ msgstr "Excluir uma política"
188
185
  msgid "Delete an ARF Report"
189
186
  msgstr "Excluir um relatório ARF"
190
187
 
191
- msgid "Delete client"
192
- msgstr ""
193
-
194
188
  msgid "Delete compliance policy %s with all of its reports?"
195
189
  msgstr "Excluir política de conformidade %s com todos os relatórios?"
196
190
 
197
191
  msgid "Delete compliance report for %s?"
198
192
  msgstr "Remover relatório de conformidade para %s?"
199
193
 
200
- msgid "Delete host"
201
- msgstr ""
202
-
203
194
  msgid "Delete reports"
204
195
  msgstr "Remover relatórios"
205
196
 
@@ -838,12 +829,6 @@ msgstr "Atualizar um arquivo de personalização"
838
829
  msgid "Update an SCAP content"
839
830
  msgstr "Atualizar um conteúdo SCAP"
840
831
 
841
- msgid "Update host"
842
- msgstr ""
843
-
844
- msgid "Update node"
845
- msgstr ""
846
-
847
832
  msgid "Updated hosts: Assigned with OpenSCAP Proxy: %s"
848
833
  msgstr "Hosts atualizados: atribuídos com proxy de OpenSCAP: %s"
849
834
 
@@ -9,8 +9,8 @@ msgid ""
9
9
  msgstr ""
10
10
  "Project-Id-Version: Foreman\n"
11
11
  "Report-Msgid-Bugs-To: \n"
12
- "PO-Revision-Date: 2019-10-23 20:36+0000\n"
13
- "Last-Translator: Bryan Kearney <bryan.kearney@gmail.com>\n"
12
+ "PO-Revision-Date: 2020-03-02 20:59+0000\n"
13
+ "Last-Translator: Lukáš Zapletal\n"
14
14
  "Language-Team: Russian (http://www.transifex.com/foreman/foreman/language/ru/)"
15
15
  "\n"
16
16
  "MIME-Version: 1.0\n"
@@ -167,9 +167,6 @@ msgstr ""
167
167
  msgid "Create a Tailoring file"
168
168
  msgstr ""
169
169
 
170
- msgid "Create client"
171
- msgstr ""
172
-
173
170
  msgid "Dashboard"
174
171
  msgstr "Обзор"
175
172
 
@@ -191,18 +188,12 @@ msgstr ""
191
188
  msgid "Delete an ARF Report"
192
189
  msgstr ""
193
190
 
194
- msgid "Delete client"
195
- msgstr ""
196
-
197
191
  msgid "Delete compliance policy %s with all of its reports?"
198
192
  msgstr ""
199
193
 
200
194
  msgid "Delete compliance report for %s?"
201
195
  msgstr "Удалить отчет %s?"
202
196
 
203
- msgid "Delete host"
204
- msgstr ""
205
-
206
197
  msgid "Delete reports"
207
198
  msgstr "Удалить отчеты"
208
199
 
@@ -835,12 +826,6 @@ msgstr ""
835
826
  msgid "Update an SCAP content"
836
827
  msgstr "Обновить описание SCAP"
837
828
 
838
- msgid "Update host"
839
- msgstr ""
840
-
841
- msgid "Update node"
842
- msgstr ""
843
-
844
829
  msgid "Updated hosts: Assigned with OpenSCAP Proxy: %s"
845
830
  msgstr ""
846
831
 
@@ -7,8 +7,8 @@ msgid ""
7
7
  msgstr ""
8
8
  "Project-Id-Version: Foreman\n"
9
9
  "Report-Msgid-Bugs-To: \n"
10
- "PO-Revision-Date: 2019-10-23 20:36+0000\n"
11
- "Last-Translator: johnny.westerlund <johnny.westerlund@gmail.com>\n"
10
+ "PO-Revision-Date: 2020-03-02 20:59+0000\n"
11
+ "Last-Translator: Lukáš Zapletal\n"
12
12
  "Language-Team: Swedish (Sweden) (http://www.transifex.com/foreman/foreman/lang"
13
13
  "uage/sv_SE/)\n"
14
14
  "MIME-Version: 1.0\n"
@@ -163,9 +163,6 @@ msgstr ""
163
163
  msgid "Create a Tailoring file"
164
164
  msgstr ""
165
165
 
166
- msgid "Create client"
167
- msgstr ""
168
-
169
166
  msgid "Dashboard"
170
167
  msgstr "Instrumentbräda"
171
168
 
@@ -187,18 +184,12 @@ msgstr ""
187
184
  msgid "Delete an ARF Report"
188
185
  msgstr ""
189
186
 
190
- msgid "Delete client"
191
- msgstr ""
192
-
193
187
  msgid "Delete compliance policy %s with all of its reports?"
194
188
  msgstr ""
195
189
 
196
190
  msgid "Delete compliance report for %s?"
197
191
  msgstr ""
198
192
 
199
- msgid "Delete host"
200
- msgstr ""
201
-
202
193
  msgid "Delete reports"
203
194
  msgstr ""
204
195
 
@@ -831,12 +822,6 @@ msgstr ""
831
822
  msgid "Update an SCAP content"
832
823
  msgstr ""
833
824
 
834
- msgid "Update host"
835
- msgstr ""
836
-
837
- msgid "Update node"
838
- msgstr ""
839
-
840
825
  msgid "Updated hosts: Assigned with OpenSCAP Proxy: %s"
841
826
  msgstr ""
842
827
 
@@ -8,7 +8,7 @@ msgid ""
8
8
  msgstr ""
9
9
  "Project-Id-Version: Foreman\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
- "PO-Revision-Date: 2019-10-23 20:36+0000\n"
11
+ "PO-Revision-Date: 2020-03-02 20:59+0000\n"
12
12
  "Last-Translator: Bryan Kearney <bryan.kearney@gmail.com>\n"
13
13
  "Language-Team: Chinese (China) (http://www.transifex.com/foreman/foreman/langu"
14
14
  "age/zh_CN/)\n"
@@ -164,9 +164,6 @@ msgstr "创建策略"
164
164
  msgid "Create a Tailoring file"
165
165
  msgstr "创建定制文件"
166
166
 
167
- msgid "Create client"
168
- msgstr ""
169
-
170
167
  msgid "Dashboard"
171
168
  msgstr "仪表板"
172
169
 
@@ -188,18 +185,12 @@ msgstr "删除一个策略"
188
185
  msgid "Delete an ARF Report"
189
186
  msgstr "删除 ARF 报告"
190
187
 
191
- msgid "Delete client"
192
- msgstr ""
193
-
194
188
  msgid "Delete compliance policy %s with all of its reports?"
195
189
  msgstr "是否删除所有报告中的合规策略 %s?"
196
190
 
197
191
  msgid "Delete compliance report for %s?"
198
192
  msgstr "是否删除 %s 的合规报告?"
199
193
 
200
- msgid "Delete host"
201
- msgstr ""
202
-
203
194
  msgid "Delete reports"
204
195
  msgstr "删除报告"
205
196
 
@@ -834,12 +825,6 @@ msgstr "更新定制文件"
834
825
  msgid "Update an SCAP content"
835
826
  msgstr "更新 SCAP 内容"
836
827
 
837
- msgid "Update host"
838
- msgstr ""
839
-
840
- msgid "Update node"
841
- msgstr ""
842
-
843
828
  msgid "Updated hosts: Assigned with OpenSCAP Proxy: %s"
844
829
  msgstr "更新的主机:分配了 OpenSCAP 代理: %s"
845
830
 
@@ -8,8 +8,8 @@ msgid ""
8
8
  msgstr ""
9
9
  "Project-Id-Version: Foreman\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
- "PO-Revision-Date: 2019-10-23 20:36+0000\n"
12
- "Last-Translator: Bryan Kearney <bryan.kearney@gmail.com>\n"
11
+ "PO-Revision-Date: 2020-03-02 20:59+0000\n"
12
+ "Last-Translator: Lukáš Zapletal\n"
13
13
  "Language-Team: Chinese (Taiwan) (http://www.transifex.com/foreman/foreman/lang"
14
14
  "uage/zh_TW/)\n"
15
15
  "MIME-Version: 1.0\n"
@@ -164,9 +164,6 @@ msgstr ""
164
164
  msgid "Create a Tailoring file"
165
165
  msgstr ""
166
166
 
167
- msgid "Create client"
168
- msgstr ""
169
-
170
167
  msgid "Dashboard"
171
168
  msgstr "控制面板"
172
169
 
@@ -188,18 +185,12 @@ msgstr ""
188
185
  msgid "Delete an ARF Report"
189
186
  msgstr ""
190
187
 
191
- msgid "Delete client"
192
- msgstr ""
193
-
194
188
  msgid "Delete compliance policy %s with all of its reports?"
195
189
  msgstr ""
196
190
 
197
191
  msgid "Delete compliance report for %s?"
198
192
  msgstr "刪除 %s 的合規報告?"
199
193
 
200
- msgid "Delete host"
201
- msgstr ""
202
-
203
194
  msgid "Delete reports"
204
195
  msgstr "刪除報告"
205
196
 
@@ -832,12 +823,6 @@ msgstr ""
832
823
  msgid "Update an SCAP content"
833
824
  msgstr "更新 SCAP 內容"
834
825
 
835
- msgid "Update host"
836
- msgstr ""
837
-
838
- msgid "Update node"
839
- msgstr ""
840
-
841
826
  msgid "Updated hosts: Assigned with OpenSCAP Proxy: %s"
842
827
  msgstr ""
843
828
 
@@ -37,6 +37,15 @@ class PolicyTest < ActiveSupport::TestCase
37
37
  assert_equal hostgroup, policy.hostgroups.first
38
38
  end
39
39
 
40
+ test "should not raise when assiging same host by id" do
41
+ host1 = FactoryBot.create(:compliance_host)
42
+ asset = FactoryBot.create(:asset, :assetable_id => host1.id, :assetable_type => 'Host::Base')
43
+ policy = FactoryBot.create(:policy, :assets => [asset], :scap_content => @scap_content, :scap_content_profile => @scap_profile)
44
+ policy.host_ids = [host1, host1].map(&:id)
45
+ policy.save!
46
+ assert_equal 1, policy.hosts.count
47
+ end
48
+
40
49
  test "should remove associated hostgroup" do
41
50
  hg = FactoryBot.create(:hostgroup)
42
51
  asset = FactoryBot.create(:asset, :assetable_id => hg.id, :assetable_type => 'Hostgroup')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_openscap
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 4.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - slukasik@redhat.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-13 00:00:00.000000000 Z
11
+ date: 2020-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -244,6 +244,7 @@ files:
244
244
  - db/migrate/20171016125613_add_content_title_unique_constraint.foreman_openscap.rb
245
245
  - db/migrate/20190103093409_add_deployment_option_to_policy.foreman_openscap.rb
246
246
  - db/migrate/20200117135424_migrate_port_overrides_to_int.rb
247
+ - db/migrate/20200803065041_migrate_port_overrides_for_ansible.rb
247
248
  - db/seeds.d/75-job_templates.rb
248
249
  - db/seeds.d/openscap_feature.rb
249
250
  - db/seeds.d/openscap_policy_notification.rb