foreman_discovery 25.0.0 → 25.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/foreman_discovery/locale/ca/foreman_discovery.js +440 -452
  3. data/app/assets/javascripts/foreman_discovery/locale/cs_CZ/foreman_discovery.js +397 -409
  4. data/app/assets/javascripts/foreman_discovery/locale/de/foreman_discovery.js +537 -549
  5. data/app/assets/javascripts/foreman_discovery/locale/en/foreman_discovery.js +280 -291
  6. data/app/assets/javascripts/foreman_discovery/locale/en_GB/foreman_discovery.js +539 -551
  7. data/app/assets/javascripts/foreman_discovery/locale/es/foreman_discovery.js +541 -553
  8. data/app/assets/javascripts/foreman_discovery/locale/fr/foreman_discovery.js +539 -551
  9. data/app/assets/javascripts/foreman_discovery/locale/gl/foreman_discovery.js +339 -351
  10. data/app/assets/javascripts/foreman_discovery/locale/it/foreman_discovery.js +468 -480
  11. data/app/assets/javascripts/foreman_discovery/locale/ja/foreman_discovery.js +536 -548
  12. data/app/assets/javascripts/foreman_discovery/locale/ka/foreman_discovery.js +525 -537
  13. data/app/assets/javascripts/foreman_discovery/locale/ko/foreman_discovery.js +493 -505
  14. data/app/assets/javascripts/foreman_discovery/locale/pt_BR/foreman_discovery.js +538 -550
  15. data/app/assets/javascripts/foreman_discovery/locale/ru/foreman_discovery.js +510 -522
  16. data/app/assets/javascripts/foreman_discovery/locale/sv_SE/foreman_discovery.js +361 -373
  17. data/app/assets/javascripts/foreman_discovery/locale/zh_CN/foreman_discovery.js +540 -552
  18. data/app/assets/javascripts/foreman_discovery/locale/zh_TW/foreman_discovery.js +400 -412
  19. data/app/controllers/api/v2/discovered_hosts_controller.rb +2 -0
  20. data/app/controllers/concerns/foreman/controller/parameters/discovered_host.rb +41 -35
  21. data/app/controllers/concerns/foreman/controller/parameters/discovery_rule.rb +18 -12
  22. data/app/controllers/discovered_hosts_controller.rb +0 -13
  23. data/app/controllers/discovered_hosts_controller.rb.orig +354 -0
  24. data/app/models/host/discovered.rb +1 -0
  25. data/app/services/foreman_discovery/fact_to_category_resolver.rb +11 -6
  26. data/app/services/foreman_discovery/lldp_neighbors.rb +6 -2
  27. data/app/views/api/v2/discovered_hosts/main.json.rabl +2 -1
  28. data/app/views/discovered_hosts/_discovered_host.html.erb +1 -0
  29. data/app/views/discovered_hosts/_discovered_hosts_list.html.erb +2 -1
  30. data/app/views/discovered_hosts/show.html.erb +3 -1
  31. data/app/views/discovered_mailer/_discovered_host.html.erb +5 -0
  32. data/lib/foreman_discovery/version.rb +1 -1
  33. data/locale/ca/LC_MESSAGES/foreman_discovery.mo +0 -0
  34. data/locale/ca/foreman_discovery.po +2 -14
  35. data/locale/cs_CZ/LC_MESSAGES/foreman_discovery.mo +0 -0
  36. data/locale/cs_CZ/foreman_discovery.po +128 -138
  37. data/locale/de/LC_MESSAGES/foreman_discovery.mo +0 -0
  38. data/locale/de/foreman_discovery.po +4 -16
  39. data/locale/en/LC_MESSAGES/foreman_discovery.mo +0 -0
  40. data/locale/en/foreman_discovery.po +13 -20
  41. data/locale/en_GB/LC_MESSAGES/foreman_discovery.mo +0 -0
  42. data/locale/en_GB/foreman_discovery.po +39 -51
  43. data/locale/es/LC_MESSAGES/foreman_discovery.mo +0 -0
  44. data/locale/es/foreman_discovery.po +47 -59
  45. data/locale/fr/LC_MESSAGES/foreman_discovery.mo +0 -0
  46. data/locale/fr/foreman_discovery.po +18 -30
  47. data/locale/gl/LC_MESSAGES/foreman_discovery.mo +0 -0
  48. data/locale/gl/foreman_discovery.po +2 -14
  49. data/locale/it/LC_MESSAGES/foreman_discovery.mo +0 -0
  50. data/locale/it/foreman_discovery.po +2 -14
  51. data/locale/ja/LC_MESSAGES/foreman_discovery.mo +0 -0
  52. data/locale/ja/foreman_discovery.po +27 -38
  53. data/locale/ka/LC_MESSAGES/foreman_discovery.mo +0 -0
  54. data/locale/ka/foreman_discovery.po +19 -31
  55. data/locale/ko/LC_MESSAGES/foreman_discovery.mo +0 -0
  56. data/locale/ko/foreman_discovery.po +98 -108
  57. data/locale/pt_BR/LC_MESSAGES/foreman_discovery.mo +0 -0
  58. data/locale/pt_BR/foreman_discovery.po +2 -14
  59. data/locale/ru/LC_MESSAGES/foreman_discovery.mo +0 -0
  60. data/locale/ru/foreman_discovery.po +2 -14
  61. data/locale/sv_SE/LC_MESSAGES/foreman_discovery.mo +0 -0
  62. data/locale/sv_SE/foreman_discovery.po +2 -14
  63. data/locale/zh_CN/LC_MESSAGES/foreman_discovery.mo +0 -0
  64. data/locale/zh_CN/foreman_discovery.po +20 -32
  65. data/locale/zh_TW/LC_MESSAGES/foreman_discovery.mo +0 -0
  66. data/locale/zh_TW/foreman_discovery.po +2 -14
  67. data/test/facts/facts_with_lldp_bond_candidate.json +7 -0
  68. data/test/functional/api/v2/discovered_hosts_controller_test.rb +35 -0
  69. data/test/integration/discovered_hosts_test.rb +3 -1
  70. data/test/test_helper_discovery.rb +21 -7
  71. data/test/unit/lldp_neighbors_test.rb +34 -0
  72. metadata +4 -3
