foreman_rh_cloud 3.0.26 → 4.0.21.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/foreman_inventory_upload/reports_controller.rb +1 -3
  3. data/app/controllers/foreman_inventory_upload/tasks_controller.rb +13 -5
  4. data/app/controllers/foreman_inventory_upload/uploads_controller.rb +4 -4
  5. data/app/controllers/insights_cloud/api/machine_telemetries_controller.rb +3 -6
  6. data/app/controllers/insights_cloud/hits_controller.rb +3 -7
  7. data/app/models/insights_client_report_status.rb +22 -11
  8. data/app/services/foreman_rh_cloud/cloud_auth.rb +0 -16
  9. data/app/services/foreman_rh_cloud/cloud_request_forwarder.rb +14 -11
  10. data/app/services/foreman_rh_cloud/remediations_retriever.rb +4 -6
  11. data/app/subscribers/foreman_rh_cloud/insights_subscriber.rb +9 -0
  12. data/config/Gemfile.lock.gh_test +95 -93
  13. data/config/routes.rb +1 -20
  14. data/lib/foreman_inventory_upload/generators/fact_helpers.rb +0 -19
  15. data/lib/foreman_inventory_upload/generators/queries.rb +0 -1
  16. data/lib/foreman_inventory_upload/generators/slice.rb +5 -6
  17. data/lib/foreman_inventory_upload/generators/tags.rb +1 -3
  18. data/lib/foreman_inventory_upload.rb +1 -9
  19. data/lib/foreman_rh_cloud/engine.rb +10 -17
  20. data/lib/foreman_rh_cloud/version.rb +1 -1
  21. data/lib/insights_cloud/async/insights_full_sync.rb +14 -9
  22. data/lib/insights_cloud/async/insights_resolutions_sync.rb +6 -13
  23. data/lib/insights_cloud/async/insights_rules_sync.rb +9 -13
  24. data/lib/inventory_sync/async/host_result.rb +0 -4
  25. data/lib/inventory_sync/async/inventory_full_sync.rb +1 -7
  26. data/lib/inventory_sync/async/inventory_hosts_sync.rb +2 -21
  27. data/lib/inventory_sync/async/inventory_scheduled_sync.rb +0 -12
  28. data/lib/inventory_sync/async/query_inventory_job.rb +5 -6
  29. data/lib/tasks/insights.rake +0 -15
  30. data/lib/tasks/rh_cloud_inventory.rake +1 -8
  31. data/package.json +1 -1
  32. data/test/controllers/insights_cloud/api/machine_telemetries_controller_test.rb +0 -41
  33. data/test/factories/inventory_upload_factories.rb +1 -1
  34. data/test/jobs/insights_full_sync_test.rb +0 -1
  35. data/test/jobs/insights_resolutions_sync_test.rb +1 -11
  36. data/test/jobs/insights_rules_sync_test.rb +0 -1
  37. data/test/jobs/inventory_full_sync_test.rb +0 -10
  38. data/test/models/insights_client_report_status_test.rb +72 -70
  39. data/test/test_plugin_helper.rb +0 -2
  40. data/test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb +3 -4
  41. data/test/unit/services/foreman_rh_cloud/template_renderer_helper_test.rb +0 -1
  42. data/test/unit/slice_generator_test.rb +27 -70
  43. data/test/unit/tags_generator_test.rb +0 -41
  44. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/PageDescription.js +0 -11
  45. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/__tests__/__snapshots__/PageDescription.test.js.snap +0 -11
  46. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButtonActions.js +63 -28
  47. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/__snapshots__/integrations.test.js.snap +3 -2
  48. data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableActions.js +19 -19
  49. data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/__snapshots__/InsightsTableActions.test.js.snap +14 -14
  50. data/webpack/InsightsCloudSync/Components/RemediationModal/RemediateButton.js +0 -1
  51. data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationModal.scss +0 -14
  52. data/webpack/InsightsCloudSync/Components/__tests__/__snapshots__/NoTokenEmptyState.test.js.snap +13 -20
  53. data/webpack/InsightsCloudSync/InsightsCloudSync.js +1 -4
  54. data/webpack/InsightsCloudSync/InsightsCloudSyncActions.js +20 -44
  55. data/webpack/InsightsCloudSync/InsightsCloudSyncConstants.js +0 -2
  56. data/webpack/InsightsCloudSync/__snapshots__/InsightsCloudSync.test.js.snap +2 -2
  57. data/webpack/InsightsCloudSync/__tests__/__snapshots__/InsightsCloudSyncActions.test.js.snap +7 -11
  58. metadata +4 -30
  59. data/app/controllers/api/v2/rh_cloud/inventory_controller.rb +0 -50
  60. data/app/controllers/concerns/inventory_upload/report_actions.rb +0 -26
  61. data/app/controllers/concerns/inventory_upload/task_actions.rb +0 -25
  62. data/app/helpers/foreman_insights_deprecations_helper.rb +0 -9
  63. data/app/helpers/foreman_insights_host_helper.rb +0 -19
  64. data/app/overrides/old_plugin_deprecation.rb +0 -20
  65. data/app/services/foreman_rh_cloud/cloud_request.rb +0 -14
  66. data/app/services/foreman_rh_cloud/insights_status_cleaner.rb +0 -17
  67. data/config/package-lock.json.plugin +0 -32774
  68. data/db/migrate/20210720000001_remove_old_insights_statuses.foreman_rh_cloud.rb +0 -6
  69. data/lib/insights_cloud/async/insights_client_status_aging.rb +0 -23
  70. data/lib/inventory_sync/async/inventory_self_host_sync.rb +0 -39
  71. data/test/controllers/inventory_upload/api/inventory_controller_test.rb +0 -53
  72. data/test/jobs/insights_client_status_aging_test.rb +0 -33
  73. data/test/jobs/inventory_hosts_sync_test.rb +0 -268
  74. data/test/jobs/inventory_scheduled_sync_test.rb +0 -22
  75. data/test/jobs/inventory_self_host_sync_test.rb +0 -104
  76. data/test/unit/services/foreman_rh_cloud/insights_status_cleaner_test.rb +0 -31
  77. data/webpack/common/ForemanTasks/ForemanTasksActions.js +0 -64
  78. data/webpack/common/ForemanTasks/ForemanTasksHelpers.js +0 -7
  79. data/webpack/common/ForemanTasks/index.js +0 -1
