foreman_rh_cloud 13.2.8 → 14.0.1
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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/foreman_rh_cloud/locale/fr/foreman_rh_cloud.js +61 -61
- data/app/assets/javascripts/foreman_rh_cloud/locale/ja/foreman_rh_cloud.js +68 -68
- data/app/assets/javascripts/foreman_rh_cloud/locale/ka/foreman_rh_cloud.js +9 -9
- data/app/assets/javascripts/foreman_rh_cloud/locale/ko/foreman_rh_cloud.js +60 -60
- data/app/assets/javascripts/foreman_rh_cloud/locale/zh_CN/foreman_rh_cloud.js +60 -60
- data/app/models/concerns/rh_cloud_host.rb +1 -31
- data/app/services/foreman_rh_cloud/insights_api_forwarder.rb +5 -12
- data/lib/foreman_inventory_upload/async/create_missing_insights_facets.rb +2 -8
- data/lib/foreman_inventory_upload/generators/fact_helpers.rb +0 -8
- data/lib/foreman_inventory_upload/generators/queries.rb +1 -1
- data/lib/foreman_inventory_upload/generators/slice.rb +1 -1
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/lib/insights_cloud/async/vmaas_reposcan_sync.rb +8 -23
- data/locale/fr/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
- data/locale/fr/foreman_rh_cloud.edit.po +1032 -0
- data/locale/fr/foreman_rh_cloud.po +65 -66
- data/locale/fr/foreman_rh_cloud.po.time_stamp +0 -0
- data/locale/ja/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
- data/locale/ja/foreman_rh_cloud.edit.po +1026 -0
- data/locale/ja/foreman_rh_cloud.po +70 -72
- data/locale/ja/foreman_rh_cloud.po.time_stamp +0 -0
- data/locale/ka/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
- data/locale/ka/foreman_rh_cloud.edit.po +1025 -0
- data/locale/ka/foreman_rh_cloud.po +10 -11
- data/locale/ka/foreman_rh_cloud.po.time_stamp +0 -0
- data/locale/ko/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
- data/locale/ko/foreman_rh_cloud.edit.po +1029 -0
- data/locale/ko/foreman_rh_cloud.po +63 -64
- data/locale/ko/foreman_rh_cloud.po.time_stamp +0 -0
- data/locale/zh_CN/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
- data/locale/zh_CN/foreman_rh_cloud.edit.po +1031 -0
- data/locale/zh_CN/foreman_rh_cloud.po +64 -65
- data/locale/zh_CN/foreman_rh_cloud.po.time_stamp +0 -0
- data/package.json +1 -1
- data/test/controllers/insights_cloud/api/machine_telemetries_controller_test.rb +1 -1
- data/test/jobs/inventory_full_sync_test.rb +4 -7
- data/test/jobs/inventory_hosts_sync_test.rb +5 -7
- data/test/jobs/inventory_self_host_sync_test.rb +1 -1
- data/test/unit/archived_report_generator_test.rb +1 -2
- data/test/unit/fact_helpers_test.rb +0 -16
- data/test/unit/lib/insights_cloud/async/vmaas_reposcan_sync_test.rb +25 -80
- data/test/unit/rh_cloud_host_test.rb +0 -154
- data/test/unit/services/foreman_rh_cloud/branch_info_test.rb +1 -1
- data/test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb +1 -1
- data/test/unit/slice_generator_test.rb +2 -21
- data/webpack/CVEsHostDetailsTab/CVEsHostDetailsTab.js +1 -6
- data/webpack/CVEsHostDetailsTab/__tests__/CVEsHostDetailsTab.test.js +6 -45
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/PageDescription.js +1 -3
- data/webpack/ForemanInventoryUpload/ForemanInventoryHelpers.js +0 -7
- data/webpack/InsightsHostDetailsTab/NewHostDetailsTab.js +14 -44
- metadata +16 -4
- data/webpack/InsightsHostDetailsTab/__tests__/NewHostDetailsTab.test.js +0 -154
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
"locale_data": {
|
|
4
4
|
"foreman_rh_cloud": {
|
|
5
5
|
"": {
|
|
6
|
-
"Project-Id-Version": "foreman_rh_cloud
|
|
6
|
+
"Project-Id-Version": "foreman_rh_cloud 13.2.0",
|
|
7
7
|
"Report-Msgid-Bugs-To": "",
|
|
8
8
|
"PO-Revision-Date": "2023-01-20 13:26+0000",
|
|
9
|
-
"Last-Translator": "Ondřej Gajdušek,
|
|
9
|
+
"Last-Translator": "Ondřej Gajdušek, 2025",
|
|
10
10
|
"Language-Team": "Chinese (China) (https://app.transifex.com/foreman/teams/114/zh_CN/)",
|
|
11
11
|
"MIME-Version": "1.0",
|
|
12
12
|
"Content-Type": "text/plain; charset=UTF-8",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"%s 机构"
|
|
25
25
|
],
|
|
26
26
|
"A specific organization must be selected from the organization context.": [
|
|
27
|
-
"
|
|
27
|
+
""
|
|
28
28
|
],
|
|
29
29
|
"About subscription watch": [
|
|
30
30
|
"订阅查看"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"现在选择了所有建议。"
|
|
40
40
|
],
|
|
41
41
|
"Analysis disabled": [
|
|
42
|
-
"
|
|
42
|
+
""
|
|
43
43
|
],
|
|
44
44
|
"Analytics data collection": [
|
|
45
45
|
"数据收集分析"
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"应用 Insights 建议"
|
|
52
52
|
],
|
|
53
53
|
"Attempted to destroy HBI host %s, but host does not exist in HBI": [
|
|
54
|
-
"
|
|
54
|
+
""
|
|
55
55
|
],
|
|
56
56
|
"Automatic inventory upload": [
|
|
57
57
|
"自动清单上传"
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"完成"
|
|
94
94
|
],
|
|
95
95
|
"Completed with warnings": [
|
|
96
|
-
"
|
|
96
|
+
""
|
|
97
97
|
],
|
|
98
98
|
"Configure": [
|
|
99
99
|
"配置"
|
|
@@ -114,13 +114,13 @@
|
|
|
114
114
|
"当前页"
|
|
115
115
|
],
|
|
116
116
|
"Details": [
|
|
117
|
-
"
|
|
117
|
+
""
|
|
118
118
|
],
|
|
119
119
|
"Disable": [
|
|
120
|
-
"
|
|
120
|
+
""
|
|
121
121
|
],
|
|
122
122
|
"Disable vulnerability analysis": [
|
|
123
|
-
"
|
|
123
|
+
""
|
|
124
124
|
],
|
|
125
125
|
"Disconnected hosts: ": [
|
|
126
126
|
"断开连接的主机:"
|
|
@@ -138,28 +138,28 @@
|
|
|
138
138
|
"下载最新的报告"
|
|
139
139
|
],
|
|
140
140
|
"Download report": [
|
|
141
|
-
"
|
|
141
|
+
""
|
|
142
142
|
],
|
|
143
143
|
"Duration": [
|
|
144
|
-
"
|
|
144
|
+
""
|
|
145
145
|
],
|
|
146
146
|
"Enable": [
|
|
147
|
-
"
|
|
147
|
+
""
|
|
148
148
|
],
|
|
149
149
|
"Enable automatic deletion of mismatched host records from the Red Hat cloud": [
|
|
150
150
|
"启用自动删除来自红帽云的主机记录"
|
|
151
151
|
],
|
|
152
152
|
"Enable automatic deletion of mismatched host records from the Red Hat cloud. Ignored when using local Insights.": [
|
|
153
|
-
"
|
|
153
|
+
""
|
|
154
154
|
],
|
|
155
155
|
"Enable automatic synchronization of Insights recommendations from the Red Hat cloud": [
|
|
156
156
|
"启用来自红帽云的 Insights 建议自动同步"
|
|
157
157
|
],
|
|
158
158
|
"Enable automatic synchronization of Insights recommendations from the Red Hat cloud. Ignored when using local Insights.": [
|
|
159
|
-
"
|
|
159
|
+
""
|
|
160
160
|
],
|
|
161
161
|
"Enable automatic upload of your host inventory to the Red Hat cloud. Ignored when using local Insights.": [
|
|
162
|
-
"
|
|
162
|
+
""
|
|
163
163
|
],
|
|
164
164
|
"Enable automatic upload of your hosts inventory to the Red Hat cloud": [
|
|
165
165
|
"启用自动将主机清单上传到红帽云"
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
"启用清单上传"
|
|
172
172
|
],
|
|
173
173
|
"Enable vulnerability analysis": [
|
|
174
|
-
"
|
|
174
|
+
""
|
|
175
175
|
],
|
|
176
176
|
"Encountered an error while trying to access the server:": [
|
|
177
177
|
"在尝试访问服务器时遇到错误:"
|
|
@@ -183,22 +183,22 @@
|
|
|
183
183
|
"将安装的软件包上传到红帽云"
|
|
184
184
|
],
|
|
185
185
|
"Exclude installed packages from being uploaded to the Red Hat cloud. (If insights_minimal_data_collection is set to true, this setting is ignored and installed packages are always excluded.) Ignored when using local Insights.": [
|
|
186
|
-
"
|
|
186
|
+
""
|
|
187
187
|
],
|
|
188
188
|
"Exit Code: %s": [
|
|
189
189
|
"退出代码:%s"
|
|
190
190
|
],
|
|
191
191
|
"Failed": [
|
|
192
|
-
"
|
|
192
|
+
""
|
|
193
193
|
],
|
|
194
194
|
"Failed to destroy HBI host %s: %s": [
|
|
195
|
-
"
|
|
195
|
+
""
|
|
196
196
|
],
|
|
197
197
|
"Failed to fetch hosts": [
|
|
198
|
-
"
|
|
198
|
+
""
|
|
199
199
|
],
|
|
200
200
|
"Failed to update vulnerability analysis status": [
|
|
201
|
-
"
|
|
201
|
+
""
|
|
202
202
|
],
|
|
203
203
|
"Fetch Insights-related host details": [
|
|
204
204
|
"获取与 Insights 相关的主机详情"
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
"生成报告,但不上传"
|
|
238
238
|
],
|
|
239
239
|
"Generated": [
|
|
240
|
-
"
|
|
240
|
+
""
|
|
241
241
|
],
|
|
242
242
|
"Generating": [
|
|
243
243
|
"生成中"
|
|
@@ -264,7 +264,7 @@
|
|
|
264
264
|
"主机 Insights 建议"
|
|
265
265
|
],
|
|
266
266
|
"Host inventory report job": [
|
|
267
|
-
"
|
|
267
|
+
""
|
|
268
268
|
],
|
|
269
269
|
"Host was not uploaded to your RH cloud inventory": [
|
|
270
270
|
"主机没有上传到您的 RH 云清单"
|
|
@@ -288,7 +288,7 @@
|
|
|
288
288
|
"Insights"
|
|
289
289
|
],
|
|
290
290
|
"Invalid response from server": [
|
|
291
|
-
"
|
|
291
|
+
""
|
|
292
292
|
],
|
|
293
293
|
"Inventory": [
|
|
294
294
|
"清单"
|
|
@@ -327,7 +327,7 @@
|
|
|
327
327
|
"低"
|
|
328
328
|
],
|
|
329
329
|
"Manage vulnerability analysis": [
|
|
330
|
-
"
|
|
330
|
+
""
|
|
331
331
|
],
|
|
332
332
|
"Manual": [
|
|
333
333
|
"手册"
|
|
@@ -336,7 +336,7 @@
|
|
|
336
336
|
"最小数据收集"
|
|
337
337
|
],
|
|
338
338
|
"Missing Insights facets created: %s": [
|
|
339
|
-
"
|
|
339
|
+
""
|
|
340
340
|
],
|
|
341
341
|
"Moderate": [
|
|
342
342
|
"中等"
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
"如需更多详细信息,请参阅"
|
|
346
346
|
],
|
|
347
347
|
"N/A": [
|
|
348
|
-
"
|
|
348
|
+
""
|
|
349
349
|
],
|
|
350
350
|
"Next run: ": [
|
|
351
351
|
"下一次运行 :"
|
|
@@ -354,31 +354,31 @@
|
|
|
354
354
|
"否"
|
|
355
355
|
],
|
|
356
356
|
"No account data available.": [
|
|
357
|
-
"
|
|
357
|
+
""
|
|
358
358
|
],
|
|
359
359
|
"No recent tasks": [
|
|
360
|
-
"
|
|
360
|
+
""
|
|
361
361
|
],
|
|
362
362
|
"No recommendations were found for this host!": [
|
|
363
363
|
"没有找到此主机的建议!"
|
|
364
364
|
],
|
|
365
365
|
"No report generation tasks have been run yet.": [
|
|
366
|
-
"
|
|
366
|
+
""
|
|
367
367
|
],
|
|
368
368
|
"No results found": [
|
|
369
369
|
"没有找到结果"
|
|
370
370
|
],
|
|
371
371
|
"No task history": [
|
|
372
|
-
"
|
|
372
|
+
""
|
|
373
373
|
],
|
|
374
374
|
"No task was found": [
|
|
375
375
|
"没有找到任务"
|
|
376
376
|
],
|
|
377
377
|
"No tasks have been run yet.": [
|
|
378
|
-
"
|
|
378
|
+
""
|
|
379
379
|
],
|
|
380
380
|
"None of the selected hosts are registered": [
|
|
381
|
-
"
|
|
381
|
+
""
|
|
382
382
|
],
|
|
383
383
|
"Not reporting": [
|
|
384
384
|
"未报告"
|
|
@@ -402,16 +402,16 @@
|
|
|
402
402
|
"发送到红帽云的模糊主机名"
|
|
403
403
|
],
|
|
404
404
|
"Obfuscate host names sent to the Red Hat cloud. (If insights_minimal_data_collection is set to true, this setting is ignored because host names are not included in the report.) Ignored when using local Insights.": [
|
|
405
|
-
"
|
|
405
|
+
""
|
|
406
406
|
],
|
|
407
407
|
"Obfuscate ipv4 addresses sent to the Red Hat cloud": [
|
|
408
408
|
"发送到红帽云的模糊 ipv4 地址"
|
|
409
409
|
],
|
|
410
410
|
"Obfuscate ipv4 addresses sent to the Red Hat cloud. (If insights_minimal_data_collection is set to true, this setting is ignored because host IPv4 addresses are not included in the report.) Ignored when using local Insights.": [
|
|
411
|
-
"
|
|
411
|
+
""
|
|
412
412
|
],
|
|
413
413
|
"Only include the minimum required data in inventory reports for uploading to Red Hat cloud. When this is true, installed packages are excluded from the report regardless of the exclude_installed_packages setting, and host names and IPv4 addresses are excluded from the report regardless of obfuscation settings. Ignored when using local Insights.": [
|
|
414
|
-
"
|
|
414
|
+
""
|
|
415
415
|
],
|
|
416
416
|
"Only send the minimum required data to Red Hat cloud, obfuscation settings are disabled": [
|
|
417
417
|
"仅将最低所需的数据发送到红帽云,禁用模糊设置"
|
|
@@ -426,19 +426,19 @@
|
|
|
426
426
|
"分页"
|
|
427
427
|
],
|
|
428
428
|
"Paused": [
|
|
429
|
-
"
|
|
429
|
+
""
|
|
430
430
|
],
|
|
431
431
|
"Playbook": [
|
|
432
432
|
"运行 playbook"
|
|
433
433
|
],
|
|
434
434
|
"Previous tasks will appear here.": [
|
|
435
|
-
"
|
|
435
|
+
""
|
|
436
436
|
],
|
|
437
437
|
"RH Cloud": [
|
|
438
438
|
"RH Cloud"
|
|
439
439
|
],
|
|
440
440
|
"RHC daemon id. Ignored when using local Insights.": [
|
|
441
|
-
"
|
|
441
|
+
""
|
|
442
442
|
],
|
|
443
443
|
"Read more about it in RH cloud insights": [
|
|
444
444
|
"在 RH Cloud insights 中了解更多有关它的信息"
|
|
@@ -489,16 +489,16 @@
|
|
|
489
489
|
"补救概述"
|
|
490
490
|
],
|
|
491
491
|
"Report Generation": [
|
|
492
|
-
"
|
|
492
|
+
""
|
|
493
493
|
],
|
|
494
494
|
"Report generation and upload started": [
|
|
495
|
-
"
|
|
495
|
+
""
|
|
496
496
|
],
|
|
497
497
|
"Report generation started": [
|
|
498
|
-
"
|
|
498
|
+
""
|
|
499
499
|
],
|
|
500
500
|
"Report saved to": [
|
|
501
|
-
"
|
|
501
|
+
""
|
|
502
502
|
],
|
|
503
503
|
"Reporting": [
|
|
504
504
|
"报告"
|
|
@@ -516,7 +516,7 @@
|
|
|
516
516
|
"运行 Insights 生成的补救 playbook"
|
|
517
517
|
],
|
|
518
518
|
"Running": [
|
|
519
|
-
"
|
|
519
|
+
""
|
|
520
520
|
],
|
|
521
521
|
"Satellite server has %{hits_count} recommendations by Red Hat": [
|
|
522
522
|
"Satellite 服务器有 %{hits_count} 个红帽提供的建议"
|
|
@@ -537,7 +537,7 @@
|
|
|
537
537
|
"设置"
|
|
538
538
|
],
|
|
539
539
|
"Should import include parameter tags from Foreman? Ignored when using local Insights.": [
|
|
540
|
-
"
|
|
540
|
+
""
|
|
541
541
|
],
|
|
542
542
|
"Show Advanced Settings": [
|
|
543
543
|
"显示高级设置"
|
|
@@ -546,10 +546,10 @@
|
|
|
546
546
|
"显示系统是否被配置为使用本地 iop-advisor-engine。"
|
|
547
547
|
],
|
|
548
548
|
"Single-host report job": [
|
|
549
|
-
"
|
|
549
|
+
""
|
|
550
550
|
],
|
|
551
551
|
"Single-host report job for host %s": [
|
|
552
|
-
"
|
|
552
|
+
""
|
|
553
553
|
],
|
|
554
554
|
"Start inventory synchronization": [
|
|
555
555
|
"启动清单同步"
|
|
@@ -558,13 +558,13 @@
|
|
|
558
558
|
"开始报告生成"
|
|
559
559
|
],
|
|
560
560
|
"Started": [
|
|
561
|
-
"
|
|
561
|
+
""
|
|
562
562
|
],
|
|
563
563
|
"Stopped": [
|
|
564
|
-
"
|
|
564
|
+
""
|
|
565
565
|
],
|
|
566
566
|
"Success": [
|
|
567
|
-
"
|
|
567
|
+
""
|
|
568
568
|
],
|
|
569
569
|
"Successfully synced hosts: ": [
|
|
570
570
|
"成功同步的主机:"
|
|
@@ -603,7 +603,7 @@
|
|
|
603
603
|
"没有适用于您的主机的建议"
|
|
604
604
|
],
|
|
605
605
|
"There were no missing Insights facets": [
|
|
606
|
-
"
|
|
606
|
+
""
|
|
607
607
|
],
|
|
608
608
|
"This action will also enable automatic reports upload": [
|
|
609
609
|
"此操作还会启用自动报告上传"
|
|
@@ -624,7 +624,7 @@
|
|
|
624
624
|
"总风险"
|
|
625
625
|
],
|
|
626
626
|
"Unknown": [
|
|
627
|
-
"
|
|
627
|
+
""
|
|
628
628
|
],
|
|
629
629
|
"Upload hits from iop-advisor-engine": [
|
|
630
630
|
"从 iop-advisor-engine 上传 hits"
|
|
@@ -633,13 +633,13 @@
|
|
|
633
633
|
"上传 hits 信息"
|
|
634
634
|
],
|
|
635
635
|
"Upload is disabled because subscription connection is not enabled. Enable it in Administer > Settings > Content.": [
|
|
636
|
-
"
|
|
636
|
+
""
|
|
637
637
|
],
|
|
638
638
|
"Upload rules related to the hits": [
|
|
639
639
|
"上传与 hits 相关的 rule"
|
|
640
640
|
],
|
|
641
641
|
"Uploaded": [
|
|
642
|
-
"
|
|
642
|
+
""
|
|
643
643
|
],
|
|
644
644
|
"Uploading": [
|
|
645
645
|
"上载中"
|
|
@@ -654,10 +654,10 @@
|
|
|
654
654
|
"禁用 Red Hat Insights"
|
|
655
655
|
],
|
|
656
656
|
"View task": [
|
|
657
|
-
"
|
|
657
|
+
""
|
|
658
658
|
],
|
|
659
659
|
"View task details": [
|
|
660
|
-
"
|
|
660
|
+
""
|
|
661
661
|
],
|
|
662
662
|
"Vulnerabilities": [
|
|
663
663
|
"安全漏洞"
|
|
@@ -666,22 +666,22 @@
|
|
|
666
666
|
"安全漏洞"
|
|
667
667
|
],
|
|
668
668
|
"Vulnerability analysis disabled": [
|
|
669
|
-
"
|
|
669
|
+
""
|
|
670
670
|
],
|
|
671
671
|
"Vulnerability analysis enabled": [
|
|
672
|
-
"
|
|
672
|
+
""
|
|
673
673
|
],
|
|
674
674
|
"Wait and %s": [
|
|
675
675
|
"等待和 %s"
|
|
676
676
|
],
|
|
677
677
|
"Warning": [
|
|
678
|
-
"
|
|
678
|
+
""
|
|
679
679
|
],
|
|
680
680
|
"Whether the resolution requires reboot": [
|
|
681
681
|
"resolution 是否需要重启"
|
|
682
682
|
],
|
|
683
683
|
"You do not have permission to perform this action": [
|
|
684
|
-
"
|
|
684
|
+
""
|
|
685
685
|
],
|
|
686
686
|
"category name": [
|
|
687
687
|
"类别名称"
|
|
@@ -21,8 +21,7 @@ module RhCloudHost
|
|
|
21
21
|
scoped_search :relation => :inventory_sync_status_object, :on => :status, :rename => :insights_inventory_sync_status,
|
|
22
22
|
:complete_value => { :disconnect => ::InventorySync::InventoryStatus::DISCONNECT,
|
|
23
23
|
:sync => ::InventorySync::InventoryStatus::SYNC }
|
|
24
|
-
scoped_search :
|
|
25
|
-
:ext_method => :search_by_insights_uuid, :complete_value => false
|
|
24
|
+
scoped_search :relation => :insights, :on => :uuid, :only_explicit => true, :rename => :insights_uuid
|
|
26
25
|
|
|
27
26
|
def insights_facet
|
|
28
27
|
insights
|
|
@@ -42,33 +41,4 @@ module RhCloudHost
|
|
|
42
41
|
insights_facet.update!(uuid: subscription_facet.uuid)
|
|
43
42
|
end
|
|
44
43
|
end
|
|
45
|
-
|
|
46
|
-
module ClassMethods
|
|
47
|
-
def search_by_insights_uuid(_key, operator, value)
|
|
48
|
-
# Determine which facet table to search based on IoP mode
|
|
49
|
-
facet_table = ForemanRhCloud.with_iop_smart_proxy? ? Katello::Host::SubscriptionFacet.table_name : InsightsFacet.table_name
|
|
50
|
-
|
|
51
|
-
# Build SQL condition
|
|
52
|
-
if ['IN', 'NOT IN'].include?(operator)
|
|
53
|
-
# For IN/NOT IN, value may be an array or comma-separated string
|
|
54
|
-
# Convert to array and build placeholders for each value
|
|
55
|
-
values = value.is_a?(Array) ? value : value.to_s.split(',').map(&:strip)
|
|
56
|
-
placeholders = (['?'] * values.size).join(',')
|
|
57
|
-
condition = sanitize_sql_for_conditions(
|
|
58
|
-
["#{facet_table}.uuid #{operator} (#{placeholders})", *values]
|
|
59
|
-
)
|
|
60
|
-
else
|
|
61
|
-
# For other operators (=, !=, LIKE, etc.), use value_to_sql for proper SQL formatting
|
|
62
|
-
condition = sanitize_sql_for_conditions(
|
|
63
|
-
["#{facet_table}.uuid #{operator} ?", value_to_sql(operator, value)]
|
|
64
|
-
)
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
# Return search parameters with LEFT JOIN to include hosts without facets
|
|
68
|
-
{
|
|
69
|
-
joins: "LEFT JOIN #{facet_table} ON #{facet_table}.host_id = #{Host::Managed.table_name}.id",
|
|
70
|
-
conditions: condition,
|
|
71
|
-
}
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
44
|
end
|
|
@@ -224,21 +224,14 @@ module ForemanRhCloud
|
|
|
224
224
|
def scope_request?(original_request, path)
|
|
225
225
|
return nil unless original_request.get?
|
|
226
226
|
|
|
227
|
-
#
|
|
228
|
-
#
|
|
229
|
-
|
|
230
|
-
# - Has GET permissions defined (explicitly handles GET, even without tags)
|
|
231
|
-
# This ensures patterns like api/vulnerability/v1/cves/[^/]+$ (GET without tags)
|
|
232
|
-
# take precedence over general patterns, while POST-only patterns are ignored.
|
|
233
|
-
matching_patterns = SCOPED_REQUESTS.select do |pattern|
|
|
234
|
-
pattern[:test].match?(path) && (pattern[:tag_name] || pattern.dig(:permissions, 'GET'))
|
|
235
|
-
end
|
|
227
|
+
# Only consider patterns that define tag_name - this ensures patterns without
|
|
228
|
+
# tag_name (permission-only entries) cannot override tag-supporting patterns
|
|
229
|
+
matching_patterns = SCOPED_REQUESTS.select { |pattern| pattern[:tag_name] && pattern[:test].match?(path) }
|
|
236
230
|
return nil if matching_patterns.empty?
|
|
237
231
|
|
|
238
|
-
# Choose the most specific pattern by regex source length
|
|
232
|
+
# Choose the most specific pattern by regex source length for consistency
|
|
233
|
+
# with required_permission_for behavior
|
|
239
234
|
request_pattern = matching_patterns.max_by { |pattern| pattern[:test].source.length }
|
|
240
|
-
|
|
241
|
-
# Return the tag_name (may be nil if the most specific pattern doesn't support tags)
|
|
242
235
|
request_pattern[:tag_name]
|
|
243
236
|
end
|
|
244
237
|
|
|
@@ -7,15 +7,9 @@ module ForemanInventoryUpload
|
|
|
7
7
|
|
|
8
8
|
def run
|
|
9
9
|
organization = ::Organization.find(input[:organization_id])
|
|
10
|
-
|
|
11
|
-
# Note: We can't use scoped_search 'null? insights_uuid' because the null? operator
|
|
12
|
-
# doesn't work with ext_methods - it would check hosts.id IS NULL instead of the facet
|
|
13
|
-
hosts_without_facets = ::ForemanInventoryUpload::Generators::Queries.for_org(organization, use_batches: false)
|
|
14
|
-
.left_outer_joins(:insights)
|
|
15
|
-
.where(insights_facets: { id: nil })
|
|
16
|
-
|
|
10
|
+
hosts_without_facets = ::ForemanInventoryUpload::Generators::Queries.for_org(organization, hosts_query: 'null? insights_uuid')
|
|
17
11
|
facet_count = 0
|
|
18
|
-
hosts_without_facets.
|
|
12
|
+
hosts_without_facets.each do |batch|
|
|
19
13
|
facets = batch.pluck(:id, 'katello_subscription_facets.uuid').map do |host_id, uuid|
|
|
20
14
|
{
|
|
21
15
|
host_id: host_id,
|
|
@@ -28,14 +28,6 @@ module ForemanInventoryUpload
|
|
|
28
28
|
@organization_accounts[organization.id] ||= organization.pools.where.not(account_number: nil).pluck(:account_number).first
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
-
def golden_ticket?(organization)
|
|
32
|
-
result = organization.try(:golden_ticket?)
|
|
33
|
-
result = organization.content_access_mode == 'org_environment' if result.nil?
|
|
34
|
-
|
|
35
|
-
@organization_golden_tickets ||= {}
|
|
36
|
-
@organization_golden_tickets[organization.id] ||= result
|
|
37
|
-
end
|
|
38
|
-
|
|
39
31
|
def cloud_provider(host)
|
|
40
32
|
bios_version = fact_value(host, 'dmi::bios::version')
|
|
41
33
|
|
|
@@ -230,7 +230,7 @@ module ForemanInventoryUpload
|
|
|
230
230
|
@stream.simple_field('system_purpose_sla', host.subscription_facet.service_level)
|
|
231
231
|
@stream.simple_field('distribution_version', fact_value(host, 'distribution::version'))
|
|
232
232
|
@stream.simple_field('satellite_instance_id', Foreman.try(:instance_id))
|
|
233
|
-
@stream.simple_field('is_simple_content_access',
|
|
233
|
+
@stream.simple_field('is_simple_content_access', true)
|
|
234
234
|
@stream.simple_field('is_hostname_obfuscated', !!obfuscate_hostname?(host))
|
|
235
235
|
@stream.simple_field('organization_id', host.organization_id, :last)
|
|
236
236
|
end
|
|
@@ -6,8 +6,6 @@ module InsightsCloud
|
|
|
6
6
|
class VmaasReposcanSync < ::Actions::EntryAction
|
|
7
7
|
include ::ForemanRhCloud::CertAuth
|
|
8
8
|
|
|
9
|
-
HTTP_TOO_MANY_REQUESTS = 429
|
|
10
|
-
|
|
11
9
|
# Subscribe to Katello repository sync hook action, if available
|
|
12
10
|
def self.subscribe
|
|
13
11
|
'Actions::Katello::Repository::SyncHook'.constantize
|
|
@@ -51,9 +49,15 @@ module InsightsCloud
|
|
|
51
49
|
|
|
52
50
|
response
|
|
53
51
|
rescue RestClient::ExceptionWithResponse => e
|
|
54
|
-
|
|
52
|
+
message = "VMaaS reposcan sync failed: #{e.response&.code} - #{e.response&.body}"
|
|
53
|
+
logger.error(message)
|
|
54
|
+
output[:message] = message
|
|
55
|
+
raise
|
|
55
56
|
rescue StandardError => e
|
|
56
|
-
|
|
57
|
+
message = "Error triggering VMaaS reposcan sync: #{e.message}, response: #{e.respond_to?(:response) ? e.response : nil}"
|
|
58
|
+
logger.error(message)
|
|
59
|
+
output[:message] = message
|
|
60
|
+
raise
|
|
57
61
|
end
|
|
58
62
|
|
|
59
63
|
def rescue_strategy_for_self
|
|
@@ -66,25 +70,6 @@ module InsightsCloud
|
|
|
66
70
|
|
|
67
71
|
private
|
|
68
72
|
|
|
69
|
-
def handle_rest_client_error(exception)
|
|
70
|
-
if exception.response&.code == HTTP_TOO_MANY_REQUESTS
|
|
71
|
-
message = "VMaaS reposcan sync skipped: another sync already in progress (#{HTTP_TOO_MANY_REQUESTS})"
|
|
72
|
-
logger.warn(message)
|
|
73
|
-
else
|
|
74
|
-
message = "VMaaS reposcan sync failed: #{exception.response&.code} - #{exception.response&.body}"
|
|
75
|
-
logger.error(message)
|
|
76
|
-
end
|
|
77
|
-
output[:message] = message
|
|
78
|
-
# Do NOT raise - let rescue_strategy_for_self Skip handle this
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
def handle_standard_error(exception)
|
|
82
|
-
message = "Error triggering VMaaS reposcan sync: #{exception.message}"
|
|
83
|
-
logger.error(message)
|
|
84
|
-
output[:message] = message
|
|
85
|
-
# Do NOT raise - let rescue_strategy_for_self Skip handle this
|
|
86
|
-
end
|
|
87
|
-
|
|
88
73
|
def logger
|
|
89
74
|
action_logger
|
|
90
75
|
end
|
|
Binary file
|