foreman_rh_cloud 12.2.6 → 12.2.7

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.
@@ -9,7 +9,6 @@
9
9
  # 0868a4d1af5275b3f70b0a6dac4c99a4, 2023
10
10
  # Ewoud Kohl van Wijngaarden <ewoud+transifex@kohlvanwijngaarden.nl>, 2025
11
11
  #
12
- #, fuzzy
13
12
  msgid ""
14
13
  msgstr ""
15
14
  "Project-Id-Version: foreman_rh_cloud 11.1.0\n"
@@ -42,6 +41,9 @@ msgstr "고급 인벤토리 설정"
42
41
  msgid "All recommendations are now selected."
43
42
  msgstr "모든 권장 사항이 선택되었습니다."
44
43
 
44
+ msgid "Analytics data collection"
45
+ msgstr ""
46
+
45
47
  msgid "Any Organization"
46
48
  msgstr "모든 조직 "
47
49
 
@@ -141,17 +143,14 @@ msgstr "인벤토리 업로드 활성화"
141
143
  msgid "Encountered an error while trying to access the server:"
142
144
  msgstr "서버에 접근하는 동안 오류가 발생했습니다:"
143
145
 
144
- msgid "Exclude installed Packages"
145
- msgstr "설치된 패키지 제외"
146
+ msgid "Exclude installed packages"
147
+ msgstr ""
146
148
 
147
149
  msgid "Exclude installed packages from being uploaded to the Red Hat cloud"
148
150
  msgstr "설치된 패키지가 Red Hat 클라우드에 업로드되는 것을 제외합니다."
149
151
 
150
- msgid "Exclude packages"
151
- msgstr "패키지 제외"
152
-
153
- msgid "Exclude packages from being uploaded to the Red Hat cloud"
154
- msgstr "Red Hat 클라우드에 업로드되는 패키지 제외"
152
+ msgid "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.)"
153
+ msgstr ""
155
154
 
156
155
  msgid "Exit Code: %s"
157
156
  msgstr "종료 코드: %s"
@@ -186,6 +185,9 @@ msgstr "전체 화면"
186
185
  msgid "Generate and upload report"
187
186
  msgstr "보고서 생성 및 업로드"
188
187
 
188
+ msgid "Generate report"
189
+ msgstr ""
190
+
189
191
  msgid "Generate the report, but do not upload"
190
192
  msgstr "보고서를 생성하되 업로드하지 마십시오."
191
193
 
@@ -255,6 +257,9 @@ msgstr "페이지당 항목"
255
257
  msgid "Knowledgebase article"
256
258
  msgstr "지식베이스 문서"
257
259
 
260
+ msgid "Learn more about {minimalDataCollectionSetting}."
261
+ msgstr ""
262
+
258
263
  msgid "List of host UUIDs"
259
264
  msgstr "호스트 UUID 목록"
260
265
 
@@ -270,6 +275,9 @@ msgstr "낮음"
270
275
  msgid "Manual"
271
276
  msgstr "수동"
272
277
 
278
+ msgid "Minimal data collection"
279
+ msgstr ""
280
+
273
281
  msgid "Moderate"
274
282
  msgstr "중간 수준"
275
283
 
@@ -300,21 +308,33 @@ msgstr "동기화할 것이 없습니다. 이 조직에 대한 서브스크립
300
308
  msgid "Notice"
301
309
  msgstr "주의 "
302
310
 
303
- msgid "Obfuscate IPs"
304
- msgstr "IP 난독화"
305
-
306
311
  msgid "Obfuscate host ipv4 addresses"
307
312
  msgstr "호스트 ipv4 주소 난독화"
308
313
 
314
+ msgid "Obfuscate host ipv4 addresses."
315
+ msgstr ""
316
+
309
317
  msgid "Obfuscate host names"
310
318
  msgstr "호스트 이름 난독화"
311
319
 
312
320
  msgid "Obfuscate host names sent to the Red Hat cloud"
313
321
  msgstr "Red Hat 클라우드로 전송된 호스트 이름을 난독화합니다."
314
322
 
323
+ msgid "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.)"
324
+ msgstr ""
325
+
315
326
  msgid "Obfuscate ipv4 addresses sent to the Red Hat cloud"