@@ -13,11 +13,11 @@
13
13
  # Valeria S Silva <valeriassilva@live.com>, 2015
14
14
  msgid ""
15
15
  msgstr ""
16
- "Project-Id-Version: foreman_discovery v22.0.4\n"
16
+ "Project-Id-Version: foreman_discovery 25.0.0\n"
17
17
  "Report-Msgid-Bugs-To: \n"
18
18
  "PO-Revision-Date: 2013-11-15 17:25+0000\n"
19
19
  "Last-Translator: Valeria S Silva <valeriassilva@live.com>, 2015\n"
20
- "Language-Team: Portuguese (Brazil) (http://www.transifex.com/foreman/foreman/l"
20
+ "Language-Team: Portuguese (Brazil) (http://app.transifex.com/foreman/foreman/l"
21
21
  "anguage/pt_BR/)\n"
22
22
  "MIME-Version: 1.0\n"
23
23
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -38,9 +38,6 @@ msgstr "Resumo de hosts descobertos pelo Foreman"
38
38
  msgid "A summary of discovered hosts"
39
39
  msgstr "Um resumo de hosts descobertos"
40
40
 
41
- msgid "Action with sub plans"
42
- msgstr "Ação com subplanos "
43
-
44
41
  msgid "Actions"
45
42
  msgstr "Ações"
46
43
 
@@ -410,12 +407,6 @@ msgstr "Erro de processamento da API de imagem: %{msg} (HTTP/%{code}, corpo: %{b
410
407
  msgid "Image API returned HTTP/%{code} with '%{body}"
411
408
  msgstr "Imagem API retornada HTTP/%{code} com '%{body}"
412
409
 
413
- msgid "Import Puppet classes"
414
- msgstr "Importar classes de Puppet"
415
-
416
- msgid "Import facts"
417
- msgstr "Importar fatos"
418
-
419
410
  msgid "In addition to @host attribute function rand for random integers is available. Examples:"
420
411
  msgstr "Além do atributo @host, a função rand para inteiros aleatórios está disponível. Exemplos:"
421
412
 
@@ -659,9 +650,6 @@ msgstr "Regex para organizar fatos da seção de armazenamento"
659
650
  msgid "Reloading kernel on %s"
660
651
  msgstr "Recarregando kernel no %s"
661
652
 
662
- msgid "Remote action:"
663
- msgstr "Ação remota:"
664
-
665
653
  msgid "Reported in the last 7 days"
666
654
  msgstr "Relatado nos últimos sete dias"
667
655
 
@@ -10,11 +10,11 @@
10
10
  # Yulia <yulia.poyarkova@redhat.com>, 2016
11
11
  msgid ""
12
12
  msgstr ""
13
- "Project-Id-Version: foreman_discovery v22.0.4\n"
13
+ "Project-Id-Version: foreman_discovery 25.0.0\n"
14
14
  "Report-Msgid-Bugs-To: \n"
15
15
  "PO-Revision-Date: 2013-11-15 17:25+0000\n"