@@ -9,27 +9,27 @@ PATH
9
9
  PATH
10
10
  remote: ../katello
11
11
  specs:
12
- katello (3.18.3.1)
12
+ katello (3.18.0.rc1)
13
13
  activerecord-import
14
14
  anemone
15
15
  angular-rails-templates (~> 1.1.0)
16
16
  apipie-rails (>= 0.5.14)
17
17
  deface (>= 1.0.2, < 2.0.0)
18
18
  dynflow (>= 1.2.0)
19
- foreman-tasks (>= 0.14.1, < 4.0)
19
+ foreman-tasks (>= 0.14.1)
20
20
  foreman_remote_execution (>= 3.0)
21
21
  fx (< 1.0)
22
22
  gettext_i18n_rails
23
23
  json
24
24
  oauth
25
25
  pg
26
- pulp_2to3_migration_client (>= 0.8.0, < 1.0.0)
26
+ pulp_2to3_migration_client (>= 0.3.0, < 0.6.0, != 0.4.0)
27
27
  pulp_ansible_client (>= 0.2, < 0.5)
28
28
  pulp_certguard_client (< 2.0)
29
29
  pulp_container_client (>= 2.0.0, < 2.2.0)
30
30
  pulp_deb_client (>= 2.6.0, < 2.8.0)
31
31
  pulp_file_client (>= 1.2.0, < 1.4.0)
32
- pulp_rpm_client (>= 3.10.0, < 3.11.0)
32
+ pulp_rpm_client (>= 3.6.2, < 3.8.0)
33
33
  pulpcore_client (>= 3.6.0, < 3.8.0)
34
34
  rabl
35
35
  rails
@@ -41,51 +41,51 @@ PATH
41
41
  GEM
42
42
  remote: https://rubygems.org/
43
43
  specs:
44
- actioncable (6.0.3.6)
45
- actionpack (= 6.0.3.6)
44
+ actioncable (6.0.3.4)
45
+ actionpack (= 6.0.3.4)
46
46
  nio4r (~> 2.0)
47
47
  websocket-driver (>= 0.6.1)
48
- actionmailbox (6.0.3.6)
49
- actionpack (= 6.0.3.6)
50
- activejob (= 6.0.3.6)
51
- activerecord (= 6.0.3.6)
52
- activestorage (= 6.0.3.6)
53
- activesupport (= 6.0.3.6)
48
+ actionmailbox (6.0.3.4)
49
+ actionpack (= 6.0.3.4)
50
+ activejob (= 6.0.3.4)
51
+ activerecord (= 6.0.3.4)
52
+ activestorage (= 6.0.3.4)
53
+ activesupport (= 6.0.3.4)
54
54
  mail (>= 2.7.1)
55
- actionmailer (6.0.3.6)
56
- actionpack (= 6.0.3.6)
57
- actionview (= 6.0.3.6)
58
- activejob (= 6.0.3.6)
55
+ actionmailer (6.0.3.4)
56
+ actionpack (= 6.0.3.4)
57
+ actionview (= 6.0.3.4)
58
+ activejob (= 6.0.3.4)
59
59
  mail (~> 2.5, >= 2.5.4)