316
327
  msgstr "Red Hat 클라우드로 전송된 ipv4 주소 난독화"
317
328
 
329
+ msgid "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.)"
330
+ msgstr ""
331
+
332
+ msgid "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."
333
+ msgstr ""
334
+
335
+ msgid "Only send the minimum required data to Red Hat cloud, obfuscation settings are disabled"
336
+ msgstr ""
337
+
318
338
  msgid "Oops! Couldn't find organization that matches your query"
319
339
  msgstr "죄송합니다! 귀하의 쿼리와 일치하는 조직을 찾을 수 없습니다."
320
340
 
@@ -333,9 +353,6 @@ msgstr "RH 클라우드"
333
353
  msgid "RHC daemon id"
334
354
  msgstr "RHC 데몬 ID"
335
355
 
336
- msgid "RHCloud"
337
- msgstr "RHCloud"
338
-
339
356
  msgid "Read more about it in RH cloud insights"
340
357
  msgstr "RH 클라우드 Insights에서 이에 대해 자세히 알아보세요."
341
358
 
@@ -393,8 +410,8 @@ msgstr "해결 방법"
393
410
  msgid "Run RH Cloud playbook"
394
411
  msgstr "RH Cloud playbook 실행"
395
412
 
396
- msgid "Run playbook genrated by Red Hat remediations app"
397
- msgstr "Red Hat Remediations 앱에서 생성된 playbook 실행"
413
+ msgid "Run playbook generated by Red Hat remediations app"
414
+ msgstr ""
398
415
 
399
416
  msgid "Run remediation playbook generated by Insights"
400
417
  msgstr "Insights에서 생성된 수정 playbook 실행"
@@ -408,6 +425,9 @@ msgstr "호스트 제거를 위한 범위 검색 문자열"
408
425
  msgid "Select recommendations from all pages"
409
426
  msgstr "모든 페이지에서 추천을 선택하세요"
410
427
 
428
+ msgid "Send additional data to enhance Insights services, as per the settings"
429
+ msgstr ""
430
+
411
431
  msgid "Set the current organization context for the request"
412
432
  msgstr "요청에 대한 현재 조직 컨텍스트 설정"
413
433
 
@@ -453,8 +473,8 @@ msgstr "Red Hat 하이브리드 클라우드 콘솔은 이 Foreman 인스턴스
453
473
  msgid "The report file %{filename} doesn't exist"
454
474
  msgstr "보고서 파일%{filename}이/가 존재하지 않습니다"
455
475
 
456
- msgid "The scheduled process is disabled because this Foreman is configured with the use_local_advisor_engine option."
457
- msgstr "예약된 프로세스는 이 Foreman이 use_local_advisor_engine 옵션으로 구성되어 있기 때문에 비활성화되었습니다."
476
+ msgid "The scheduled process is disabled because this Foreman is configured with a local IoP Smart Proxy."
477
+ msgstr ""
458
478
 
459
479
  msgid "The server returned the following error: %s"
460
480
  msgstr "서버에서 다음 오류가 반환되었습니다. %s"
@@ -474,6 +494,9 @@ msgstr "이 보고서를 모든 Foreman 조직에 대해 활성화하려면 {upl
474
494
  msgid "To manually upload the data for a specific organization, select an organization and click {restartButtonName}."
475
495
  msgstr "특정 조직에 대한 데이터를 수동으로 업로드하려면 조직을 선택하고 {restartButtonName}를 클릭하십시오."
476
496
 
497
+ msgid "Total CVEs"
498
+ msgstr ""
499
+
477
500
  msgid "Total risk"
478
501
  msgstr "총 위험"
479
502
 
@@ -501,6 +524,12 @@ msgstr "모든 권장 사항 보기"
501
524
  msgid "View in Red Hat Insights"
502
525
  msgstr "Red Hat Insights에서 보기"
503
526
 
527
+ msgid "Vulnerabilities"
528
+ msgstr ""
529
+
530
+ msgid "Vulnerability"
531
+ msgstr ""
532
+
504
533
  msgid "Wait and %s"
505
534
  msgstr "대기 및 %s"
506
535
 
@@ -567,6 +596,9 @@ msgstr "규칙 ID"
567
596
  msgid "rule title"