16
16
  "Last-Translator: Yulia <yulia.poyarkova@redhat.com>, 2016\n"
17
- "Language-Team: Russian (http://www.transifex.com/foreman/foreman/language/ru/)"
17
+ "Language-Team: Russian (http://app.transifex.com/foreman/foreman/language/ru/)"
18
18
  "\n"
19
19
  "MIME-Version: 1.0\n"
20
20
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -36,9 +36,6 @@ msgstr "Сводка обнаруженных узлов от <b>Foreman</b>"
36
36
  msgid "A summary of discovered hosts"
37
37
  msgstr "Сводка состояния обнаруженных узлов"
38
38
 
39
- msgid "Action with sub plans"
40
- msgstr "Действия с подпланами"
41
-
42
39
  msgid "Actions"
43
40
  msgstr "Действия"
44
41
 
@@ -409,12 +406,6 @@ msgstr "API образа вернул ошибку HTTP/%{code}: %{msg} (body: %
409
406
  msgid "Image API returned HTTP/%{code} with '%{body}"
410
407
  msgstr "API образа вернул ошибку HTTP/%{code}: '%{body}"
411
408
 
412
- msgid "Import Puppet classes"
413
- msgstr "Импорт классов Puppet"
414
-
415
- msgid "Import facts"
416
- msgstr "Импорт фактов"
417
-
418
409
  msgid "In addition to @host attribute function rand for random integers is available. Examples:"
419
410
  msgstr ""
420
411
 
@@ -658,9 +649,6 @@ msgstr "Регулярное выражение для организации ф
658
649
  msgid "Reloading kernel on %s"
659
650
  msgstr "Перезагрузка ядра на %s"
660
651
 
661
- msgid "Remote action:"
662
- msgstr "Удаленное действие:"
663
-
664
652
  msgid "Reported in the last 7 days"
665
653
  msgstr "Были данные за последние 7 дней"
666
654
 
@@ -8,11 +8,11 @@
8
8
  # johnny.westerlund <johnny.westerlund@gmail.com>, 2014
9
9
  msgid ""
10
10
  msgstr ""
11
- "Project-Id-Version: foreman_discovery v22.0.4\n"
11
+ "Project-Id-Version: foreman_discovery 25.0.0\n"
12
12
  "Report-Msgid-Bugs-To: \n"
13
13
  "PO-Revision-Date: 2013-11-15 17:25+0000\n"
14
14
  "Last-Translator: johnny.westerlund <johnny.westerlund@gmail.com>, 2014\n"
15
- "Language-Team: Swedish (Sweden) (http://www.transifex.com/foreman/foreman/lang"
15
+ "Language-Team: Swedish (Sweden) (http://app.transifex.com/foreman/foreman/lang"
16
16
  "uage/sv_SE/)\n"
17
17
  "MIME-Version: 1.0\n"
18
18
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -32,9 +32,6 @@ msgstr ""
32
32
  msgid "A summary of discovered hosts"
33
33
  msgstr ""
34
34
 
35
- msgid "Action with sub plans"
36
- msgstr ""
37
-
38
35
  msgid "Actions"
39
36
  msgstr "Åtgärder"
40
37
 
@@ -401,12 +398,6 @@ msgstr ""
401
398
  msgid "Image API returned HTTP/%{code} with '%{body}"
402
399
  msgstr ""
403
400
 
404
- msgid "Import Puppet classes"
405
- msgstr ""
406
-
407
- msgid "Import facts"
408
- msgstr ""
409
-
410
401
  msgid "In addition to @host attribute function rand for random integers is available. Examples:"
411
402
  msgstr ""
412
403
 
@@ -650,9 +641,6 @@ msgstr ""
650
641
  msgid "Reloading kernel on %s"
651
642
  msgstr ""
652
643
 
653
- msgid "Remote action:"
654
- msgstr ""
655
-
656
644
  msgid "Reported in the last 7 days"
657
645
  msgstr ""
658
646
 
@@ -5,11 +5,11 @@
5
5
  # Translators:
6
6
  msgid ""
7
7
  msgstr ""
8
- "Project-Id-Version: foreman_discovery v22.0.4\n"
8
+ "Project-Id-Version: foreman_discovery 25.0.0\n"
9
9
  "Report-Msgid-Bugs-To: \n"
10
10
  "PO-Revision-Date: 2013-11-15 17:25+0000\n"
11
11
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12
- "Language-Team: Chinese (China) (http://www.transifex.com/foreman/foreman/langu"
12
+ "Language-Team: Chinese (China) (http://app.transifex.com/foreman/foreman/langu"
13
13
  "age/zh_CN/)\n"
14
14
  "MIME-Version: 1.0\n"
