hammer_cli_foreman 3.8.0 → 3.10.0

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: ee6e69c32f2da750f35474c76deab901c34156e02f588831793b7f668e3445db
4
- data.tar.gz: db9db4349a41cf3e1058b33de2cdb599df9526dc6477c12d8fbb8cb3cfccba1b
3
+ metadata.gz: 1378c71afe884f9057c631189874b2e73bf1564c217c64d43dd10ff217ca1e78
4
+ data.tar.gz: bd5274ac74e9a660c0e58e8cc5ad72b9f3a7f6ee2e27514b49ebd82619154770
5
5
  SHA512:
6
- metadata.gz: 38103b52f65f395870d1cf31da86d4df330248f06ffceb346ed63ec1c9bfb7a7f79a8bfd30fd46d458af97b47ef3c9d08cdd32c056e9eb4765bbef4f2d74be91
7
- data.tar.gz: 5c57d8514e09458120a4e01dda31de420b27c85616572ad6577fccf486065294d9308b6b70f344c36070b4d08e52dbfd6f5d78a980f98e81256d95f45ff84a15
6
+ metadata.gz: d680386e1ef631a635e2703a2225c5f1664febab76b64925005de854ac2421f25d3c81227cbc058e2ce8886eccdd732d5c9029ec5eb4309d0a785758723d5ca3
7
+ data.tar.gz: c64e4a6a73644b4d1ba7598dd445156cb1983c76ed32255250081ceec98e21310a5b29ad88b5aa0de0e927d923f4ced2210df304265d6a24733bd953c2aa7d9b
data/doc/host_create.md CHANGED
@@ -252,12 +252,6 @@ preallocate # boolean, set true to preallocate
252
252
  wipe_after_delete # boolean, set true to wipe disk after delete
253
253
  ```
254
254
 
255
- ## Rackspace
256
- Available keys for `--compute-attributes`:
257
- ```
258
- flavor_id
259
- ```
260
-
261
255
  ## VMware
262
256
  Available keys for `--compute-attributes`:
263
257
  ```
data/doc/release_notes.md CHANGED
@@ -1,5 +1,19 @@
1
1
  Release notes
2
2
  =============