568
597
  msgstr "규칙 제목"
569
598
 
599
+ msgid "setting minimal data collection"
600
+ msgstr ""
601
+
570
602
  msgid "solution url"
571
603
  msgstr "솔루션 URL"
572
604
 
@@ -10,7 +10,6 @@
10
10
  # Amit Upadhye <aupadhye@redhat.com>, 2023
11
11
  # Ewoud Kohl van Wijngaarden <ewoud+transifex@kohlvanwijngaarden.nl>, 2025
12
12
  #
13
- #, fuzzy
14
13
  msgid ""
15
14
  msgstr ""
16
15
  "Project-Id-Version: foreman_rh_cloud 11.1.0\n"
@@ -44,6 +43,9 @@ msgstr "高级清单设置"
44
43
  msgid "All recommendations are now selected."
45
44
  msgstr "现在选择了所有建议。"
46
45
 
46
+ msgid "Analytics data collection"
47
+ msgstr ""
48
+
47
49
  msgid "Any Organization"
48
50
  msgstr "任意机构"
49
51
 
@@ -143,17 +145,14 @@ msgstr "启用清单上传"
143
145
  msgid "Encountered an error while trying to access the server:"
144
146
  msgstr "在尝试访问服务器时遇到错误:"
145
147
 
146
- msgid "Exclude installed Packages"
147
- msgstr "排除安装的软件包"
148
+ msgid "Exclude installed packages"
149
+ msgstr ""
148
150
 
149
151
  msgid "Exclude installed packages from being uploaded to the Red Hat cloud"
150
152
  msgstr "将安装的软件包上传到红帽云"
151
153
 
152
- msgid "Exclude packages"
153
- msgstr "排除软件包"
154
-
155
- msgid "Exclude packages from being uploaded to the Red Hat cloud"
156
- msgstr "排除软件包上传到红帽云"
154
+ msgid "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.)"
155
+ msgstr ""
157
156
 
158
157
  msgid "Exit Code: %s"
159
158
  msgstr "退出代码:%s"
@@ -188,6 +187,9 @@ msgstr "全屏"
188
187
  msgid "Generate and upload report"
189
188
  msgstr "生成并上传报告"
190
189
 
190
+ msgid "Generate report"
191
+ msgstr ""
192
+
191
193
  msgid "Generate the report, but do not upload"
192
194
  msgstr "生成报告,但不上传"
193
195
 
@@ -257,6 +259,9 @@ msgstr "每页的项"
257
259
  msgid "Knowledgebase article"
258
260
  msgstr "知识库文章"
259
261
 
262
+ msgid "Learn more about {minimalDataCollectionSetting}."
263
+ msgstr ""
264
+
260
265
  msgid "List of host UUIDs"
261
266
  msgstr "主机 UUID 列表"
262
267
 
@@ -272,6 +277,9 @@ msgstr "低"
272
277
  msgid "Manual"
273
278
  msgstr "手册"
274
279
 
280
+ msgid "Minimal data collection"
281
+ msgstr ""
282
+
275
283
  msgid "Moderate"
276
284
  msgstr "中等"
277
285
 
@@ -302,21 +310,33 @@ msgstr "没有同步,此机构没有带有订阅的主机。"
302
310
  msgid "Notice"
303
311
  msgstr "注意事項"
304
312
 
305
- msgid "Obfuscate IPs"
306
- msgstr "模糊 IP"
307
-
308
313
  msgid "Obfuscate host ipv4 addresses"
309
314
  msgstr "模糊的主机 ipv4 地址"
310
315
 
316
+ msgid "Obfuscate host ipv4 addresses."
317
+ msgstr ""
318
+
311
319
  msgid "Obfuscate host names"
312
320
  msgstr "模糊主机名"
313
321
 
314
322
  msgid "Obfuscate host names sent to the Red Hat cloud"
315
323
  msgstr "发送到红帽云的模糊主机名"
316
324
 
325
+ msgid "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.)"
326
+ msgstr ""
327
+
317
328
  msgid "Obfuscate ipv4 addresses sent to the Red Hat cloud"
318
329
  msgstr "发送到红帽云的模糊 ipv4 地址"
319
330
 