15
15
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -29,9 +29,6 @@ msgstr "<b>Foreman</b> 发现的主机概述"
29
29
  msgid "A summary of discovered hosts"
30
30
  msgstr "发现主机概述"
31
31
 
32
- msgid "Action with sub plans"
33
- msgstr "有子计划的操作"
34
-
35
32
  msgid "Actions"
36
33
  msgstr "操作"
37
34
 
@@ -163,7 +160,7 @@ msgid "Discovered hosts are rebooting now"
163
160
  msgstr "现在正在重启发现主机"
164
161
 
165
162
  msgid "Discovered hosts from Foreman server at %{foreman_url}"
166
- msgstr "来自 %{foreman_url} Foreman 服务器的发现主机"
163
+ msgstr "来自 %%{foreman_url} Foreman 服务器的发现主机"
167
164
 
168
165
  msgid "Discovered hosts reported from unknown subnet are %s, communication will not be proxied."
169
166
  msgstr "从未知子网报告发现的主机为 %s,通信数据将不会被代理。"
@@ -199,19 +196,19 @@ msgid "DiscoveryRule|Enabled"
199
196
  msgstr "DiscoveryRule|Enabled"
200
197
 
201
198
  msgid "DiscoveryRule|Name"
202
- msgstr "DiscoveryRule|Name"
199
+ msgstr "发现规则|名称"
203
200
 
204
201
  msgid "DiscoveryRule|Priority"
205
202
  msgstr "发现规则|优先级"
206
203
 
207
204
  msgid "DiscoveryRule|Query"
208
- msgstr "DiscoveryRule|Query"
205
+ msgstr "发现规则|查询"
209
206
 
210
207
  msgid "Disk Count"
211
208
  msgstr "磁盘计数"
212
209
 
213
210
  msgid "Disk count"
214
- msgstr "磁盘计数"
211
+ msgstr "磁盘数"
215
212
 
216
213
  msgid "Disks Size"
217
214
  msgstr "磁盘大小"
@@ -256,7 +253,7 @@ msgid "Expected discovery_fact '%s' is missing, unable to detect primary interfa
256
253
  msgstr "缺少期望的 discovery_fact '%s',无法检测主接口和设置主机名称"
257
254
 
258
255
  msgid "Extra facter columns to show in host lists"
259
- msgstr ""
256
+ msgstr "在主机列表中显示的额外 facter 列"
260
257
 
261
258
  msgid "Fact + prefix"
262
259
  msgstr "Fact + 前缀"
@@ -280,7 +277,7 @@ msgid "Failed to reboot host %s"
280
277
  msgstr "重启主机 %s 失败"
281
278
 
282
279
  msgid "Failed to reboot host %{hostname} with error %{error_message}"
283
- msgstr "重启主机 %{hostname} 失败,错误为 %{error_message}"
280
+ msgstr "重启主机 %%{hostname} 失败,错误为 %%{error_message}"
284
281
 
285
282
  msgid "Failed to reboot hosts with error %s"
286
283
  msgstr "无法重启主机,错误 %s"
@@ -289,7 +286,7 @@ msgid "Failed to refresh facts for %s"
289
286
  msgstr "%s 的事实刷新失败"
290
287
 
291
288
  msgid "Failed to refresh facts for %{hostname} with error %{error_message}"
292
- msgstr "为 %{hostname} 刷新事实失败,错误为 %{error_message}"
289
+ msgstr "为 %%{hostname} 刷新事实失败,错误为 %%{error_message}"
293
290
 
294
291
  msgid "For more information please see "
295
292
  msgstr "查看详情 "
@@ -301,7 +298,7 @@ msgid "Force DNS entries creation when provisioning discovered host"
301
298
  msgstr "置备发现主机时强制 DNS 条目创建"
302
299
 
303
300
  msgid "Foreman Discovery"
304
- msgstr ""
301
+ msgstr "Foreman 发现"
305
302
 
306
303
  msgid "Foreman discovered hosts summary"
307
304
  msgstr "Foreman 发现主机概述"
@@ -322,7 +319,7 @@ msgid "Host"
322
319
  msgstr "主机"
323
320
 
324
321
  msgid "Host %s has been dicovered"
325
- msgstr "主机 %s 已被发现。"
322
+ msgstr "主机 %s 已被发现"
326
323
 
327
324
  msgid "Host %{host} was provisioned with rule %{rule}"
328
325
  msgstr "主机 %{host} 被置备,带有规则 %{rule}"
@@ -395,14 +392,8 @@ msgstr "图片 API 处理错误:%{msg} (HTTP /%{code} , 内容:%{body}
395
392
  msgid "Image API returned HTTP/%{code} with '%{body}"
