foreman_rh_cloud 13.2.1 → 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/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_inventory_upload.rb +23 -8
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/locale/fr/foreman_rh_cloud.edit.po +1032 -0
- data/locale/fr/foreman_rh_cloud.po.time_stamp +0 -0
- data/locale/ja/foreman_rh_cloud.edit.po +1026 -0
- data/locale/ja/foreman_rh_cloud.po.time_stamp +0 -0
- data/locale/ka/foreman_rh_cloud.edit.po +1025 -0
- data/locale/ka/foreman_rh_cloud.po.time_stamp +0 -0
- data/locale/ko/foreman_rh_cloud.edit.po +1029 -0
- data/locale/ko/foreman_rh_cloud.po.time_stamp +0 -0
- data/locale/zh_CN/foreman_rh_cloud.edit.po +1031 -0
- 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/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
- metadata +16 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 950f48953eb5a5166946f1dafb84b60eeaee2722fe1ad6460ea09c5a7549da73
|
|
4
|
+
data.tar.gz: e077f396cb37162ff28bb575ccd9bcab00b0c7fc09e87c72cc4936eca6cbf728
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d81cc6e6ce4b375cb5ae70c04424b3edcb777a18c22910c3c9090fcf780abe05b2d78a4a5e71824c16cc2136ca77efc5b04d6360c9ef446af843261a7540ce32
|
|
7
|
+
data.tar.gz: 5fe94f6b998f9e86b0c42ed768e4306d9bddc6a27aace8dc2fed38bb2a4ee9ab035453095b85338b98b0f865683886da0073c8f4f646b7c2ba24e32bd87cf898
|
|
@@ -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
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
module ForemanInventoryUpload
|
|
2
2
|
def self.base_folder
|
|
3
3
|
# in production setup, where selinux is enabled, we only have rights to
|
|
4
|
-
# create folders under /
|
|
5
|
-
# a dev setup, where we can use
|
|
4
|
+
# create folders under /var/lib/foreman. If the folder does not exist, it's
|
|
5
|
+
# a dev setup, where we can use the parent of the current working directory
|
|
6
6
|
@base_folder ||= File.join(
|
|
7
|
-
Dir.glob('/var/lib/foreman').first || Dir.getwd,
|
|
7
|
+
Dir.glob('/var/lib/foreman').first || File.dirname(Dir.getwd),
|
|
8
8
|
'red_hat_inventory/'
|
|
9
9
|
)
|
|
10
10
|
end
|
|
@@ -30,11 +30,6 @@ module ForemanInventoryUpload
|
|
|
30
30
|
File.join(ForemanInventoryUpload.done_folder, filename)
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
def self.report_file_paths(organization_id)
|
|
34
|
-
filename = facts_archive_name(organization_id)
|
|
35
|
-
Dir[ForemanInventoryUpload.uploads_file_path(filename), ForemanInventoryUpload.done_file_path(filename)]
|
|
36
|
-
end
|
|
37
|
-
|
|
38
33
|
def self.generated_reports_folder
|
|
39
34
|
@generated_reports_folder ||= ensure_folder(
|
|
40
35
|
File.join(
|
|
@@ -44,6 +39,26 @@ module ForemanInventoryUpload
|
|
|
44
39
|
)
|
|
45
40
|
end
|
|
46
41
|
|
|
42
|
+
def self.generated_reports_file_path(filename)
|
|
43
|
+
File.join(ForemanInventoryUpload.generated_reports_folder, filename)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def self.report_file_paths(organization_id)
|
|
47
|
+
filename = facts_archive_name(organization_id)
|
|
48
|
+
# Report files start in generated
|
|
49
|
+
# They are then MOVED (not copied) to uploads, then done.
|
|
50
|
+
# When they are moved to the new folder, they overwrite any file with the same name.
|
|
51
|
+
# If it's a generate-only, it will be in generated
|
|
52
|
+
# Failed or incomplete uploads will be in uploads
|
|
53
|
+
# Completed uploads will be in done
|
|
54
|
+
# The ordering here ensures we get the correct file path every time.
|
|
55
|
+
Dir[
|
|
56
|
+
ForemanInventoryUpload.generated_reports_file_path(filename),
|
|
57
|
+
ForemanInventoryUpload.uploads_file_path(filename),
|
|
58
|
+
ForemanInventoryUpload.done_file_path(filename),
|
|
59
|
+
]
|
|
60
|
+
end
|
|
61
|
+
|
|
47
62
|
def self.outputs_folder
|
|
48
63
|
@outputs_folder ||= ensure_folder(File.join(ForemanInventoryUpload.base_folder, 'outputs/'))
|
|
49
64
|
end
|