3
+ ### 3.10.0 (2024-02-21)
4
+ * Update packit ([PR #627](https://github.com/theforeman/hammer-cli-foreman/pull/627))
5
+ * Use require_relative for 'coverage_reporter' ([PR #626](https://github.com/theforeman/hammer-cli-foreman/pull/626)), [#37163](http://projects.theforeman.org/issues/37163)
6
+ * Show mac address in vmware info ([PR #624](https://github.com/theforeman/hammer-cli-foreman/pull/624)), [#36991](http://projects.theforeman.org/issues/36991)
7
+ * Bump to 3.10.0-develop
8
+
9
+ ### 3.9.0 (2023-11-29)
10
+ * Add cache status to ping output ([PR #622](https://github.com/theforeman/hammer-cli-foreman/pull/622)), [#36954](http://projects.theforeman.org/issues/36954)
11
+ * Use strings, not floats to denote ruby versions ([PR #623](https://github.com/theforeman/hammer-cli-foreman/pull/623))
12
+ * Update packit
13
+ * Drop rackspace cr support ([PR #619](https://github.com/theforeman/hammer-cli-foreman/pull/619)), [#36813](http://projects.theforeman.org/issues/36813)
14
+ * Update rel-eng
15
+ * Bump to 3.9.0-develop
16
+
3
17
  ### 3.8.0 (2023-08-25)
4
18
  * Support mocha 2.1 ([PR #618](https://github.com/theforeman/hammer-cli-foreman/pull/618)), [#34879](http://projects.theforeman.org/issues/34879)
5
19
  * Add ga to run tests on ruby 3+ ([PR #617](https://github.com/theforeman/hammer-cli-foreman/pull/617))
@@ -7,9 +7,23 @@ module HammerCLIForeman
7
7
  data['results']['foreman']['database']['active'] = status ? 'ok' : 'FAIL'
8
8
  duration = data['results']['foreman']['database']['duration_ms']
9
9
  data['results']['foreman']['database']['duration_ms'] = _('Duration: %sms') % duration
10
+ cache = data['results']['foreman']['cache']
11
+ data['results']['foreman']['cache'] = format_cache(cache) if cache
10
12
  end
11
13
  end
12
14
 
15
+ def self.format_cache(cache)
16
+ servers = cache['servers'].map do |server|
17
+ {
18
+ status: server['status'],
19
+ duration_ms: _('Duration: %sms') % server['duration_ms']
20
+ }
21
+ end
22
+ {
23
+ 'servers': servers
24
+ }
25
+ end
26
+
13
27
  def self.check_for_unrecognized(plugins, output_definition)
14
28
  failed = plugins.select { |_, data| data['services'] }
15
29
  .each_with_object([]) { |(_, d), s| s << d['services'] }
@@ -13,6 +13,5 @@ module HammerCLIForeman
13
13
  require 'hammer_cli_foreman/compute_resource/libvirt.rb'
14
14
  require 'hammer_cli_foreman/compute_resource/openstack.rb'
15
15
  require 'hammer_cli_foreman/compute_resource/ovirt.rb'
16
- require 'hammer_cli_foreman/compute_resource/rackspace.rb'
17
16
  require 'hammer_cli_foreman/compute_resource/vmware.rb'
18
17
  end
@@ -80,6 +80,7 @@ module HammerCLIForeman
80
80
  Fields::Field.new(:label => _('Hardware Version'), :path => [:hardware_version]),
81
81
  Fields::Field.new(:label => _('Path'), :path => [:path]),
82
82
  Fields::Field.new(:label => _('Operating System'), :path => [:operatingsystem]),
83
+ Fields::Field.new(:label => _('Mac'), :path => [:mac]),
83
84
  Fields::List.new(:label => _('Boot order'), :path => [:boot_order])
84
85
  ]
85
86
  end
@@ -12,6 +12,12 @@ module HammerCLIForeman
12
12
  field :active, _('Status')
13
13
  field :duration_ms, _('Server Response')
14
14
  end
15
+ field :cache, _('cache'), Fields::Label do
16
+ field :servers, _('servers'), Fields::Collection do
17
+ field :status, _('Status')
18
+ field :duration_ms, _('Server Response')
19
+ end
20
+ end
15
21
  end
16
22
  end
17
23
 
@@ -1,5 +1,5 @@
1
1
  module HammerCLIForeman
2
2
  def self.version
3
- @version ||= Gem::Version.new "3.8.0"
3
+ @version ||= Gem::Version.new "3.10.0"
4
4
  end
5
5
  end
@@ -1,4 +1,4 @@
1
- require 'coverage_reporter'
1
+ require_relative 'coverage_reporter'
2
2
  require "json"
3
3
 
4
4
  module Minitest
@@ -33,6 +33,31 @@ describe 'ping' do
33
33
  assert_cmd(expected_result, result)
34
34
  end
35
35
 
36
+ it 'includes cache status if foreman reports it' do
37
+ ping_results['results']['foreman']['cache'] = {
38
+ 'servers' => [
39
+ {
40
+ 'status' => 'ok',
41
+ 'duration_ms' => 5
42
+ }
43
+ ]
44
+ }
45
+ api_expects(:ping, :ping, 'Ping').returns(ping_results)
46
+
47
+ output = OutputMatcher.new(
48
+ [
49
+ 'cache:',
50
+ ' servers:',
51
+ ' 1) Status: ok',
52
+ ' Server Response: Duration: 5ms'
53
+ ]
54
+ )
55
+
56
+ expected_result = success_result(output)
57
+ result = run_cmd(cmd)
58
+ assert_cmd(expected_result, result)
59
+ end
60
+
36
61
  it 'returns 1 if one of the services failed and shows unrecognized services' do
37
62
  ping_results['results']['new_plugin'] = {
38
63
  'services' => {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hammer_cli_foreman
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.0
4
+ version: 3.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomáš Strachota
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-08-25 00:00:00.000000000 Z
12
+ date: 2024-02-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hammer_cli
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 3.8.0
20
+ version: 3.10.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: 3.8.0
27
+ version: 3.10.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: apipie-bindings
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -82,12 +82,12 @@ extensions: []
82
82
  extra_rdoc_files:
83
83
  - doc/configuration.md
84
84
  - doc/developer_docs.md
85
- - doc/host_create.md
86
85
  - doc/name_id_resolution.md
87
86
  - doc/option_builder.md
88
87
  - doc/plugin.md
89
88
  - doc/testing.md
90
89
  - doc/using_hammer_cli_foreman_command.md
90
+ - doc/host_create.md
91
91
  - doc/release_notes.md
92
92
  - README.md
93
93
  files:
@@ -149,7 +149,6 @@ files:
149
149
  - lib/hammer_cli_foreman/compute_resource/libvirt.rb
150
150
  - lib/hammer_cli_foreman/compute_resource/openstack.rb
151
151
  - lib/hammer_cli_foreman/compute_resource/ovirt.rb
152
- - lib/hammer_cli_foreman/compute_resource/rackspace.rb
153
152
  - lib/hammer_cli_foreman/compute_resource/register_compute_resources.rb
154
153
  - lib/hammer_cli_foreman/compute_resource/utils.rb
155
154
  - lib/hammer_cli_foreman/compute_resource/vmware.rb
@@ -416,7 +415,6 @@ test_files:
416
415
  - test/functional/organization_test.rb
417
416
  - test/functional/partition_table_test.rb
418
417
  - test/functional/personal_access_token_test.rb
419
- - test/functional/ping_test.rb
420
418
  - test/functional/realm_test.rb
421
419
  - test/functional/registration_test.rb
422
420
  - test/functional/role_test.rb
@@ -434,6 +432,7 @@ test_files:
434
432
  - test/functional/associating_commands_test.rb
435
433
  - test/functional/report_template_test.rb
436
434
  - test/functional/virtual_machine_test.rb
435
+ - test/functional/ping_test.rb
437
436
  - test/unit/api/oauth/oauth_authentication_code_grant_test.rb
438
437
  - test/unit/api/oauth/oauth_password_grant_test.rb
439
438
  - test/unit/api/void_auth_test.rb
@@ -1,25 +0,0 @@
1
- module HammerCLIForeman
2
- module ComputeResources
3
- class Rackspace < Base
4
- def name
5
- 'Rackspace'
6
- end
7
-
8
- def compute_attributes
9
- %w[flavor_id]
10
- end
11
-
12
- def provider_specific_fields
13
- super + [
14
- Fields::Field.new(:label => _('Region'), :path => [:region])
15
- ]
16
- end
17
-
18
- def mandatory_resource_options
19
- super + %i[url]
20
- end
21
- end
22
-
23
- HammerCLIForeman.register_compute_resource('rackspace', Rackspace.new)
24
- end
25
- end