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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 962a249edd3e5c8057a0d88bf32503001f770a489c54749bd5d663e30257b267
|
4
|
+
data.tar.gz: db4df9b9f49e83f58d0893eba20120ca78cdd923e30d9faa3de5b13aeaa31d7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
@@ -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
|
+
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-
|
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
|