hammer_cli_foreman 3.13.0 → 3.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/doc/host_create.md +3 -1
  3. data/doc/release_notes.md +10 -0
  4. data/lib/hammer_cli_foreman/commands.rb +1 -1
  5. data/lib/hammer_cli_foreman/compute_resource/libvirt.rb +5 -2
  6. data/lib/hammer_cli_foreman/compute_resource/vmware.rb +9 -6
  7. data/lib/hammer_cli_foreman/option_builders.rb +4 -2
  8. data/lib/hammer_cli_foreman/registration_tokens.rb +27 -0
  9. data/lib/hammer_cli_foreman/user.rb +2 -1
  10. data/lib/hammer_cli_foreman/version.rb +1 -1
  11. data/locale/ca/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  12. data/locale/cs_CZ/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  13. data/locale/de/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  14. data/locale/en/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  15. data/locale/en_GB/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  16. data/locale/es/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  17. data/locale/fr/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  18. data/locale/it/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  19. data/locale/ja/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  20. data/locale/ka/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  21. data/locale/ko/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  22. data/locale/pt_BR/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  23. data/locale/ru/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  24. data/locale/zh_CN/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  25. data/locale/zh_TW/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  26. data/test/data/3.14/foreman_api.json +1 -0
  27. data/test/functional/architecture_test.rb +0 -2
  28. data/test/functional/settings_test.rb +0 -2
  29. data/test/functional/usergroup_test.rb +0 -2
  30. data/test/test_helper.rb +1 -1
  31. data/test/unit/architecture_test.rb +0 -10
  32. data/test/unit/settings_test.rb +0 -4
  33. data/test/unit/usergroup_test.rb +0 -10
  34. metadata +10 -7
@@ -39,8 +39,6 @@ describe 'architecture' do
39
39
  )
40
40
  defaults.stubs(:write_to_file).returns(true)
41
41
  defaults.stubs(:providers).returns(providers)
42
- api_expects(:users, :index, 'Find user').with_params(search: 'login=admin').returns(index_response([{ 'default_organization' => { 'id' => 2 } }]))
43
- api_expects(:users, :index, 'Find user').with_params(search: 'login=admin').returns(index_response([{ 'default_location' => { 'id' => 1 } }]))
44
42
  api_expects(:architectures, :index, 'List architectures').returns(@architectures)
45
43
 
46
44
  result = run_cmd(@cmd, { use_defaults: true, defaults: defaults })
@@ -45,8 +45,6 @@ describe 'Settings' do
45
45
  )
46
46
  defaults.stubs(:write_to_file).returns(true)
47
47
  defaults.stubs(:providers).returns(providers)
48
- api_expects(:users, :index, 'Find user').with_params(search: 'login=admin').returns(index_response([{ 'default_organization' => { 'id' => 2 } }]))
49
- api_expects(:users, :index, 'Find user').with_params(search: 'login=admin').returns(index_response([{ 'default_location' => { 'id' => 1 } }]))
50
48
  api_expects(:settings, :index, 'List settings').returns(setting)
51
49
 
52
50
  result = run_cmd(@cmd, { use_defaults: true, defaults: defaults })
@@ -40,8 +40,6 @@ describe 'user-group' do
40
40
  )
41
41
  defaults.stubs(:write_to_file).returns(true)
42
42
  defaults.stubs(:providers).returns(providers)
43
- api_expects(:users, :index, 'Find user').with_params(search: 'login=admin').returns(index_response([{ 'default_organization' => { 'id' => 2 } }]))
44
- api_expects(:users, :index, 'Find user').with_params(search: 'login=admin').returns(index_response([{ 'default_location' => { 'id' => 1 } }]))
45
43
  api_expects(:usergroups, :index, 'List user groups').returns(@user_groups)
46
44
 
47
45
  result = run_cmd(@cmd, { use_defaults: true, defaults: defaults })
data/test/test_helper.rb CHANGED
@@ -16,7 +16,7 @@ require "mocha/minitest"
16
16
  require 'hammer_cli'
17
17
  require 'hammer_cli_foreman/testing/api_expectations'
18
18
 
19
- FOREMAN_VERSION = ENV['TEST_API_VERSION'] || '3.12'
19
+ FOREMAN_VERSION = ENV['TEST_API_VERSION'] || '3.14'
20
20
  unless Dir.entries('test/data').include? FOREMAN_VERSION