331
+ msgid "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.)"
332
+ msgstr ""
333
+
334
+ msgid "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."
335
+ msgstr ""
336
+
337
+ msgid "Only send the minimum required data to Red Hat cloud, obfuscation settings are disabled"
338
+ msgstr ""
339
+
320
340
  msgid "Oops! Couldn't find organization that matches your query"
321
341
  msgstr "未找到与您的查询匹配的机构"
322
342
 
@@ -335,9 +355,6 @@ msgstr "RH Cloud"
335
355
  msgid "RHC daemon id"
336
356
  msgstr "RHC 守护进程 ID"
337
357
 
338
- msgid "RHCloud"
339
- msgstr "RHCloud"
340
-
341
358
  msgid "Read more about it in RH cloud insights"
342
359
  msgstr "在 RH Cloud insights 中了解更多有关它的信息"
343
360
 
@@ -395,8 +412,8 @@ msgstr "解决方案"
395
412
  msgid "Run RH Cloud playbook"
396
413
  msgstr "运行 RH Cloud playbook"
397
414
 
398
- msgid "Run playbook genrated by Red Hat remediations app"
399
- msgstr "运行由红帽补救应用生成的 playbook"
415
+ msgid "Run playbook generated by Red Hat remediations app"
416
+ msgstr ""
400
417
 
401
418
  msgid "Run remediation playbook generated by Insights"
402
419
  msgstr "运行 Insights 生成的补救 playbook"
@@ -410,6 +427,9 @@ msgstr "用于删除主机的有范围的搜索字符串"
410
427
  msgid "Select recommendations from all pages"
411
428
  msgstr "在所有页面中选择建议"
412
429
 
430
+ msgid "Send additional data to enhance Insights services, as per the settings"
431
+ msgstr ""
432
+
413
433
  msgid "Set the current organization context for the request"
414
434
  msgstr "设置请求的当前机构上下文"
415
435
 
@@ -455,8 +475,8 @@ msgstr "Red Hat Hybrid Cloud Console 提供了一组云服务,包括 Red Hat I
455
475
  msgid "The report file %{filename} doesn't exist"
456
476
  msgstr "报告文件 %{filename} 不存在"
457
477
 
458
- msgid "The scheduled process is disabled because this Foreman is configured with the use_local_advisor_engine option."
459
- msgstr "调度的进程被禁用,因为此 Foreman 配置了 use_local_advisor_engine 选项。"
478
+ msgid "The scheduled process is disabled because this Foreman is configured with a local IoP Smart Proxy."
479
+ msgstr ""
460
480
 
461
481
  msgid "The server returned the following error: %s"
462
482
  msgstr "服务器返回以下错误:%s"
@@ -476,6 +496,9 @@ msgstr "要为所有 Foreman 机构启用此报告,请将 {uploadButtonName}
476
496
  msgid "To manually upload the data for a specific organization, select an organization and click {restartButtonName}."
477
497
  msgstr "要手动上传特定机构的数据,请选择机构并点 {restartButtonName}。"
478
498
 
499
+ msgid "Total CVEs"
500
+ msgstr ""
501
+
479
502
  msgid "Total risk"
480
503
  msgstr "总风险"
481
504
 
@@ -503,6 +526,12 @@ msgstr "查看所有建议"
503
526
  msgid "View in Red Hat Insights"
504
527
  msgstr "禁用 Red Hat Insights"
505
528
 
529
+ msgid "Vulnerabilities"
530
+ msgstr ""
531
+
532
+ msgid "Vulnerability"
533
+ msgstr ""
534
+
506
535
  msgid "Wait and %s"
507
536
  msgstr "等待和 %s"
508
537
 
@@ -569,6 +598,9 @@ msgstr "rule id"
569
598
  msgid "rule title"
570
599
  msgstr "rule 标题"
571
600
 
601
+ msgid "setting minimal data collection"
602
+ msgstr ""
603
+
572
604
  msgid "solution url"
573
605
  msgstr "solution url"
574
606
 
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foreman_rh_cloud",
3
- "version": "12.2.6",
3
+ "version": "12.2.7",
4
4
  "description": "Inventory Upload =============",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -88,3 +88,7 @@
88
88
  #new_host_details_insights_tab {
89
89
  padding: 24px;
90
90
  }