396
393
  msgstr "镜像 API 返回 HTTP/%{code},带有 '%{body}"
397
394
 
398
- msgid "Import Puppet classes"
399
- msgstr "导入 Puppet 类"
400
-
401
- msgid "Import facts"
402
- msgstr "导入事实"
403
-
404
395
  msgid "In addition to @host attribute function rand for random integers is available. Examples:"
405
- msgstr "除了 @host 属性函数之外,还提供随机整数 rand"
396
+ msgstr "除了 @host 属性函数之外,还提供随机整数 rand。例如:"
406
397
 
407
398
  msgid "Init RAM kexec URL is invalid: '%s'"
408
399
  msgstr "Init RAM kexec URL 无效:'%s'"
@@ -444,7 +435,7 @@ msgid "List all fact values of a given discovered host"
444
435
  msgstr "列出给定发现主机的所有系统信息值"
445
436
 
446
437
  msgid "List of facts to use for the hostname (first wins)"
447
- msgstr ""
438
+ msgstr "用于主机名的详情列表(第一个有最高优先级)"
448
439
 
449
440
  msgid "Location"
450
441
  msgstr "位置"
@@ -546,16 +537,16 @@ msgid "One or more hosts have been discovered"
546
537
  msgstr "已发现一个或多个主机"
547
538
 
548
539
  msgid "One or more hosts with failed discovery due to error: %s"
549
- msgstr ""
540
+ msgstr "一个或多个因为错误而导致发现失败的主机:%s"
550
541
 
551
542
  msgid "Option 'url' must be provided"
552
- msgstr ""
543
+ msgstr "必须提供选项 'url'"
553
544
 
554
545
  msgid "Option 'url' must be valid URI: %s"
555
- msgstr ""
546
+ msgstr "选项 'url' 必须是有效的 URI:%s"
556
547
 
557
548
  msgid "Options must be hash"
558
- msgstr ""
549
+ msgstr "选项必须是哈希"
559
550
 
560
551
  msgid "Organization"
561
552
  msgstr "机构"
@@ -644,9 +635,6 @@ msgstr "组织存储部分详情的正则表达式"
644
635
  msgid "Reloading kernel on %s"
645
636
  msgstr "正在 %s 上重新加载内核"
646
637
 
647
- msgid "Remote action:"
648
- msgstr "远程操作:"
649
-
650
638
  msgid "Reported in the last 7 days"
651
639
  msgstr "最近 7 天内报告"
652
640
 
@@ -726,7 +714,7 @@ msgid "The following hosts were not deleted: %s"
726
714
  msgstr "以下主机没有删除:%s"
727
715
 
728
716
  msgid "This might take a while, as all hosts, facts and reports will be destroyed as well"
729
- msgstr "这可能需要一段时间,因为所有主机,事实和报告也将被销毁。"
717
+ msgstr "这可能需要一段时间,因为所有主机,事实和报告也将被销毁"
730
718
 
731
719
  msgid "Type"
732
720
  msgstr "类型"
@@ -825,7 +813,7 @@ msgid "represents rule name shown to the users"
825
813
  msgstr "代表显示给用户的规则名称"
826
814
 
827
815
  msgid "required if host is managed and custom partition has not been defined"
828
- msgstr "如果已管理主机,且未定义自定义分区,则需填写。"
816
+ msgstr "如果已管理主机,且未定义自定义分区,则需填写"
829
817
 
830
818
  msgid "required if host is managed and value is not inherited from host group"
831
819
  msgstr "如果主机是受管的,且值没有从主机组继承,则是必需的"
@@ -834,7 +822,7 @@ msgid "required if not imaged based provisioning and host is managed and value i
834
822
  msgstr "如果不是基于置备镜像的,主机是受管的,且值没有从主机组继承,则是必需的"
835
823
 
836
824
  msgid "required if value is not inherited from host group or default password in settings"
837
- msgstr "如果数值不是从主机组或设置中的默认密码继承,则需要。"
825
+ msgstr "如果数值不是从主机组或设置中的默认密码继承,则需要"
838
826
 
839
827
  msgid "sort results"
840
828
  msgstr "排序结果"
@@ -5,11 +5,11 @@
5
5
  # Translators:
6
6
  msgid ""
7
7
  msgstr ""
8
- "Project-Id-Version: foreman_discovery v22.0.4\n"
8
+ "Project-Id-Version: foreman_discovery 25.0.0\n"
9
9
  "Report-Msgid-Bugs-To: \n"
10
10
  "PO-Revision-Date: 2013-11-15 17:25+0000\n"