60
60
  rails-dom-testing (~> 2.0)
61
- actionpack (6.0.3.6)
62
- actionview (= 6.0.3.6)
63
- activesupport (= 6.0.3.6)
61
+ actionpack (6.0.3.4)
62
+ actionview (= 6.0.3.4)
63
+ activesupport (= 6.0.3.4)
64
64
  rack (~> 2.0, >= 2.0.8)
65
65
  rack-test (>= 0.6.3)
66
66
  rails-dom-testing (~> 2.0)
67
67
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
68
- actiontext (6.0.3.6)
69
- actionpack (= 6.0.3.6)
70
- activerecord (= 6.0.3.6)
71
- activestorage (= 6.0.3.6)
72
- activesupport (= 6.0.3.6)
68
+ actiontext (6.0.3.4)
69
+ actionpack (= 6.0.3.4)
70
+ activerecord (= 6.0.3.4)
71
+ activestorage (= 6.0.3.4)
72
+ activesupport (= 6.0.3.4)
73
73
  nokogiri (>= 1.8.5)
74
- actionview (6.0.3.6)
75
- activesupport (= 6.0.3.6)
74
+ actionview (6.0.3.4)
75
+ activesupport (= 6.0.3.4)
76
76
  builder (~> 3.1)
77
77
  erubi (~> 1.4)
78
78
  rails-dom-testing (~> 2.0)
79
79
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
80
- activejob (6.0.3.6)
81
- activesupport (= 6.0.3.6)
80
+ activejob (6.0.3.4)
81
+ activesupport (= 6.0.3.4)
82
82
  globalid (>= 0.3.6)
83
- activemodel (6.0.3.6)
84
- activesupport (= 6.0.3.6)
85
- activerecord (6.0.3.6)
86
- activemodel (= 6.0.3.6)
87
- activesupport (= 6.0.3.6)
88
- activerecord-import (1.1.0)
83
+ activemodel (6.0.3.4)
84
+ activesupport (= 6.0.3.4)
85
+ activerecord (6.0.3.4)
86
+ activemodel (= 6.0.3.4)
87
+ activesupport (= 6.0.3.4)
88
+ activerecord-import (1.0.7)
89
89
  activerecord (>= 3.2)
90
90
  activerecord-nulldb-adapter (0.7.0)
91
91
  activerecord (>= 5.2.0, < 6.3)
@@ -95,12 +95,12 @@ GEM
95
95
  multi_json (~> 1.11, >= 1.11.2)
96
96
  rack (>= 1.5.2, < 3)
97
97
  railties (>= 4.0)
98
- activestorage (6.0.3.6)
99
- actionpack (= 6.0.3.6)
100
- activejob (= 6.0.3.6)
101
- activerecord (= 6.0.3.6)
102
- marcel (~> 1.0.0)
103
- activesupport (6.0.3.6)
98
+ activestorage (6.0.3.4)
99
+ actionpack (= 6.0.3.4)
100
+ activejob (= 6.0.3.4)
101
+ activerecord (= 6.0.3.4)
102
+ marcel (~> 0.3.1)
103
+ activesupport (6.0.3.4)
104
104
  concurrent-ruby (~> 1.0, >= 1.0.2)
105
105
  i18n (>= 0.7, < 2)
106
106
  minitest (~> 5.1)
@@ -109,7 +109,7 @@ GEM
109
109
  addressable (2.7.0)
110
110
  public_suffix (>= 2.0.2, < 5.0)
111
111
  algebrick (0.7.5)
112
- amazing_print (1.3.0)
112
+ amazing_print (1.2.2)
113
113
  ancestry (3.2.1)
114
114
  activerecord (>= 4.2.0)
115
115
  anemone (0.7.2)
@@ -134,15 +134,15 @@ GEM
134
134
  execjs
135
135
  bcrypt (3.1.16)
136
136
  benchmark-ips (2.8.4)
137
- binding_of_caller (0.8.0)
137
+ binding_of_caller (1.0.0)
138
138
  debug_inspector (>= 0.0.1)
139
- bootsnap (1.7.3)
139
+ bootsnap (1.7.1)
140
140
  msgpack (~> 1.0)
141
141
  bootstrap-sass (3.4.1)
142
142
  autoprefixer-rails (>= 5.2.1)
143
143
  sassc (>= 2.0.0)
144
144
  builder (3.2.4)
145
- bullet (6.1.4)
145
+ bullet (6.1.3)
146
146
  activesupport (>= 3.0.0)
147
147
  uniform_notifier (~> 1.11)
148
148
  byebug (11.1.3)
@@ -180,12 +180,12 @@ GEM
180
180
  daemons (1.3.1)
181
181
  database_cleaner (1.99.0)
182
182
  deacon (1.0.0)
