hammer_cli_foreman_rh_cloud 1.0.4 → 1.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a9f8609350d40c6aa1655e2f8278ff625220a7eec9f6eb07085875c0fee6a40
4
- data.tar.gz: eb767f8983b780b54f537770175faf4d9385d8bea567decb553c42caefc898ef
3
+ metadata.gz: 962a249edd3e5c8057a0d88bf32503001f770a489c54749bd5d663e30257b267
4
+ data.tar.gz: db4df9b9f49e83f58d0893eba20120ca78cdd923e30d9faa3de5b13aeaa31d7d
5
5
  SHA512:
6
- metadata.gz: ae0b6adb79a975c6a356a3b1645065ae62144893237d5d46e1d59796099aef138c1419b1887e8653055af05233be4f89d32cc247965cb767c3d385334d56a75d
7
- data.tar.gz: f9315a7bcde9a4749c293fbe2bcaf474660669d19ec48d00266d0baaf569570dade2edeb4aa6c23c4101fe4b407592d0940457f70a18c7d07ed10bad25aa3234
6
+ metadata.gz: 9bd7f88a91e4603ce7f0b8f929369a0de99a2c81b6df9d407e9cd586026185d6132ae8b46e64677e9d37d59f1759644b45fcf11c644fd0d02216914d512bdd6a
7
+ data.tar.gz: 625172ddf8bdd64c01e635afd591af00ac261e0546e4666b704bc57ecf890c46e84075123df2137196160ef84a73498745671dac23654b65728d89fd231b0249
@@ -0,0 +1,48 @@
1
+ require 'hammer_cli_foreman/ping'
2
+
3
+ module HammerCLIForemanRhCloud
4
+ module CommandExtensions
5
+ class Ping < HammerCLI::CommandExtensions
6
+ before_print do |data|
7
+ unless data.dig('results', 'foreman_rh_cloud').nil?
8
+ data.dig('results', 'foreman_rh_cloud', 'services')&.each do |_, service_hash|
9
+ service_hash['_response'] = format_response(service_hash)
10
+ end
11
+ end
12
+ end
13
+
14
+ def self.format_response(service_hash)
15
+ if service_hash['duration_ms']
16
+ _('Duration: %sms') % service_hash['duration_ms']
17
+ elsif service_hash['message']
18
+ _('Message: %s') % service_hash['message']
19
+ end
20
+ end
21
+
22
+ output do |definition|
23
+ definition.append do
24
+ from 'foreman_rh_cloud' do
25
+ from :services do
26
+ label 'advisor', hide_blank: true do
27
+ from 'advisor' do
28
+ field 'status', _('Status')
29
+ field '_response', _('Server Response')
30
+ end
31
+ end
32
+ label 'vulnerability', hide_blank: true do
33
+ from 'vulnerability' do
34
+ field 'status', _('Status')
35
+ field '_response', _('Server Response')
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+
44
+ HammerCLIForeman::PingCommand::ForemanCommand.extend_with(
45
+ HammerCLIForemanRhCloud::CommandExtensions::Ping.new
46
+ )
47
+ end
48
+ end
@@ -1,5 +1,5 @@
1
1
  module HammerCLIForemanRhCloud
2
2
  def self.version
3
- @version ||= Gem::Version.new '1.0.4'
3
+ @version ||= Gem::Version.new '1.0.5'
4
4
  end
5
5
  end
@@ -5,6 +5,7 @@ module HammerCLIForemanRhCloud
5
5
  require 'hammer_cli_foreman_rh_cloud/version'
6
6
  require 'hammer_cli_foreman_rh_cloud/i18n'
7
7
  require 'hammer_cli_foreman_rh_cloud/insights'
8
+ require 'hammer_cli_foreman_rh_cloud/command_extensions/ping'
8
9
 
9
10
  HammerCLI::MainCommand.lazy_subcommand(
10
11
  'insights',
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hammer_cli_foreman_rh_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shimon Shtein
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2025-04-01 00:00:00.000000000 Z
16
+ date: 2025-09-03 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: hammer_cli_katello
@@ -165,6 +165,7 @@ files:
165
165
  - config/foreman_rh_cloud.yml
166
166
  - lib/hammer_cli_foreman_rh_cloud.rb
167
167
  - lib/hammer_cli_foreman_rh_cloud/cloud_connector.rb
168
+ - lib/hammer_cli_foreman_rh_cloud/command_extensions/ping.rb
168
169
  - lib/hammer_cli_foreman_rh_cloud/i18n.rb
169
170
  - lib/hammer_cli_foreman_rh_cloud/insights.rb
170
171
  - lib/hammer_cli_foreman_rh_cloud/inventory.rb