21
21
  raise StandardError.new "Version is not correct"
22
22
  end
@@ -17,8 +17,6 @@ describe HammerCLIForeman::Architecture do
17
17
  describe "parameters" do
18
18
  it_should_accept "no arguments"
19
19
  it_should_accept_search_params
20
- it_should_accept 'organization', ['--organization-id=1']
21
- it_should_accept 'location', ['--location-id=1']
22
20
  end
23
21
 
24
22
  describe "output" do
@@ -39,8 +37,6 @@ describe HammerCLIForeman::Architecture do
39
37
  describe "parameters" do
40
38
  it_should_accept "id", ["--id=1"]
41
39
  it_should_accept "name", ["--name=arch"]
42
- it_should_accept 'organization', %w[--id=1 --organization-id=1]
43
- it_should_accept 'location', %w[--id=1 --location-id=1]
44
40
  # it_should_fail_with "no arguments" # TODO: temporarily disabled, parameters are checked in the id resolver
45
41
  end
46
42
 
@@ -61,8 +57,6 @@ describe HammerCLIForeman::Architecture do
61
57
 
62
58
  describe "parameters" do
63
59
  it_should_accept "name", ["--name=arch"]
64
- it_should_accept 'organization', %w[--name=arch --organization-id=1]
65
- it_should_accept 'location', %w[--name=arch --location-id=1]
66
60
  # it_should_fail_with "name missing", []
67
61
  # TODO: temporarily disabled, parameters are checked in the api
68
62
  end
@@ -77,8 +71,6 @@ describe HammerCLIForeman::Architecture do
77
71
  describe "parameters" do
78
72
  it_should_accept "name", ["--name=arch"]
79
73
  it_should_accept "id", ["--id=1"]
80
- it_should_accept 'organization', %w[--id=1 --organization-id=1]
81
- it_should_accept 'location', %w[--id=1 --location-id=1]
82
74
  # it_should_fail_with "name or id missing", [] # TODO: temporarily disabled, parameters are checked in the id resolver
83
75
  end
84
76
 
@@ -92,8 +84,6 @@ describe HammerCLIForeman::Architecture do
92
84
  describe "parameters" do
93
85
  it_should_accept "name", ["--name=arch", "--new-name=arch2"]
94
86
  it_should_accept "id", ["--id=1", "--new-name=arch2"]
95
- it_should_accept 'organization', %w[--id=1 --new-name=arch2 --organization-id=1]
96
- it_should_accept 'location', %w[--id=1 --new-name=arch2 --location-id=1]
97
87
  # it_should_fail_with "no params", [] # TODO: temporarily disabled, parameters are checked in the id resolver
98
88
  # it_should_fail_with "name or id missing", ["--new-name=arch2"] # TODO: temporarily disabled, parameters are checked in the id resolver
99
89
  end
@@ -18,8 +18,6 @@ describe HammerCLIForeman::Settings do
18
18
  describe "parameters" do
19
19
  it_should_accept "no arguments"
20
20
  it_should_accept_search_params
21
- it_should_accept 'organization', ['--organization-id=1']
22
- it_should_accept 'location', ['--location-id=1']
23
21
  end
24
22
 
25
23
  describe "output" do
@@ -40,8 +38,6 @@ describe HammerCLIForeman::Settings do
40
38
  describe "parameters" do
41
39
  it_should_accept "name", ["--name=setting1", "--value=setting2"]
42
40
  it_should_accept "id", ["--id=1", "--value=setting2"]
43
- it_should_accept 'organization', %w[--id=1 --organization-id=1]
44
- it_should_accept 'location', %w[--id=1 --location-id=1]
45
41
  end
46
42
 
47
43
  end
@@ -18,8 +18,6 @@ describe HammerCLIForeman::Usergroup do
18
18
  describe "parameters" do
19
19
  it_should_accept "no arguments"
20
20
  it_should_accept_search_params
21
- it_should_accept 'organization', ['--organization-id=1']
22
- it_should_accept 'location', ['--location-id=1']
23
21
  end
24
22
 
25
23
  describe "output" do