183
- debug_inspector (1.1.0)
183
+ debug_inspector (1.0.0)
184
184
  declarative (0.0.20)
185
185
  declarative-option (0.1.0)
186
- deep_cloneable (3.1.0)
186
+ deep_cloneable (3.0.0)
187
187
  activerecord (>= 3.1.0, < 7)
188
- deface (1.8.1)
188
+ deface (1.6.1)
189
189
  nokogiri (>= 1.6)
190
190
  polyglot
191
191
  rails (>= 5.2)
@@ -193,7 +193,7 @@ GEM
193
193
  docile (1.3.5)
194
194
  domain_name (0.5.20190701)
195
195
  unf (>= 0.0.5, < 1.0.0)
196
- dynflow (1.5.0)
196
+ dynflow (1.4.7)
197
197
  algebrick (~> 0.7.0)
198
198
  apipie-params
199
199
  concurrent-ruby (~> 1.1.3)
@@ -203,7 +203,7 @@ GEM
203
203
  erubi (1.10.0)
204
204
  excon (0.79.0)
205
205
  execjs (2.7.0)
206
- facter (4.0.52)
206
+ facter (4.0.50)
207
207
  hocon (~> 1.3)
208
208
  thor (>= 1.0.1, < 2.0)
209
209
  factory_bot (5.2.0)
@@ -270,7 +270,7 @@ GEM
270
270
  sinatra
271
271
  foreman-tasks-core (0.3.4)
272
272
  dynflow (>= 1.2.0)
273
- foreman_ansible (6.2.0)
273
+ foreman_ansible (6.1.1)
274
274
  deface (< 2.0)
275
275
  foreman_remote_execution (>= 4.2.0)
276
276
  ipaddress (>= 0.8.0, < 1.0)
@@ -338,7 +338,7 @@ GEM
338
338
  http-cookie (1.0.3)
339
339
  domain_name (~> 0.5)
340
340
  httpclient (2.8.3)
341
- i18n (1.8.10)
341
+ i18n (1.8.8)
342
342
  concurrent-ruby (~> 1.0)
343
343
  immigrant (0.3.6)
344
344
  activerecord (>= 3.0)
@@ -369,14 +369,16 @@ GEM
369
369
  nokogiri (>= 1.5.9)
370
370
  mail (2.7.1)
371
371
  mini_mime (>= 0.1.1)
372
- marcel (1.0.0)
372
+ marcel (0.3.3)
373
+ mimemagic (~> 0.3.2)
373
374
  maruku (0.7.3)
374
375
  memoist (0.16.2)
375
376
  method_source (1.0.0)
376
377
  mime-types (3.3.1)
377
378
  mime-types-data (~> 3.2015)
378
- mime-types-data (3.2021.0225)
379
- mini_mime (1.0.3)
379
+ mime-types-data (3.2020.1104)
380
+ mimemagic (0.3.5)
381
+ mini_mime (1.0.2)
380
382
  mini_portile2 (2.5.0)
381
383
  minitest (5.10.3)
382
384
  minitest-reporters (1.4.3)
@@ -402,8 +404,8 @@ GEM
402
404
  net-ssh (>= 2.6.5, < 7.0.0)
403
405
  net-ssh (4.2.0)
404
406
  netrc (0.11.0)
405
- nio4r (2.5.7)
406
- nokogiri (1.11.2)
407
+ nio4r (2.5.5)
408
+ nokogiri (1.11.1)
407
409
  mini_portile2 (~> 2.5.0)
408
410
  racc (~> 1.4)
409
411
  oauth (0.5.5)
@@ -413,10 +415,10 @@ GEM
413
415
  json (>= 1, < 3)
414
416
  paint (2.2.1)
415
417
  parallel (1.20.1)
416
- parallel_tests (3.6.0)
418
+ parallel_tests (3.4.0)
417
419
  parallel
418
420
  parse-cron (0.1.4)
419
- parser (3.0.1.1)
421
+ parser (3.0.0.0)
420
422
  ast (~> 2.4.1)
421
423
  patternfly-sass (3.59.5)
422
424
  bootstrap-sass (~> 3.4.0)
@@ -428,12 +430,12 @@ GEM
428
430
  polyglot (0.3.5)
429
431
  prometheus-client (1.0.0)
430
432
  promise.rb (0.7.4)
431
- pry (0.14.0)
433
+ pry (0.13.1)
432
434
  coderay (~> 1.1)
433
435
  method_source (~> 1.0)
434
- pry-byebug (3.8.0)
436
+ pry-byebug (3.9.0)
435
437
  byebug (~> 11.0)
436
- pry (~> 0.10)
438
+ pry (~> 0.13.0)
437
439
  pry-doc (1.1.0)
438
440
  pry (~> 0.11)
439
441
  yard (~> 0.9.11)
