foreman_rh_cloud 11.0.2 → 11.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f59aefea33a7933386cdc77e326b13ceca715d51f4fdf3c02905896363bcc33
4
- data.tar.gz: 95b711179cb036dbfcb8a6261db1f6c9911ff931807a4a0d9765440534c30c8f
3
+ metadata.gz: 9feba25e71b2e6db50de3b2f32665a4889dce130fa44dcc7ef461116ba2abf62
4
+ data.tar.gz: ec6ce86e970247fab7b565831b414b2a15cb3e2e7ac2f678ccbbd2a43b6692d9
5
5
  SHA512:
6
- metadata.gz: 4bf762fb0c67730e9317948e6ca74921717d8699fb532b4f3c196049ac38f5ba145d7a9a54122f9c18710e4ede293c4d35beb3e3b462b20e936acd8c5547ed8f
7
- data.tar.gz: 91e0dceccebc4fb48d93c7916f0a229a0b1d2077f0319e67fa014ecb29f0adade7c28e6af1ac717d0b12488065031b37ecf20b84c816086d260385211d15e468
6
+ metadata.gz: d98ca68b9fde700bbc66dd6bdfad34bbd50d8d9b6558e47f9f2c13a538330b53bea3b319e4e9861c41884f9c6397b21c882de7a255bffab45c3a157196fe60e4
7
+ data.tar.gz: bbafd13720bb8e60ae2e9c2af9d8888cc231fcba509f046f76d5b3c560cb78642c7f8a12fbe6d9feb489fb6a11d955739568f9effb9447201e8411980f7a6989
@@ -33,7 +33,8 @@ module ForemanRhCloud
33
33
  }
34
34
  ),
35
35
  }
36
- base_params.merge(path_params(original_request.path, certs))
36
+ requested_url = original_request.original_fullpath.end_with?('/') ? original_request.path + '/' : original_request.path
37
+ base_params.merge(path_params(requested_url, certs))
37
38
  end
38
39
 
39
40
  def prepare_forward_payload(original_request, controller_name)
@@ -7,6 +7,7 @@ module ForemanInventoryUpload
7
7
  include ::ForemanRhCloud::Async::ExponentialBackoff
8
8
 
9
9
  def plan(instance_label, more_inputs = {})
10
+ clear_task_output(instance_label)
10
11
  inputs = more_inputs.merge(instance_label: instance_label)
11
12
  plan_self(inputs)
12
13
  end
@@ -53,6 +54,11 @@ module ForemanInventoryUpload
53
54
  Dynflow::Action::Rescue::Fail
54
55
  end
55
56
 
57
+ def clear_task_output(label)
58
+ TaskOutputLine.where(label: label).delete_all
59
+ TaskOutputStatus.where(label: label).delete_all
60
+ end
61
+
56
62
  private
57
63
 
58
64
  def preprocess_command(command)
@@ -28,6 +28,16 @@ module ForemanInventoryUpload
28
28
  'insights_client::hostname',
29
29
  'insights_client::ips',
30
30
  'insights_id',
31
+ 'conversions::activity',
32
+ 'conversions::packages::0::nevra',
33
+ 'conversions::packages::0::signature',
34
+ 'conversions::activity_started',
35
+ 'conversions::activity_ended',
36
+ 'conversions::success',
37
+ 'conversions::source_os::name',
38
+ 'conversions::source_os::version',
39
+ 'conversions::target_os::name',
40
+ 'conversions::target_os::version',
31
41
  ]).pluck(:name, :id)
32
42
  ]
33
43
  end
@@ -40,6 +40,16 @@ module ForemanInventoryUpload
40
40
  end
41
41
  end
42
42
 
43
+ def report_conversions(host)
44
+ @stream.simple_field('convert2rhel_through_foreman', host.subscription_facet&.convert2rhel_through_foreman)
45
+ @stream.simple_field('activity', fact_value(host, 'conversions::activity'))
46
+ @stream.simple_field('packages_0_nevra', fact_value(host, 'conversions::packages::0::nevra'))
47
+ @stream.simple_field('packages_0_signature', fact_value(host, 'conversions::packages::0::signature'))
48
+ @stream.simple_field('activity_started', fact_value(host, 'conversions::activity_started'))
49
+ @stream.simple_field('activity_ended', fact_value(host, 'conversions::activity_ended'))
50
+ @stream.simple_field('success', fact_value(host, 'conversions::success') || false, :last)
51
+ end
52
+
43
53
  def report_host(host)
44
54
  host_ips_cache = host_ips(host)
45
55
  @stream.object do
@@ -47,7 +57,19 @@ module ForemanInventoryUpload
47
57
  @stream.simple_field('account', account_id(host.organization).to_s)
48
58
  @stream.simple_field('subscription_manager_id', uuid_value!(host.subscription_facet&.uuid))
49
59
  @stream.simple_field('satellite_id', uuid_value!(host.subscription_facet&.uuid))