11
11
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12
- "Language-Team: Chinese (Taiwan) (http://www.transifex.com/foreman/foreman/lang"
12
+ "Language-Team: Chinese (Taiwan) (http://app.transifex.com/foreman/foreman/lang"
13
13
  "uage/zh_TW/)\n"
14
14
  "MIME-Version: 1.0\n"
15
15
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -29,9 +29,6 @@ msgstr ""
29
29
  msgid "A summary of discovered hosts"
30
30
  msgstr ""
31
31
 
32
- msgid "Action with sub plans"
33
- msgstr "有子計畫的動作"
34
-
35
32
  msgid "Actions"
36
33
  msgstr "動作"
37
34
 
@@ -398,12 +395,6 @@ msgstr ""
398
395
  msgid "Image API returned HTTP/%{code} with '%{body}"
399
396
  msgstr ""
400
397
 
401
- msgid "Import Puppet classes"
402
- msgstr "匯入 Puppet 類別"
403
-
404
- msgid "Import facts"
405
- msgstr "匯入詳情"
406
-
407
398
  msgid "In addition to @host attribute function rand for random integers is available. Examples:"
408
399
  msgstr ""
409
400
 
@@ -647,9 +638,6 @@ msgstr ""
647
638
  msgid "Reloading kernel on %s"
648
639
  msgstr ""
649
640
 
650
- msgid "Remote action:"
651
- msgstr "遠端動作:"
652
-
653
641
  msgid "Reported in the last 7 days"
654
642
  msgstr ""
655
643
 
@@ -44,7 +44,9 @@
44
44
  "timezone": "GMT",
45
45
  "fqdn": "a.server.b.domain",
46
46
  "ipaddress_eth0": "10.35.27.3",
47
+ "ipaddress6_eth0": "2001:db8:9a7b:fb60::3",
47
48
  "ipaddress_eth1": "10.35.27.4",
49
+ "ipaddress6_eth1": "2001:db8:9a7b:fb60::4",
48
50
  "puppetversion": "2.6.12",
49
51
  "path": "/root/.gem/bin:/root/.gem/ruby/1.8/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/sbin:/usr/sbin:/root/scripts",
50
52
  "hardwaremodel": "x86_64",
@@ -58,11 +60,14 @@
58
60
  "macaddress_eth0_182": "E4:1F:13:CC:36:58",
59
61
  "memorysize": "15.57 GB",
60
62
  "ipaddress": "10.35.27.2",
63
+ "ipaddress6": "2001:db8:5f42:7cd1::2",
61
64
  "rubyversion": "1.8.7",
62
65
  "macaddress_eth0_183": "E4:1F:13:CC:36:58",
63
66
  "physicalprocessorcount": "1",
64
67
  "network_lo": "127.0.0.0",
68
+ "network6_lo": "::1",
65
69
  "gateway": "10.35.27.62",
70
+ "gateway6": "2001:db8:2c7d:f15e::3e",
66
71
  "lsbdistid": "RedHatEnterpriseServer",
67
72
  "lsbdistdescription": "Red Hat Enterprise Linux Server release 6.2 (Santiago)",
68
73
  "swapsize": "17.70 GB",
@@ -90,11 +95,13 @@
90
95
  "lldp_neighbor_portID_eth1": "Eth170/1/3",
91
96
  "lldp_neighbor_sysName_eth1": "DC2-A03-DR-01",
92
97
  "lldp_neighbor_mngAddr_ipv4_eth1": "192.0.2.13",
98
+ "lldp_neighbor_mngAddr_ipv6_eth1": "2001:db8:4d2b:dc7b::13",
93
99
  "lldp_neighbor_PVID_eth1": "182",
94
100
  "lldp_neighbor_chassisID_eth0": "e0:d1:73:38:5a:84",
95
101
  "lldp_neighbor_portID_eth0": "Eth171/1/3",
96
102
  "lldp_neighbor_sysName_eth0": "DC2-A04-DR-03",
97
103
  "lldp_neighbor_mngAddr_ipv4_eth0": "192.0.2.13",
104
+ "lldp_neighbor_mngAddr_ipv6_eth0": "2001:db8:4d2b:dc7b::13",
98
105
  "lldp_neighbor_PVID_eth0": "182"
99
106
  }
100
107
  }
@@ -25,6 +25,12 @@ class Api::V2::DiscoveredHostsControllerTest < ActionController::TestCase
25
25
  "memorysize_mb" => "42000.42",
26
26
  "discovery_version" => "3.0.0",
27
27
  }
28
+
29
+ @facts6 = @facts.merge({
30
+ "ipaddress" => "2001:db8::1",
31
+ "ipaddress6_eth0" => "2001:db8::1",
32
+ })
33
+
28
34
  set_default_settings