@@ -442,20 +444,20 @@ GEM
442
444
  pry-remote (0.1.8)
443
445
  pry (~> 0.9)
444
446
  slop (~> 3.0)
445
- pry-stack_explorer (0.4.13)
446
- binding_of_caller (~> 0.7)
447
+ pry-stack_explorer (0.6.0)
448
+ binding_of_caller (~> 1.0)
447
449
  pry (~> 0.13)
448
450
  public_suffix (4.0.6)
449
- pulp_2to3_migration_client (0.11.2)
451
+ pulp_2to3_migration_client (0.5.1)
450
452
  faraday (>= 0.14.0)
451
453
  json (~> 2.1, >= 2.1.0)
452
454
  pulp_ansible_client (0.4.3)
453
455
  faraday (>= 0.14.0)
454
456
  json (~> 2.1, >= 2.1.0)
455
- pulp_certguard_client (1.3.0)
457
+ pulp_certguard_client (1.1.0)
456
458
  faraday (>= 0.14.0)
457
459
  json (~> 2.1, >= 2.1.0)
458
- pulp_container_client (2.1.2)
460
+ pulp_container_client (2.1.0)
459
461
  faraday (>= 0.14.0)
460
462
  json (~> 2.1, >= 2.1.0)
461
463
  pulp_deb_client (2.7.0)
@@ -464,13 +466,13 @@ GEM
464
466
  pulp_file_client (1.3.0)
465
467
  faraday (>= 0.14.0)
466
468
  json (~> 2.1, >= 2.1.0)
467
- pulp_rpm_client (3.10.0)
469
+ pulp_rpm_client (3.7.0)
468
470
  faraday (>= 0.14.0)
469
471
  json (~> 2.1, >= 2.1.0)
470
- pulpcore_client (3.7.6)
472
+ pulpcore_client (3.7.3)
471
473
  faraday (>= 0.14.0)
472
474
  json (~> 2.1, >= 2.1.0)
473
- puma (4.3.8)
475
+ puma (4.3.7)
474
476
  nio4r (~> 2.0)
475
477
  puma-plugin-systemd (0.1.5)
476
478
  json
@@ -490,20 +492,20 @@ GEM
490
492
  rack
491
493
  rack-test (1.1.0)
492
494
  rack (>= 1.0, < 3)
493
- rails (6.0.3.6)
494
- actioncable (= 6.0.3.6)
495
- actionmailbox (= 6.0.3.6)
496
- actionmailer (= 6.0.3.6)
497
- actionpack (= 6.0.3.6)
498
- actiontext (= 6.0.3.6)
499
- actionview (= 6.0.3.6)
500
- activejob (= 6.0.3.6)
501
- activemodel (= 6.0.3.6)
502
- activerecord (= 6.0.3.6)
503
- activestorage (= 6.0.3.6)
504
- activesupport (= 6.0.3.6)
495
+ rails (6.0.3.4)
496
+ actioncable (= 6.0.3.4)
497
+ actionmailbox (= 6.0.3.4)
498
+ actionmailer (= 6.0.3.4)
499
+ actionpack (= 6.0.3.4)
500
+ actiontext (= 6.0.3.4)
501
+ actionview (= 6.0.3.4)
502
+ activejob (= 6.0.3.4)
503
+ activemodel (= 6.0.3.4)
504
+ activerecord (= 6.0.3.4)
505
+ activestorage (= 6.0.3.4)
506
+ activesupport (= 6.0.3.4)
505
507
  bundler (>= 1.3.0)
506
- railties (= 6.0.3.6)
508
+ railties (= 6.0.3.4)
507
509
  sprockets-rails (>= 2.0.0)
508
510
  rails-controller-testing (1.0.5)
509
511
  actionpack (>= 5.0.1.rc1)
@@ -517,9 +519,9 @@ GEM
517
519
  rails-i18n (6.0.0)
518
520
  i18n (>= 0.7, < 2)
519
521
  railties (>= 6.0.0, < 7)
520
- railties (6.0.3.6)
521
- actionpack (= 6.0.3.6)
522
- activesupport (= 6.0.3.6)
522
+ railties (6.0.3.4)
523
+ actionpack (= 6.0.3.4)
524
+ activesupport (= 6.0.3.4)
523
525
  method_source
524
526
  rake (>= 0.8.7)
525
527
  thor (>= 0.20.3, < 2.0)
@@ -539,7 +541,7 @@ GEM
539
541
  rdoc (6.3.0)
540
542
  record_tag_helper (1.0.1)
541
543
  actionview (>= 5)
542
- redhat_access (2.2.20)
544
+ redhat_access (2.2.18)
543
545
  angular-rails-templates (>= 0.0.4)
544
546
  foreman-tasks
545
547
  katello