91
+
92
+ #total-risks-dropdown-container ul.pf-v5-c-menu__list {
93
+ margin-bottom: 0px;
94
+ }
@@ -3,8 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import { useDispatch } from 'react-redux';
4
4
  import { push } from 'connected-react-router';
5
5
  import { useHistory } from 'react-router-dom';
6
- import { Bullseye, Title } from '@patternfly/react-core';
7
- import { DropdownItem } from '@patternfly/react-core/deprecated';
6
+ import { Bullseye, DropdownItem, Title } from '@patternfly/react-core';
8
7
  import {
9
8
  ChartDonut,
10
9
  ChartLegend,
@@ -127,6 +126,7 @@ const InsightsTotalRiskCard = ({ hostDetails: { id } }) => {
127
126
  return (
128
127
  <CardTemplate
129
128
  header={__('Total risks')}
129
+ overrideDropdownProps={{ id: 'total-risks-dropdown-container' }}
130
130
  dropdownItems={[
131
131
  <DropdownItem
132
132
  key="insights-tab"
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_rh_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.2.6
4
+ version: 12.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team
8
+ autorequire:
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2025-09-15 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: foreman_ansible
@@ -217,7 +218,6 @@ files:
217
218
  - lib/insights_cloud/async/insights_rules_sync.rb
218
219
  - lib/insights_cloud/async/insights_scheduled_sync.rb
219
220
  - lib/insights_cloud/async/rules_result.rb
220
- - lib/insights_cloud/async/vmaas_reposcan_sync.rb
221
221
  - lib/insights_cloud/generators/playbook_progress_generator.rb
222
222
  - lib/insights_vulnerability.rb
223
223
  - lib/inventory_sync/async/host_result.rb
@@ -277,7 +277,6 @@ files:
277
277
  - test/unit/fact_helpers_test.rb
278
278
  - test/unit/foreman_rh_cloud_self_host_test.rb
279
279
  - test/unit/insights_facet_test.rb
280
- - test/unit/lib/insights_cloud/async/vmaas_reposcan_sync_test.rb
281
280
  - test/unit/metadata_generator_test.rb
282
281
  - test/unit/playbook_progress_generator_test.rb
283
282
  - test/unit/rh_cloud_http_proxy_test.rb
@@ -677,6 +676,7 @@ homepage: https://github.com/theforeman/foreman_rh_cloud
677
676
  licenses:
678
677
  - GPL-3.0
679
678
  metadata: {}
679
+ post_install_message:
680
680
  rdoc_options: []
681
681
  require_paths:
682
682
  - lib
@@ -694,7 +694,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
694
694
  - !ruby/object:Gem::Version
695
695
  version: '0'
696
696
  requirements: []
697
- rubygems_version: 3.6.9
697
+ rubygems_version: 3.2.33
698
+ signing_key:
698
699
  specification_version: 4
699
700
  summary: Summary of ForemanRhCloud.
700
701
  test_files:
@@ -731,7 +732,6 @@ test_files:
731
732
  - test/unit/fact_helpers_test.rb
732
733
  - test/unit/foreman_rh_cloud_self_host_test.rb
733
734
  - test/unit/insights_facet_test.rb
734
- - test/unit/lib/insights_cloud/async/vmaas_reposcan_sync_test.rb
735
735
  - test/unit/metadata_generator_test.rb
736
736
  - test/unit/playbook_progress_generator_test.rb
737
737
  - test/unit/rh_cloud_http_proxy_test.rb
@@ -1,71 +0,0 @@
1
- require 'rest-client'
2
-
3
- module InsightsCloud
4
- module Async
5
- # Triggers VMaaS reposcan sync via IoP gateway when repositories are synced
6
- class VmaasReposcanSync < ::Actions::EntryAction
7
- include ::ForemanRhCloud::CertAuth
8
-
9
- # Subscribe to Katello repository sync hook action, if available
10
- def self.subscribe
11
- 'Actions::Katello::Repository::SyncHook'.constantize
12
- rescue NameError
13
- Rails.logger.debug('VMaaS reposcan sync: Repository::SyncHook action not found')
14
- nil
15
- end
16
-
17
- def plan(repo, *_args)
18
- return unless ::ForemanRhCloud.with_iop_smart_proxy?
19
-
20
- repo_id = repo.is_a?(Hash) ? (repo[:id] || repo['id']) : nil
21
- unless repo_id
22
- logger.error("VMaaS reposcan sync: missing repository id in SyncHook plan parameters: #{repo.inspect}")
23
- return
24
- end
25
-
26
- plan_self
27
- end
28
-
29
- def run
30
- url = ::InsightsCloud.vmaas_reposcan_sync_url
31
-
32
- response = execute_cloud_request(
33
- method: :put,
34
- url: url,
35
- headers: { 'Content-Type' => 'application/json' }
36
- )
37
-
38
- if response.code >= 200 && response.code < 300
39
- message = "VMaaS reposcan sync triggered successfully: #{response.code}"
40
- logger.info(message)
41
- else
42
- message = "VMaaS reposcan sync failed with status: #{response.code}, body: #{response.body}"
43
- logger.error(message)
44
- end
45
- output[:message] = message
46
-
47
- response
48
- rescue RestClient::ExceptionWithResponse => e
49
- message = "VMaaS reposcan sync failed: #{e.response&.code} - #{e.response&.body}"
50
- logger.error(message)
51
- output[:message] = message
52
- raise
53
- rescue StandardError => e
54
- message = "Error triggering VMaaS reposcan sync: #{e.message}, response: #{e.respond_to?(:response) ? e.response : nil}"
55
- logger.error(message)
56
- output[:message] = message
57
- raise
58
- end
59
-
60
- def rescue_strategy_for_self
61
- Dynflow::Action::Rescue::Skip
62
- end
63
-
64
- private
65
-
66
- def logger
67
- action_logger
68
- end
69
- end
70
- end
71
- end
@@ -1,137 +0,0 @@
1
- require 'test_plugin_helper'
2
- require 'foreman_tasks/test_helpers'
3
-
4
- class VmaasReposcanSyncTest < ActiveSupport::TestCase
5
- include ForemanTasks::TestHelpers::WithInThreadExecutor
6
-
7
- setup do
8
- @repo_payload = { id: 123 }
9
- @expected_url = 'https://example.com/api/v1/vmaas/reposcan/sync'
10
- InsightsCloud.stubs(:vmaas_reposcan_sync_url).returns(@expected_url)
11
- ForemanRhCloud.stubs(:with_iop_smart_proxy?).returns(true)
12
- end
13
-
14
- # Planning behavior
15
- test 'plan plans_self when repo payload has id and IoP is available' do
16
- InsightsCloud::Async::VmaasReposcanSync.any_instance.expects(:plan_self).once
17
-
18
- ForemanTasks.sync_task(InsightsCloud::Async::VmaasReposcanSync, @repo_payload)
19
- end
20
-
21
- test 'plan does not plan_self when repo payload is missing id' do
22
- payload_without_id = {}
23
-
24
- mock_logger = mock('logger')
25
- mock_logger.expects(:error).with { |msg| msg =~ /missing repository id/i }
26
- InsightsCloud::Async::VmaasReposcanSync.any_instance.stubs(:logger).returns(mock_logger)
27
- InsightsCloud::Async::VmaasReposcanSync.any_instance.expects(:plan_self).never
28
-
29
- ForemanTasks.sync_task(InsightsCloud::Async::VmaasReposcanSync, payload_without_id)
30
- end
31
-
32
- test 'plan does not plan_self when IoP smart proxy is not available' do
33
- ForemanRhCloud.stubs(:with_iop_smart_proxy?).returns(false)
34
-
35
- InsightsCloud::Async::VmaasReposcanSync.any_instance.expects(:plan_self).never
36
-
37
- ForemanTasks.sync_task(InsightsCloud::Async::VmaasReposcanSync, @repo_payload)
38
- end
39
-
40
- test 'plan skips repo_id validation when IoP smart proxy is not available' do
41
- ForemanRhCloud.stubs(:with_iop_smart_proxy?).returns(false)
42
- payload_without_id = {}
43
-
44
- # Logger should not be called since IoP check returns early
45
- InsightsCloud::Async::VmaasReposcanSync.any_instance.expects(:logger).never
46
- InsightsCloud::Async::VmaasReposcanSync.any_instance.expects(:plan_self).never
47
-
48
- ForemanTasks.sync_task(InsightsCloud::Async::VmaasReposcanSync, payload_without_id)
49
- end
50
-
51
- test 'plan does not plan_self when repository is nil' do
52
- mock_logger = mock('logger')
53
- mock_logger.expects(:error).with { |msg| msg =~ /missing repository id/i }
54
- InsightsCloud::Async::VmaasReposcanSync.any_instance.stubs(:logger).returns(mock_logger)
55
- InsightsCloud::Async::VmaasReposcanSync.any_instance.expects(:plan_self).never
56
-
57
- ForemanTasks.sync_task(InsightsCloud::Async::VmaasReposcanSync, nil)
58
- end
59
-
60
- # Run behavior
61
- test 'run triggers VMaaS reposcan sync successfully' do
62
- mock_response = mock('response')
63
- mock_response.stubs(:code).returns(200)
64
-
65
- InsightsCloud::Async::VmaasReposcanSync.any_instance
66
- .expects(:execute_cloud_request)
67
- .with do |params|
68
- params[:method] == :put &&
69
- params[:url] == @expected_url &&
70
- params[:headers].is_a?(Hash) &&
71
- params[:headers]['Content-Type'] == 'application/json'
72
- end
73
- .returns(mock_response)
74
-
75
- task = ForemanTasks.sync_task(InsightsCloud::Async::VmaasReposcanSync, @repo_payload)
76
-
77
- assert_equal 'VMaaS reposcan sync triggered successfully: 200', task.output[:message]
78
- end
79
-
80
- test 'run sets error message in task output for failed response' do
81
- mock_response = mock('response')
82
- mock_response.stubs(:code).returns(500)
83
- mock_response.stubs(:body).returns('Internal Server Error')
84
-
85
- InsightsCloud::Async::VmaasReposcanSync.any_instance
86
- .stubs(:execute_cloud_request)
87
- .returns(mock_response)
88
-
89
- task = ForemanTasks.sync_task(InsightsCloud::Async::VmaasReposcanSync, @repo_payload)
90
-
91
- assert_equal 'VMaaS reposcan sync failed with status: 500, body: Internal Server Error', task.output[:message]
92
- end
93
-
94
- test 'run sets error message in task output for RestClient exception' do
95
- error_response = mock('error_response')
96
- error_response.stubs(:code).returns(500)
97
- error_response.stubs(:body).returns('Server Error')
98
- exception = RestClient::ExceptionWithResponse.new(error_response)
99
-
100
- InsightsCloud::Async::VmaasReposcanSync.any_instance
101
- .stubs(:execute_cloud_request)
102
- .raises(exception)
103
-
104
- error = assert_raises(ForemanTasks::TaskError) do
105
- ForemanTasks.sync_task(InsightsCloud::Async::VmaasReposcanSync, @repo_payload)
106
- end
107
-
108
- assert_equal 'VMaaS reposcan sync failed: 500 - Server Error', error.task.output[:message]
109
- end
110
-
111
- test 'run sets error message in task output for StandardError exception' do
112
- InsightsCloud::Async::VmaasReposcanSync.any_instance
113
- .stubs(:execute_cloud_request)
114
- .raises(StandardError.new('Network timeout'))
115
-
116
- error = assert_raises(ForemanTasks::TaskError) do
117
- ForemanTasks.sync_task(InsightsCloud::Async::VmaasReposcanSync, @repo_payload)
118
- end
119
-
120
- # The task is available via main_action
121
- assert_match(/Error triggering VMaaS reposcan sync: Network timeout, response: /,
122
- error.task.main_action.output[:message])
123
- end
124
-
125
- test 'run logs and re-raises when cloud request returns error response' do
126
- error_response = mock('error_response', code: 500, body: 'error')
127
- exception = RestClient::ExceptionWithResponse.new(error_response)
128
-
129
- InsightsCloud::Async::VmaasReposcanSync.any_instance
130
- .stubs(:execute_cloud_request)
131
- .raises(exception)
132
-
133
- assert_raises(ForemanTasks::TaskError) do
134
- ForemanTasks.sync_task(InsightsCloud::Async::VmaasReposcanSync, @repo_payload)
135
- end
136
- end
137
- end