29
35
  ::ForemanDiscovery::NodeAPI::PowerService.any_instance.stubs(:reboot).returns(true)
30
36
  ::ForemanDiscovery::HostConverter.stubs(:unused_ip_for_host)
@@ -52,6 +58,16 @@ class Api::V2::DiscoveredHostsControllerTest < ActionController::TestCase
52
58
  assert_equal Setting[:discovery_location], show_response["location_name"]
53
59
  end
54
60
 
61
+ def test_show_host_ipv6
62
+ host = discover_host_from_facts(@facts6)
63
+ get :show, params: { :id => host.id }
64
+ assert_response :success
65
+
66
+ response = ActiveSupport::JSON.decode(@response.body)
67
+ assert_equal "macaabbccddeeff", response["name"]
68
+ assert_equal @facts6["ipaddress6_eth0"], response["ip6"]
69
+ end
70
+
55
71
  def test_delete_discovered_host
56
72
  host = discover_host_from_facts(@facts)
57
73
  delete :destroy, params: { :id => host.id }
@@ -91,6 +107,25 @@ class Api::V2::DiscoveredHostsControllerTest < ActionController::TestCase
91
107
  assert actual.build?
92
108
  end
93
109
 
110
+ def test_provision_ipv6_host
111
+ subnet6 = FactoryBot.create(:subnet_ipv6, :network => "2001:db8::")
112
+ host = discover_host_from_facts(@facts6)
113
+ hostgroup = setup_hostgroup(host, subnets: { subnet6: subnet6 })
114
+
115
+ put :update, params: {
116
+ id: host.id,
117
+ discovered_host: {
118
+ hostgroup_id: hostgroup.id,
119
+ build: true
120
+ }
121
+ }
122
+
123
+ assert_response :success
124
+ actual = Host.unscoped.find(host.id)
125
+ assert actual.build?
126
+ assert_equal actual.ip6, @facts6["ipaddress6_eth0"]
127
+ end
128
+
94
129
  def test_provision_host_without_build_flag
95
130
  FactoryBot.create(:organization, :name => 'SomeOrg')
96
131
  FactoryBot.create(:location, :name => 'SomeLoc')
@@ -42,7 +42,9 @@ class DiscoveredHostsTest < IntegrationTestWithJavascript
42
42
  page.find_link('Reboot').click
43
43
  wait_for_ajax
44
44
  assert page.has_text?('The following hosts are about to be changed')
45
- page.find_button('Submit').click
45
+ wait_for do
46
+ page.find_button('Submit').click
47
+ end
46
48
  end
47
49
 
48
50
  test 'shows warning for all hosts with missing subnet' do
@@ -70,9 +70,11 @@ def set_default_settings
70
70
  Setting['discovery_auto_bond'] = false
71
71
  end
72
72
 
73
- def setup_hostgroup(host)
73
+ def setup_hostgroup(host, subnets: nil)
74
74
  domain = FactoryBot.create(:domain)
75
- subnet = FactoryBot.create(:subnet_ipv4, :network => "192.168.100.0")
75
+ subnets ||= {
76
+ subnet: FactoryBot.create(:subnet_ipv4, :network => "192.168.100.0")
77
+ }
76
78
  medium = FactoryBot.create(:medium, :organizations => [host.organization], :locations => [host.location])
77
79
  os = FactoryBot.create(:operatingsystem, :with_ptables, :with_archs, :media => [medium])
78
80
  args = {
@@ -80,11 +82,11 @@ def setup_hostgroup(host)
80
82
  :architecture => os.architectures.first,
81
83
  :ptable => os.ptables.first,
82
84
  :medium => os.media.first,
83
- :subnet => subnet,
84
85
  :domain => domain,
85
86
  :organizations => [host.organization],
86
87
  :locations => [host.location]
87
- }
88
+ }.merge(subnets)
89
+
88
90
  if defined?(ForemanPuppet)
89
91
  environment = FactoryBot.create(:environment, :organizations => [host.organization], :locations => [host.location])
90
92
  args[:environment] = environment
@@ -92,15 +94,26 @@ def setup_hostgroup(host)
92
94
  else
93
95
  hostgroup = FactoryBot.create(:hostgroup, :with_rootpass, **args)
94
96
  end
95
- domain.subnets << hostgroup.subnet
97
+
98
+ hostgroup_subnets = [hostgroup.subnet6, hostgroup.subnet].compact
99
+ domain.subnets << hostgroup_subnets
100
+
101
+ hostgroup_taxonomies(hostgroup, hostgroup_subnets, host)
102
+ end
103
+
104
+ def hostgroup_taxonomies(hostgroup, hostgroup_subnets, host)
96
105
  hostgroup.medium.organizations |= [host.organization]