@@ -561,7 +563,7 @@ GEM
561
563
  mime-types (>= 1.16, < 4.0)
562
564
  netrc (~> 0.8)
563
565
  retriable (3.1.2)
564
- rexml (3.2.5)
566
+ rexml (3.2.4)
565
567
  rfauxfactory (0.1.5)
566
568
  roadie (4.0.0)
567
569
  css_parser (~> 1.4)
@@ -626,12 +628,12 @@ GEM
626
628
  tilt
627
629
  scoped_search (4.1.9)
628
630
  activerecord (>= 4.2.0)
629
- sd_notify (0.1.1)
630
- secure_headers (6.3.2)
631
+ sd_notify (0.1.0)
632
+ secure_headers (6.3.1)
631
633
  selenium-webdriver (3.142.7)
632
634
  childprocess (>= 0.5, < 4.0)
633
635
  rubyzip (>= 1.2.2)
634
- sequel (5.45.0)
636
+ sequel (5.41.0)
635
637
  sexp_processor (4.15.2)
636
638
  shoulda-context (1.2.2)
637
639
  shoulda-matchers (4.3.0)
@@ -643,7 +645,7 @@ GEM
643
645
  rack (~> 2.0)
644
646
  rack-protection (>= 1.5.0)
645
647
  redis (>= 3.3.5, < 4.2)
646
- signet (0.15.0)
648
+ signet (0.14.1)
647
649
  addressable (~> 2.3)
648
650
  faraday (>= 0.17.3, < 2.0)
649
651
  jwt (>= 1.5, < 3.0)
@@ -688,11 +690,11 @@ GEM
688
690
  unf_ext
689
691
  unf_ext (0.0.7.7)
690
692
  unicode-display_width (1.6.1)
691
- uniform_notifier (1.14.2)
693
+ uniform_notifier (1.13.2)
692
694
  validates_lengths_from_database (0.8.0)
693
695
  activerecord (>= 4)
694
696
  vcr (3.0.3)
695
- webmock (3.12.2)
697
+ webmock (3.11.2)
696
698
  addressable (>= 2.3.6)
697
699
  crack (>= 0.3.2)
698
700
  hashdiff (>= 0.4.0, < 2.0.0)
data/config/routes.rb CHANGED
@@ -37,26 +37,7 @@ Rails.application.routes.draw do
37
37
  end
38
38
 
39
39
  scope '/r/insights' do
40
- match '(/*path)(/)', :constraints => lambda { |req| !req.path.include?('view/api') }, to: 'machine_telemetries#forward_request', via: [:get, :post, :delete,:put, :patch]
41
- end
42
- end
43
-
44
- # API routes
45
-
46
- namespace :api, :defaults => {:format => 'json'} do
47
- scope '(:apiv)', :module => :v2, :defaults => {:apiv => 'v2'}, :apiv => /v1|v2/, :constraints => ApiConstraints.new(:version => 2, :default => true) do
48
- resources :organizations, :only => [:show] do
49
- namespace 'rh_cloud' do
50
- get 'report', to: 'inventory#download_file'
51
- post 'report', to: 'inventory#generate_report'
52
-
53
- post 'inventory_sync', to: 'inventory#sync_inventory_status'
54
- end
55
- end
56
-
57
- namespace 'rh_cloud' do
58
- post 'enable_connector', to: 'inventory#enable_cloud_connector'
59
- end
40
+ match '/*path', :constraints => lambda { |req| !req.path.include?('view/api') }, to: 'machine_telemetries#forward_request', via: [:get, :post, :delete,:put, :patch]
60
41
  end
61
42
  end
62
43
  end
@@ -10,8 +10,6 @@ module ForemanInventoryUpload
10
10
  CLOUD_AZURE = 'azure'
11
11
  CLOUD_ALIBABA = 'alibaba'
12
12
 
13
- UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i
14
-
15
13
  def fact_value(host, fact_name)
16
14
  value_record = host.fact_values.find do |fact_value|
17
15
  fact_value.fact_name_id == ForemanInventoryUpload::Generators::Queries.fact_names[fact_name]
@@ -106,23 +104,6 @@ module ForemanInventoryUpload
106
104
  def obfuscate_ip(ip, ips_dict)
107
105
  "10.230.230.#{ips_dict.count + 1}"
108
106
  end
109
-
110
- def bios_uuid(host)
111
- value = fact_value(host, 'dmi::system::uuid') || ''
112
- uuid_value(value)
113
- end
114
-
115
- def uuid_value(value)
116
- uuid_match = UUID_REGEX.match(value)
117
- uuid_match&.to_s
118
- end
119
-
120
- def uuid_value!(value)
121
- uuid = uuid_value(value)
122
- raise Foreman::Exception.new(N_('Value %{value} is not a valid UUID') % {value: value}) if value && uuid.empty?
123
-
124
- uuid
125
- end
126
107
  end