@@ -37,8 +35,6 @@ describe HammerCLIForeman::Usergroup do
37
35
  describe "parameters" do
38
36
  it_should_accept "id", ["--id=1"]
39
37
  it_should_accept "name", ["--name=ug"]
40
- it_should_accept 'organization', %w[--id=1 --organization-id=1]
41
- it_should_accept 'location', %w[--id=1 --location-id=1]
42
38
  end
43
39
 
44
40
  describe "output" do
@@ -62,8 +58,6 @@ describe HammerCLIForeman::Usergroup do
62
58
  describe "parameters" do
63
59
  it_should_accept "name", ["--name=ug"]
64
60
  it_should_accept "name, role ids, user group ids and user ids", ["--name=ug", "--role-ids=1,2,3", "--user-group-ids=1,2,3", "--user-ids=1,2,3"]
65
- it_should_accept 'organization', %w[--name=ug --organization-id=1]
66
- it_should_accept 'location', %w[--name=ug --location-id=1]
67
61
  end
68
62
  end
69
63
 
@@ -74,8 +68,6 @@ describe HammerCLIForeman::Usergroup do
74
68
  describe "parameters" do
75
69
  it_should_accept "name", ["--name=ug"]
76
70
  it_should_accept "id", ["--id=1"]
77
- it_should_accept 'organization', %w[--id=1 --organization-id=1]
78
- it_should_accept 'location', %w[--id=1 --location-id=1]
79
71
  end
80
72
  end
81
73
 
@@ -88,8 +80,6 @@ describe HammerCLIForeman::Usergroup do
88
80
  it_should_accept "id", ["--id=1"]
89
81
  it_should_accept "name and new name", ["--name=ug", "--new-name=ug2"]
90
82
  it_should_accept "id, new name, role ids, user group ids and user ids", ["--id=1", "--new-name=ug", "--role-ids=1,2,3", "--user-group-ids=1,2,3", "--user-ids=1,2,3"]
91
- it_should_accept 'organization', %w[--id=1 --organization-id=1]
92
- it_should_accept 'location', %w[--id=1 --location-id=1]
93
83
  end
94
84
  end
95
85
  end
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.13.0
4
+ version: 3.14.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: 2024-11-08 00:00:00.000000000 Z
12
+ date: 2025-02-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hammer_cli
@@ -17,28 +17,28 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 3.13.0
20
+ version: 3.14.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.13.0
27
+ version: 3.14.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: apipie-bindings
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: 0.6.0
34
+ version: 0.7.0
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: 0.6.0
41
+ version: 0.7.0
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rest-client
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -197,6 +197,7 @@ files:
197
197
  - lib/hammer_cli_foreman/realm.rb
198
198
  - lib/hammer_cli_foreman/references.rb
199
199
  - lib/hammer_cli_foreman/registration.rb
200
+ - lib/hammer_cli_foreman/registration_tokens.rb
200
201
  - lib/hammer_cli_foreman/report_template.rb
201
202
  - lib/hammer_cli_foreman/resource_supported_test.rb
202
203
  - lib/hammer_cli_foreman/role.rb
@@ -235,6 +236,7 @@ files:
235
236
  - test/data/3.1/foreman_api.json
236
237
  - test/data/3.11/foreman_api.json
237
238
  - test/data/3.12/foreman_api.json
239
+ - test/data/3.14/foreman_api.json
238
240
  - test/data/3.4/foreman_api.json
239
241
  - test/data/README.md
240
242
  - test/functional/architecture_test.rb
@@ -337,7 +339,7 @@ files:
337
339
  - test/unit/usergroup_test.rb
338
340
  homepage: https://github.com/theforeman/hammer-cli-foreman
339
341
  licenses:
340
- - GPL-3.0+
342
+ - GPL-3.0-or-later
341
343
  metadata: {}
342
344
  post_install_message:
343
345
  rdoc_options: []
@@ -362,6 +364,7 @@ test_files:
362
364
  - test/data/3.1/foreman_api.json
363
365
  - test/data/3.11/foreman_api.json
364
366
  - test/data/3.12/foreman_api.json
367
+ - test/data/3.14/foreman_api.json
365
368
  - test/data/3.4/foreman_api.json
366
369
  - test/data/README.md
367
370
  - test/functional/architecture_test.rb