97
106
  hostgroup.medium.locations |= [host.location]
98
107
  hostgroup.ptable.organizations |= [host.organization]
99
108
  hostgroup.ptable.locations |= [host.location]
100
109
  hostgroup.domain.organizations |= [host.organization]
101
110
  hostgroup.domain.locations |= [host.location]
102
- hostgroup.subnet.organizations |= [host.organization]
103
- hostgroup.subnet.locations |= [host.location]
111
+
112
+ hostgroup_subnets.each do |subnet|
113
+ subnet.organizations |= [host.organization]
114
+ subnet.locations |= [host.location]
115
+ end
116
+
104
117
  if defined?(ForemanPuppet)
105
118
  hostgroup.environment.organizations |= [host.organization]
106
119
  hostgroup.environment.locations |= [host.location]
@@ -109,6 +122,7 @@ def setup_hostgroup(host)
109
122
  hostgroup.puppet_ca_proxy.organizations |= [host.organization]
110
123
  hostgroup.puppet_ca_proxy.locations |= [host.location]
111
124
  end
125
+
112
126
  hostgroup
113
127
  end
114
128
 
@@ -1,6 +1,9 @@
1
1
  require_relative '../test_plugin_helper'
2
2
 
3
3
  class LldpNeighborsTest < ActiveSupport::TestCase
4
+ include FactImporterIsolation
5
+ allow_transactions_for_any_importer
6
+
4
7
  test "#get_neighbors_by_interface gives nothing with no LLDP facts" do
5
8
  assert_nil simple_facts.get_neighbors_by_interface('eth0')
6
9
  end
@@ -32,6 +35,37 @@ class LldpNeighborsTest < ActiveSupport::TestCase
32
35
  assert_equal({'182' => %w(eth2), '184' => %w(eth1)}, lldp_facts.list_by_pvid)
33
36
  end
34
37
 
38
+ test "#eventually_make_bond" do
39
+ facts = parse_json_fixture('facts_with_lldp_bond_candidate', true)
40
+ host = discover_host_from_facts(facts)
41
+ primary = host.primary_interface
42
+
43
+ assert_equal 0, host.interfaces.where(:type => 'Nic::Bond').count
44
+
45
+ assert primary.primary
46
+ assert primary.provision
47
+ assert primary.ip
48
+ assert primary.ip6
49
+
50
+ ForemanDiscovery::LldpNeighbors.eventually_make_bond(host)
51
+
52
+ bond = host.primary_interface
53
+
54
+ assert_nil primary.ip
55
+ assert_nil primary.ip6
56
+ assert_nil primary.name
57
+ assert_not primary.primary
58
+ assert_not primary.provision
59
+ assert_not primary.managed
60
+
61
+ assert bond.primary
62
+ assert bond.provision
63
+ assert bond.ip
64
+ assert bond.ip6
65
+ assert_equal bond.type, 'Nic::Bond'
66
+ assert_equal bond.identifier, 'bond0'
67
+ end
68
+
35
69
  private
36
70
 
37
71
  def simple_facts
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_discovery
3
3
  version: !ruby/object:Gem::Version
4
- version: 25.0.0
4
+ version: 25.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aditi Puntambekar
@@ -76,7 +76,7 @@ authors:
76
76
  autorequire:
77
77
  bindir: bin
78
78
  cert_chain: []
79
- date: 2024-09-12 00:00:00.000000000 Z
79
+ date: 2025-01-27 00:00:00.000000000 Z
80
80
  dependencies: []
81
81
  description: MaaS Discovery Plugin engine for Foreman
82
82
  email: gsutclif@redhat.com
@@ -112,6 +112,7 @@ files:
112
112
  - app/controllers/concerns/foreman/controller/parameters/discovered_host.rb
113
113
  - app/controllers/concerns/foreman/controller/parameters/discovery_rule.rb
114
114
  - app/controllers/discovered_hosts_controller.rb
115
+ - app/controllers/discovered_hosts_controller.rb.orig
115
116
  - app/controllers/discovery_rules_controller.rb
116
117
  - app/controllers/foreman_discovery/concerns/hosts_controller_extensions.rb
117
118
  - app/helpers/discovered_hosts_helper.rb
@@ -351,7 +352,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
351
352
  - !ruby/object:Gem::Version
352
353
  version: '0'
353
354
  requirements: []
354
- rubygems_version: 3.2.33
355
+ rubygems_version: 3.5.23
355
356
  signing_key:
356
357
  specification_version: 4
357
358
  summary: MaaS Discovery Plugin for Foreman