hammer_cli_foreman 3.8.0 → 3.9.0

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: ee6e69c32f2da750f35474c76deab901c34156e02f588831793b7f668e3445db
4
- data.tar.gz: db9db4349a41cf3e1058b33de2cdb599df9526dc6477c12d8fbb8cb3cfccba1b
3
+ metadata.gz: 85d5c798f08f0d775ede7457aab35f687b300a74d623cb07cfd43a532a9af6ac
4
+ data.tar.gz: b2c32e64f0fa54187da3e66fe745ef7da093f9696e7757737a2dd802c7ffcd5e
5
5
  SHA512:
6
- metadata.gz: 38103b52f65f395870d1cf31da86d4df330248f06ffceb346ed63ec1c9bfb7a7f79a8bfd30fd46d458af97b47ef3c9d08cdd32c056e9eb4765bbef4f2d74be91
7
- data.tar.gz: 5c57d8514e09458120a4e01dda31de420b27c85616572ad6577fccf486065294d9308b6b70f344c36070b4d08e52dbfd6f5d78a980f98e81256d95f45ff84a15
6
+ metadata.gz: b3575fcc16dd4f4a48549b121b6ef4cbde40cfcd9a8de8f7b8f7fa395d843926962b61f0b543f50a0b58aac7235df9e5682b1a0b21ee1a5e870c6d13df706343
7
+ data.tar.gz: 8ebbec2ded6ed488d41de567e2696d564ed0640eb7c1c9305f77c318218dff5b8456808cd0e9bc3a441fbebf7b4e0388a16c06297147fe3c6a0ee9e5e427d311
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,13 @@
1
1
  Release notes
2
2
  =============
3
+ ### 3.9.0 (2023-11-29)
4
+ * Add cache status to ping output ([PR #622](https://github.com/theforeman/hammer-cli-foreman/pull/622)), [#36954](http://projects.theforeman.org/issues/36954)
5
+ * Use strings, not floats to denote ruby versions ([PR #623](https://github.com/theforeman/hammer-cli-foreman/pull/623))
6
+ * Update packit
7
+ * Drop rackspace cr support ([PR #619](https://github.com/theforeman/hammer-cli-foreman/pull/619)), [#36813](http://projects.theforeman.org/issues/36813)
8
+ * Update rel-eng
9
+ * Bump to 3.9.0-develop
10
+
3
11
  ### 3.8.0 (2023-08-25)
4
12
  * Support mocha 2.1 ([PR #618](https://github.com/theforeman/hammer-cli-foreman/pull/618)), [#34879](http://projects.theforeman.org/issues/34879)
5
13
  * 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
@@ -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.9.0"
4
4
  end
5
5
  end
@@ -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.9.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: 2023-11-29 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.9.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.9.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