127
108
  end
128
109
  end
@@ -27,7 +27,6 @@ module ForemanInventoryUpload
27
27
  'insights_client::obfuscate_ip_enabled',
28
28
  'insights_client::hostname',
29
29
  'insights_client::ips',
30
- 'insights_id',
31
30
  ]).pluck(:name, :id)
32
31
  ]
33
32
  end
@@ -25,7 +25,7 @@ module ForemanInventoryUpload
25
25
 
26
26
  def report_slice(hosts_batch)
27
27
  @stream.object do
28
- @stream.simple_field('report_slice_id', uuid_value!(@slice_id))
28
+ @stream.simple_field('report_slice_id', @slice_id)
29
29
  @stream.array_field('hosts', :last) do
30
30
  first = true
31
31
  hosts_batch.each do |host|
@@ -45,11 +45,10 @@ module ForemanInventoryUpload
45
45
  @stream.object do
46
46
  @stream.simple_field('fqdn', fqdn(host))
47
47
  @stream.simple_field('account', account_id(host.organization).to_s)
48
- @stream.simple_field('subscription_manager_id', uuid_value!(host.subscription_facet&.uuid))
49
- @stream.simple_field('satellite_id', uuid_value!(host.subscription_facet&.uuid))
50
- @stream.simple_field('bios_uuid', bios_uuid(host))
51
- @stream.simple_field('vm_uuid', uuid_value(fact_value(host, 'virt::uuid')))
52
- @stream.simple_field('insights_id', uuid_value(fact_value(host, 'insights_id')))
48
+ @stream.simple_field('subscription_manager_id', host.subscription_facet&.uuid)
49
+ @stream.simple_field('satellite_id', host.subscription_facet&.uuid)
50
+ @stream.simple_field('bios_uuid', fact_value(host, 'dmi::system::uuid'))
51
+ @stream.simple_field('vm_uuid', fact_value(host, 'virt::uuid'))
53
52
  report_ip_addresses(host, host_ips_cache)
54
53
  report_mac_addresses(host)
55
54
  @stream.object_field('system_profile') do
@@ -19,9 +19,7 @@ module ForemanInventoryUpload
19
19
  def generate_parameters
20
20
  return [] unless Setting[:include_parameter_tags]
21
21
 
22
- (@host.host_inherited_params_objects || [])
23
- .map { |item| [item.name, item.value] }
24
- .select { |_name, value| value.present? || value.is_a?(FalseClass) }
22
+ (@host.host_inherited_params_objects || []).map { |item| [item.name, item.value] }
25
23
  end
26
24
 
27
25
  private
@@ -70,16 +70,8 @@ module ForemanInventoryUpload
70
70
  folder
71
71
  end
72
72
 
73
- def self.inventory_base_url
74
- ForemanRhCloud.base_url + "/api/inventory/v1/hosts"
75
- end
76
-
77
73
  def self.inventory_export_url
78
74
  tags = URI.encode("satellite/satellite_instance_id=#{Foreman.instance_id}")
79
- inventory_base_url + "?tags=#{tags}"
80
- end
81
-
82
- def self.inventory_self_url
83
- inventory_base_url + "?hostname_or_id=#{ForemanRhCloud.foreman_host.fqdn}"
75
+ ForemanRhCloud.base_url + "/api/inventory/v1/hosts?tags=#{tags}"
84
76
  end
85
77
  end
@@ -6,18 +6,6 @@ module ForemanRhCloud
6
6
  class Engine < ::Rails::Engine
7
7
  engine_name 'foreman_rh_cloud'
8
8
 
9
- def self.register_scheduled_task(task_class, cronline)
10
- return if ForemanTasks::RecurringLogic.joins(:tasks)
11
- .merge(ForemanTasks::Task.where(label: task_class.name))
12
- .exists?
13
-
14
- User.as_anonymous_admin do
15
- recurring_logic = ForemanTasks::RecurringLogic.new_from_cronline(cronline)
16
- recurring_logic.save!
17
- recurring_logic.start(task_class)
18
- end
19
- end
20
-
21
9
  initializer 'foreman_rh_cloud.load_default_settings', :before => :load_config_initializers do
22
10
  require_dependency File.expand_path('../../app/models/setting/rh_cloud.rb', __dir__)
23
11
  end
@@ -93,9 +81,7 @@ module ForemanRhCloud
93
81
  register_custom_status InventorySync::InventoryStatus
94
82
  register_custom_status InsightsClientReportStatus
95
83
 
96
- describe_host do
97
- overview_buttons_provider :insights_host_overview_buttons
98
- end
84
+ subscribe 'host_created.event.foreman', ForemanRhCloud::InsightsSubscriber
99
85
 