50
- @stream.simple_field('convert2rhel_through_foreman', host.subscription_facet&.convert2rhel_through_foreman)
60
+ if host.subscription_facet&.convert2rhel_through_foreman.present?
61
+ @stream.object_field('conversions') do
62
+ @stream.object_field('source_os') do
63
+ @stream.simple_field('name', fact_value(host, 'conversions::source_os::name'))
64
+ @stream.simple_field('version', fact_value(host, 'conversions::source_os::version') || 'Unknown - Fact not reported', :last)
65
+ end
66
+ @stream.object_field('target_os') do
67
+ @stream.simple_field('name', fact_value(host, 'conversions::target_os::name'))
68
+ @stream.simple_field('version', fact_value(host, 'conversions::target_os::version') || 'Unknown - Fact not reported', :last)
69
+ end
70
+ report_conversions(host)
71
+ end
72
+ end
51
73
  @stream.simple_field('bios_uuid', bios_uuid(host))
52
74
  @stream.simple_field('vm_uuid', uuid_value(fact_value(host, 'virt::uuid')))
53
75
  @stream.simple_field('insights_id', uuid_value(fact_value(host, 'insights_id')))
@@ -1,3 +1,3 @@
1
1
  module ForemanRhCloud
2
- VERSION = '11.0.2'.freeze
2
+ VERSION = '11.0.3'.freeze
3
3
  end
@@ -28,6 +28,16 @@ module InventorySync
28
28
  output[:host_statuses] = host_statuses
29
29
  end
30
30
 
31
+ def clear_inventory_statuses_for_hosts_with_insights_false
32
+ host_ids_to_delete = Host.joins(:host_parameters).where(id: InventorySync::InventoryStatus.select(:host_id), host_parameters: { name: 'host_registration_insights', value: false })
33
+ if host_ids_to_delete.present?
34
+ InventorySync::InventoryStatus.where(host_id: host_ids_to_delete).delete_all
35
+ Host.where(id: host_ids_to_delete).find_each(&:refresh_global_status!)
36
+ else
37
+ logger.debug('No hosts with host_registration_insights set to false found')
38
+ end
39
+ end
40
+
31
41
  def update_statuses_batch
32
42
  results = yield
33
43
 
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foreman_rh_cloud",
3
- "version": "11.0.2",
3
+ "version": "11.0.3",
4
4
  "description": "Inventory Upload =============",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -42,7 +42,7 @@ export const PageDescription = () => (
42
42
  {__('For more information about the Subscriptions service, see:')}
43
43
   
44
44
  <a
45
- href="https://access.redhat.com/documentation/en-us/subscription_central/2020-04/html/getting_started_with_subscription_watch/assembly-about-subscriptionwatch"
45
+ href="https://docs.redhat.com/en/documentation/subscription_central/1-latest/html/getting_started_with_the_subscriptions_service/index"
46
46
  target="_blank"
47
47
  rel="noopener noreferrer"
48
48
  >
@@ -40,7 +40,7 @@ exports[`PageDescription rendering render without Props 1`] = `
40
40
  For more information about the Subscriptions service, see:
41
41
   
42
42
  <a
43
- href="https://access.redhat.com/documentation/en-us/subscription_central/2020-04/html/getting_started_with_subscription_watch/assembly-about-subscriptionwatch"
43
+ href="https://docs.redhat.com/en/documentation/subscription_central/1-latest/html/getting_started_with_the_subscriptions_service/index"
44
44
  rel="noopener noreferrer"
45
45
  target="_blank"
46
46
  >
@@ -6,5 +6,8 @@
6
6
  export const foremanUrl = path => `${window.URL_PREFIX}${path}`;
7
7
 
8
8
  export const isNotRhelHost = ({ hostDetails }) =>
9
- // eslint-disable-next-line camelcase
10
- !new RegExp('red\\s?hat', 'i').test(hostDetails?.operatingsystem_name);
9
+ // This regex tries matches sane variations of "RedHat", "RHEL" and "RHCOS"
10
+ !new RegExp('red[\\s\\-]?hat|rh[\\s\\-]?el|rhc[\\s\\-]?os', 'i').test(
11
+ // eslint-disable-next-line camelcase
12
+ hostDetails?.operatingsystem_name
13
+ );
@@ -6,7 +6,7 @@ import { isNotRhelHost } from '../ForemanRhCloudHelpers';
6
6
  export const InsightsTotalRiskChartWrapper = props => {
7
7
  if (props.status === 'RESOLVED') {
8
8
  return (
9
- !isNotRhelHost(props.hostDetails) && <InsightsTotalRiskChart {...props} /> // check for RHEL hosts
9
+ !isNotRhelHost(props) && <InsightsTotalRiskChart {...props} /> // check for RHEL hosts
10
10
  );
11
11
  }
12
12
  return null;
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: 11.0.2
4
+ version: 11.0.3
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: 2024-10-29 00:00:00.000000000 Z
11
+ date: 2024-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foreman_ansible
@@ -640,7 +640,7 @@ homepage: https://github.com/theforeman/foreman_rh_cloud
640
640
  licenses:
641
641
  - GPL-3.0
642
642
  metadata: {}
643
- post_install_message:
643
+ post_install_message:
644
644
  rdoc_options: []
645
645
  require_paths:
646
646
  - lib
@@ -658,8 +658,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
658
658
  - !ruby/object:Gem::Version
659
659
  version: '0'
660
660
  requirements: []
661
- rubygems_version: 3.3.27
662
- signing_key:
661
+ rubygems_version: 3.2.33
662
+ signing_key:
663
663
  specification_version: 4
664
664
  summary: Summary of ForemanRhCloud.
665
665
  test_files: