foreman_rh_cloud 2.0.14 → 2.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -0
- data/app/models/setting/rh_cloud.rb +5 -5
- data/config/Gemfile.lock.gh_test +815 -0
- data/config/database.yml.example +17 -0
- data/config/package-lock.json.gh_test +36317 -0
- data/lib/foreman_inventory_upload.rb +1 -1
- data/lib/foreman_inventory_upload/generators/archived_report.rb +1 -1
- data/lib/foreman_rh_cloud/engine.rb +0 -1
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/lib/tasks/rh_cloud_inventory.rake +23 -0
- metadata +18 -15
@@ -28,7 +28,7 @@ module ForemanInventoryUpload
|
|
28
28
|
|
29
29
|
@logger.info 'Archiving generated report'
|
30
30
|
# success = system('tar', '-zcvf', @target, '-C', tmpdir, '.')
|
31
|
-
Open3.popen2e('tar', '-
|
31
|
+
Open3.popen2e('tar', '-Jcvf', @target, '-C', tmpdir, '.') do |_in, out, wait_thr|
|
32
32
|
@logger.info("tar: #{out.read}")
|
33
33
|
|
34
34
|
if wait_thr.value.success?
|
@@ -79,7 +79,6 @@ module ForemanRhCloud
|
|
79
79
|
::Katello::UINotifications::Subscriptions::ManifestImportSuccess.include ForemanInventoryUpload::Notifications::ManifestImportSuccessNotificationOverride if defined?(Katello)
|
80
80
|
|
81
81
|
::Host::Managed.include RhCloudHost
|
82
|
-
::Host::Base.include RhCloudHost
|
83
82
|
end
|
84
83
|
|
85
84
|
initializer "foreman_rh_cloud.set_dynflow.config.on_init", :before => :finisher_hook do |_app|
|
@@ -2,6 +2,21 @@ require 'tempfile'
|
|
2
2
|
|
3
3
|
namespace :rh_cloud_inventory do
|
4
4
|
namespace :report do
|
5
|
+
desc 'Generate inventory report and send it to Red Hat cloud'
|
6
|
+
task generate_upload: [:environment, 'dynflow:client'] do
|
7
|
+
unless ENV['organization_id'].nil?
|
8
|
+
organizations = [ Organization.where(:id => ENV['organization_id']).first ]
|
9
|
+
else
|
10
|
+
organizations = Organization.unscoped.all
|
11
|
+
end
|
12
|
+
|
13
|
+
User.as_anonymous_admin do
|
14
|
+
organizations.each do |organization|
|
15
|
+
ForemanInventoryUpload::Async::GenerateReportJob.perform_now(ForemanInventoryUpload.generated_reports_folder, organization.id)
|
16
|
+
puts "Generated and uploaded inventory report for organization '#{organization.name}'"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
5
20
|
desc 'Generate inventory report to be sent to Red Hat cloud'
|
6
21
|
task generate: :environment do
|
7
22
|
portal_user = ENV['portal_user']
|
@@ -27,6 +42,14 @@ namespace :rh_cloud_inventory do
|
|
27
42
|
end
|
28
43
|
end
|
29
44
|
end
|
45
|
+
desc 'Upload generated inventory report to Red Hat cloud'
|
46
|
+
task upload: [:environment, 'dynflow:client'] do
|
47
|
+
base_folder = ENV['target'] || ForemanInventoryUpload.generated_reports_folder
|
48
|
+
organization_id = ENV['organization_id']
|
49
|
+
report_file = ForemanInventoryUpload.facts_archive_name(organization_id)
|
50
|
+
ForemanInventoryUpload::Async::QueueForUploadJob.perform_now(base_folder, report_file, organization_id)
|
51
|
+
puts "Uploaded #{report_file}"
|
52
|
+
end
|
30
53
|
end
|
31
54
|
|
32
55
|
desc "Synchronize Insights hosts hits"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_rh_cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Foreman Red Hat Cloud team
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: katello
|
@@ -125,6 +125,9 @@ files:
|
|
125
125
|
- app/views/foreman_rh_cloud/react/inventory_upload.html.erb
|
126
126
|
- app/views/hosts/_insights_tab.html.erb
|
127
127
|
- app/views/layouts/foreman_rh_cloud/application.html.erb
|
128
|
+
- config/Gemfile.lock.gh_test
|
129
|
+
- config/database.yml.example
|
130
|
+
- config/package-lock.json.gh_test
|
128
131
|
- config/routes.rb
|
129
132
|
- db/migrate/20191215104806_create_insights_hits.foreman_inventory_upload.rb
|
130
133
|
- db/migrate/20191216062008_create_insights_facets.foreman_inventory_upload.rb
|
@@ -525,7 +528,7 @@ homepage: https://github.com/theforeman/foreman_rh_cloud
|
|
525
528
|
licenses:
|
526
529
|
- GPL-3.0
|
527
530
|
metadata: {}
|
528
|
-
post_install_message:
|
531
|
+
post_install_message:
|
529
532
|
rdoc_options: []
|
530
533
|
require_paths:
|
531
534
|
- lib
|
@@ -540,25 +543,25 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
540
543
|
- !ruby/object:Gem::Version
|
541
544
|
version: '0'
|
542
545
|
requirements: []
|
543
|
-
rubygems_version: 3.
|
544
|
-
signing_key:
|
546
|
+
rubygems_version: 3.0.6
|
547
|
+
signing_key:
|
545
548
|
specification_version: 4
|
546
549
|
summary: Summary of ForemanRhCloud.
|
547
550
|
test_files:
|
548
|
-
- test/controllers/
|
551
|
+
- test/controllers/uploads_controller_test.rb
|
549
552
|
- test/controllers/insights_sync/settings_controller_test.rb
|
553
|
+
- test/controllers/accounts_controller_test.rb
|
550
554
|
- test/controllers/reports_controller_test.rb
|
551
|
-
- test/
|
552
|
-
- test/
|
553
|
-
- test/factories/inventory_upload_factories.rb
|
555
|
+
- test/test_plugin_helper.rb
|
556
|
+
- test/jobs/upload_report_job_test.rb
|
554
557
|
- test/jobs/insights_full_sync_test.rb
|
555
558
|
- test/jobs/inventory_full_sync_test.rb
|
556
|
-
- test/
|
557
|
-
- test/
|
558
|
-
- test/unit/archived_report_generator_test.rb
|
559
|
-
- test/unit/metadata_generator_test.rb
|
559
|
+
- test/factories/inventory_upload_factories.rb
|
560
|
+
- test/factories/insights_factories.rb
|
560
561
|
- test/unit/shell_process_job_test.rb
|
561
|
-
- test/unit/
|
562
|
+
- test/unit/metadata_generator_test.rb
|
562
563
|
- test/unit/insights_facet_test.rb
|
563
564
|
- test/unit/rh_cloud_http_proxy_test.rb
|
565
|
+
- test/unit/fact_helpers_test.rb
|
566
|
+
- test/unit/archived_report_generator_test.rb
|
564
567
|
- test/unit/slice_generator_test.rb
|