100
86
  extend_page 'hosts/show' do |context|
101
87
  context.add_pagelet :main_tabs,
@@ -148,8 +134,15 @@ module ForemanRhCloud
148
134
  # skip object creation when admin user is not present, for example in test DB
149
135
  if User.unscoped.find_by_login(User::ANONYMOUS_ADMIN).present?
150
136
  ::ForemanTasks.dynflow.config.on_init(false) do |world|
151
- ForemanRhCloud::Engine.register_scheduled_task(InventorySync::Async::InventoryScheduledSync, '0 0 * * *')
152
- ForemanRhCloud::Engine.register_scheduled_task(InsightsCloud::Async::InsightsClientStatusAging, '0 0 * * *')
137
+ unless ForemanTasks::RecurringLogic.joins(:tasks).merge(
138
+ ForemanTasks::Task.where(label: 'InventorySync::Async::InventoryScheduledSync')
139
+ ).exists?
140
+ User.as_anonymous_admin do
141
+ recurring_logic = ForemanTasks::RecurringLogic.new_from_cronline("0 0 * * *")
142
+ recurring_logic.save!
143
+ recurring_logic.start(InventorySync::Async::InventoryScheduledSync)
144
+ end
145
+ end
153
146
  end
154
147
  end
155
148
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanRhCloud
2
- VERSION = '3.0.26'.freeze
2
+ VERSION = '4.0.21.1'.freeze
3
3
  end
@@ -6,11 +6,6 @@ module InsightsCloud
6
6
  include ::ForemanRhCloud::CloudAuth
7
7
 
8
8
  def plan
9
- unless cloud_auth_available?
10
- logger.debug('Cloud authentication is not available, skipping insights sync')
11
- return
12
- end
13
-
14
9
  sequence do
15
10
  # This can be turned off when we enable automatic status syncs
16
11
  # This step will query cloud inventory to retrieve inventory uuids for each host
@@ -55,18 +50,28 @@ module InsightsCloud
55
50
  end
56
51
 
57
52
  def query_insights_hits
58
- hits_response = execute_cloud_request(
53
+ hits_response = RestClient::Request.execute(
59
54
  method: :get,
60
- url: InsightsCloud.hits_export_url
55
+ url: InsightsCloud.hits_export_url,
56
+ verify_ssl: ForemanRhCloud.verify_ssl_method,
57
+ proxy: ForemanRhCloud.transformed_http_proxy_string(logger: logger),
58
+ headers: {
59
+ Authorization: "Bearer #{rh_credentials}",
60
+ }
61
61
  )
62
62
 
63
63
  JSON.parse(hits_response)
64
64
  end
65
65
 
66
66
  def query_insights_rules
67
- rules_response = execute_cloud_request(
67
+ rules_response = RestClient::Request.execute(
68
68
  method: :get,
69
- url: InsightsCloud.rules_url
69
+ url: InsightsCloud.rules_url,
70
+ verify_ssl: ForemanRhCloud.verify_ssl_method,
71
+ proxy: ForemanRhCloud.transformed_http_proxy_string(logger: logger),
72
+ headers: {
73
+ Authorization: "Bearer #{rh_credentials}",
74
+ }
70
75
  )
71
76
 
72
77
  JSON.parse(rules_response)
@@ -7,21 +7,11 @@ module InsightsCloud
7
7
 
8
8
  RULE_ID_REGEX = /[^:]*:(?<id>.*)/
9
9
 
10
- def plan
11
- unless cloud_auth_available?
12
- logger.debug('Cloud authentication is not available, skipping resolutions sync')
13
- return
14
- end
15
-
16
- plan_self
17
- end
18
-
19
10
  def run
20
11
  InsightsResolution.transaction do
21
12
  InsightsResolution.delete_all
22
- rule_ids = relevant_rules
23
- api_response = query_insights_resolutions(rule_ids) unless rule_ids.empty?
24
- write_resolutions(api_response) if api_response
13
+ api_response = query_insights_resolutions(relevant_rules)
14
+ write_resolutions(api_response)
25
15
  end
26
16
  end
27
17
 
@@ -32,11 +22,14 @@ module InsightsCloud
32
22
  private
33
23
 
34
24
  def query_insights_resolutions(rule_ids)
35
- resolutions_response = execute_cloud_request(
25
+ resolutions_response = RestClient::Request.execute(
36
26
  method: :post,
37
27
  url: InsightsCloud.resolutions_url,
28
+ verify_ssl: ForemanRhCloud.verify_ssl_method,
29
+ proxy: ForemanRhCloud.transformed_http_proxy_string(logger: logger),
38
30
  headers: {
39
31
  content_type: :json,
32
+ Authorization: "Bearer #{rh_credentials}",
40
33
  },
41
34
  payload: {
42
35
  issues: rule_ids,