hammer_cli_foreman 3.15.0 → 3.16.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 +4 -4
- data/doc/host_create.md +0 -27
- data/doc/release_notes.md +5 -0
- data/lib/hammer_cli_foreman/auth_source_ldap.rb +2 -1
- data/lib/hammer_cli_foreman/compute_resource/register_compute_resources.rb +0 -1
- data/lib/hammer_cli_foreman/compute_resource.rb +0 -31
- data/lib/hammer_cli_foreman/version.rb +1 -1
- data/locale/ca/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/cs_CZ/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/de/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/en/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/en_GB/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/es/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/fr/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/it/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/ja/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/ka/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/ko/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/pt_BR/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/ru/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/zh_CN/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/zh_TW/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/test/functional/compute_attribute_test.rb +25 -25
- data/test/functional/compute_profile_test.rb +2 -2
- data/test/functional/compute_resource_test.rb +1 -75
- data/test/functional/virtual_machine_test.rb +2 -5
- metadata +4 -8
- data/lib/hammer_cli_foreman/compute_resource/ovirt.rb +0 -70
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6cce84aa9448f148f34dc8c3dadefb63266befb216719e8f8c288ac6dc6b086
|
4
|
+
data.tar.gz: c60b4c38f40c445f882d8916d8e07544f52cb783c04950d454a5f7e7e0944656
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e7e14288bd716781334577c6fbf5898fee6f2e5c0c9e225a4afc2d6f615ff55ad42676d97a14bdf791e87eb646c61408263832c89d7108b2e81826de6eae3f9
|
7
|
+
data.tar.gz: 644f4208b796b37517c556e3cbf95955f3c3d9f7032d6214ac2fa52a08683d52f3f4a873a4f411b4d83d60b6a172a87526489d23123d963c51f80c1e567c1fb4
|
data/doc/host_create.md
CHANGED
@@ -225,33 +225,6 @@ security_groups
|
|
225
225
|
network
|
226
226
|
```
|
227
227
|
|
228
|
-
## oVirt
|
229
|
-
Available keys for `--compute-attributes`:
|
230
|
-
```
|
231
|
-
cluster
|
232
|
-
template # hardware profile to use
|
233
|
-
cores # int value, number of cores
|
234
|
-
sockets # int value, number of sockets
|
235
|
-
memory # amount of memory, int value in bytes
|
236
|
-
start # Must be a 1 or 0, whether to start the machine or not
|
237
|
-
```
|
238
|
-
|
239
|
-
Available keys for `--interface`:
|
240
|
-
```
|
241
|
-
compute_name # eg. eth0
|
242
|
-
compute_network # select one of available networks for a cluster
|
243
|
-
compute_interface # interface type
|
244
|
-
```
|
245
|
-
|
246
|
-
Available keys for `--volume`:
|
247
|
-
```
|
248
|
-
size_gb # volume size in GB, integer value
|
249
|
-
storage_domain # select one of available storage domains
|
250
|
-
bootable # boolean, only one volume can be bootable
|
251
|
-
preallocate # boolean, set true to preallocate
|
252
|
-
wipe_after_delete # boolean, set true to wipe disk after delete
|
253
|
-
```
|
254
|
-
|
255
228
|
## VMware
|
256
229
|
Available keys for `--compute-attributes`:
|
257
230
|
```
|
data/doc/release_notes.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
Release notes
|
2
2
|
=============
|
3
|
+
### 3.16.0 (2025-08-13)
|
4
|
+
* Ldap group membership ([PR #641](https://github.com/theforeman/hammer-cli-foreman/pull/641)), [#38611](http://projects.theforeman.org/issues/38611)
|
5
|
+
* Remove ovirt ([PR #639](https://github.com/theforeman/hammer-cli-foreman/pull/639)), [#38294](http://projects.theforeman.org/issues/38294)
|
6
|
+
* Bump to 3.16.0-develop
|
7
|
+
|
3
8
|
### 3.15.0 (2025-05-14)
|
4
9
|
* Use 3.15 test data
|
5
10
|
* Fix hammer insights inventory sync error message ([PR #640](https://github.com/theforeman/hammer-cli-foreman/pull/640)), [#38401](http://projects.theforeman.org/issues/38401)
|
@@ -30,7 +30,8 @@ module HammerCLIForeman
|
|
30
30
|
field :account, _('Account Username')
|
31
31
|
field :base_dn, _('Base DN')
|
32
32
|
field :groups_base, _('Groups base DN')
|
33
|
-
field :use_netgroups, _('Use Netgroups'), Fields::Boolean
|
33
|
+
field :use_netgroups, _('Use Netgroups'), Fields::Boolean, :replaced_by => [_('Account'), _('LDAP group membership')].join('/')
|
34
|
+
field :ldap_group_membership, _('LDAP group membership')
|
34
35
|
field :ldap_filter, _('LDAP filter')
|
35
36
|
field :onthefly_register, _('Automatically Create Accounts?'), Fields::Boolean
|
36
37
|
field :usergroup_sync, _('Usergroup sync'), Fields::Boolean
|
@@ -12,6 +12,5 @@ module HammerCLIForeman
|
|
12
12
|
require 'hammer_cli_foreman/compute_resource/ec2.rb'
|
13
13
|
require 'hammer_cli_foreman/compute_resource/libvirt.rb'
|
14
14
|
require 'hammer_cli_foreman/compute_resource/openstack.rb'
|
15
|
-
require 'hammer_cli_foreman/compute_resource/ovirt.rb'
|
16
15
|
require 'hammer_cli_foreman/compute_resource/vmware.rb'
|
17
16
|
end
|
@@ -51,21 +51,11 @@ module HammerCLIForeman
|
|
51
51
|
|
52
52
|
|
53
53
|
class CreateCommand < HammerCLIForeman::CreateCommand
|
54
|
-
option "--public-key-path", "PUBLIC_KEY_PATH", _("Path to a file that contains oVirt public key (For oVirt only)"),
|
55
|
-
:format => HammerCLI::Options::Normalizers::File.new
|
56
|
-
|
57
|
-
|
58
54
|
success_message _("Compute resource created.")
|
59
55
|
failure_message _("Could not create the compute resource")
|
60
56
|
|
61
57
|
build_options
|
62
58
|
|
63
|
-
def request_params
|
64
|
-
params = super
|
65
|
-
params['compute_resource']['public_key'] = option_public_key_path if option_public_key_path
|
66
|
-
params
|
67
|
-
end
|
68
|
-
|
69
59
|
validate_options do
|
70
60
|
if option(:option_provider).value.nil? || option(:option_name).value.nil?
|
71
61
|
all(:option_name, :option_provider).required
|
@@ -82,17 +72,9 @@ module HammerCLIForeman
|
|
82
72
|
end
|
83
73
|
|
84
74
|
class UpdateCommand < HammerCLIForeman::UpdateCommand
|
85
|
-
option "--public-key-path", "PUBLIC_KEY_PATH", _("Path to a file that contains oVirt public key (For oVirt only)"),
|
86
|
-
:format => HammerCLI::Options::Normalizers::File.new
|
87
|
-
|
88
75
|
success_message _("Compute resource updated.")
|
89
76
|
failure_message _("Could not update the compute resource")
|
90
77
|
|
91
|
-
def request_params
|
92
|
-
params = super
|
93
|
-
params['compute_resource']['public_key'] = option_public_key_path if option_public_key_path
|
94
|
-
params
|
95
|
-
end
|
96
78
|
build_options :without => :name
|
97
79
|
end
|
98
80
|
|
@@ -145,19 +127,6 @@ module HammerCLIForeman
|
|
145
127
|
extend_with(HammerCLIForeman::CommandExtensions::ComputeResourceSubcommand.new(only: %i[option request_params]))
|
146
128
|
end
|
147
129
|
|
148
|
-
class AvailableVnicProfilesCommand < HammerCLIForeman::ListCommand
|
149
|
-
action :available_vnic_profiles
|
150
|
-
command_name 'vnic-profiles'
|
151
|
-
|
152
|
-
output do
|
153
|
-
field :id, _('VNIC profile ID'), Fields::Field, :max_width => 200, :hide_blank => true
|
154
|
-
field :name, _('Name')
|
155
|
-
field :network, _('Network ID')
|
156
|
-
end
|
157
|
-
|
158
|
-
build_options
|
159
|
-
end
|
160
|
-
|
161
130
|
class AvailableImagesCommand < HammerCLIForeman::ListCommand
|
162
131
|
action :available_images
|
163
132
|
command_name 'images'
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -48,7 +48,7 @@ describe "parameters" do
|
|
48
48
|
"id" => 2,
|
49
49
|
"compute_resource_id" => 1,
|
50
50
|
"compute_resource_name" => "bla",
|
51
|
-
"provider_friendly_name" => "
|
51
|
+
"provider_friendly_name" => "Libvirt",
|
52
52
|
"compute_profile_id" => 1,
|
53
53
|
"compute_profile_name" => "profile2",
|
54
54
|
"vm_attrs" => {}
|
@@ -59,16 +59,16 @@ describe "parameters" do
|
|
59
59
|
"compute_attribute" =>
|
60
60
|
{
|
61
61
|
"id" => 2, "compute_resource_id" => 1, "compute_resource_name" => "bla",
|
62
|
-
"provider_friendly_name" => "
|
62
|
+
"provider_friendly_name" => "Libvirt", "compute_profile_id" => 1,
|
63
63
|
"compute_profile_name" => "profile2", "vm_attrs" => {"cores" => "1"}
|
64
64
|
}
|
65
65
|
}
|
66
66
|
|
67
67
|
@compute_resource = {
|
68
68
|
"id" => 1,
|
69
|
-
"name" => "
|
70
|
-
"provider" => "
|
71
|
-
"provider_friendly_name" => "
|
69
|
+
"name" => "libvirt_compute_resource",
|
70
|
+
"provider" => "Libvirt",
|
71
|
+
"provider_friendly_name" => "Libvirt",
|
72
72
|
}
|
73
73
|
end
|
74
74
|
|
@@ -129,7 +129,7 @@ describe "parameters" do
|
|
129
129
|
"id" => 2,
|
130
130
|
"compute_resource_id" => 1,
|
131
131
|
"compute_resource_name" => "bla",
|
132
|
-
"provider_friendly_name" => "
|
132
|
+
"provider_friendly_name" => "Libvirt",
|
133
133
|
"compute_profile_id" => 1,
|
134
134
|
"compute_profile_name" => "profile2",
|
135
135
|
"vm_attrs" => {}
|
@@ -137,7 +137,7 @@ describe "parameters" do
|
|
137
137
|
}
|
138
138
|
@compute_attribute = {
|
139
139
|
"id" => 2, "compute_resource_id" => 1, "compute_resource_name" => "bla",
|
140
|
-
"provider_friendly_name" => "
|
140
|
+
"provider_friendly_name" => "Libvirt", "compute_profile_id" => 1, "compute_profile_name" => "profile2",
|
141
141
|
"vm_attrs" => {"volumes_attributes" => {"1525004465" => {"size_gb" => "1"}}}
|
142
142
|
}
|
143
143
|
|
@@ -211,7 +211,7 @@ describe "parameters" do
|
|
211
211
|
"id" => 2,
|
212
212
|
"compute_resource_id" => 1,
|
213
213
|
"compute_resource_name" => "bla",
|
214
|
-
"provider_friendly_name" => "
|
214
|
+
"provider_friendly_name" => "Libvirt",
|
215
215
|
"compute_profile_id" => 1,
|
216
216
|
"compute_profile_name" => "profile2",
|
217
217
|
"vm_attrs" => {}
|
@@ -283,7 +283,7 @@ describe "parameters" do
|
|
283
283
|
"id" => 2,
|
284
284
|
"compute_resource_id" => 1,
|
285
285
|
"compute_resource_name" => "bla",
|
286
|
-
"provider_friendly_name" => "
|
286
|
+
"provider_friendly_name" => "Libvirt",
|
287
287
|
"compute_profile_id" => 1,
|
288
288
|
"compute_profile_name" => "profile2",
|
289
289
|
"vm_attrs" => {"volumes_attributes" => { "1" => {"size_gb"=>"1"}}}
|
@@ -291,7 +291,7 @@ describe "parameters" do
|
|
291
291
|
}
|
292
292
|
@compute_attribute = {
|
293
293
|
"id" => 2, "compute_resource_id" => 1, "compute_resource_name" => "bla",
|
294
|
-
"provider_friendly_name" => "
|
294
|
+
"provider_friendly_name" => "Libvirt", "compute_profile_id" => 1,
|
295
295
|
"compute_profile_name" => "profile2", "vm_attrs" => {"volumes_attributes" => {}}
|
296
296
|
}
|
297
297
|
end
|
@@ -362,7 +362,7 @@ describe "parameters" do
|
|
362
362
|
"id" => 2,
|
363
363
|
"compute_resource_id" => 1,
|
364
364
|
"compute_resource_name" => "bla",
|
365
|
-
"provider_friendly_name" => "
|
365
|
+
"provider_friendly_name" => "Libvirt",
|
366
366
|
"compute_profile_id" => 1,
|
367
367
|
"compute_profile_name" => "profile2",
|
368
368
|
"vm_attrs" => {}
|
@@ -376,7 +376,7 @@ describe "parameters" do
|
|
376
376
|
"id" => 2,
|
377
377
|
"compute_resource_id" => 1,
|
378
378
|
"compute_resource_name" => "bla",
|
379
|
-
"provider_friendly_name" => "
|
379
|
+
"provider_friendly_name" => "Libvirt",
|
380
380
|
"compute_profile_id" => 1,
|
381
381
|
"compute_profile_name" => "profile2",
|
382
382
|
"vm_attrs" => {}
|
@@ -385,9 +385,9 @@ describe "parameters" do
|
|
385
385
|
|
386
386
|
@compute_resource = {
|
387
387
|
"id" => 1,
|
388
|
-
"name" => "
|
389
|
-
"provider" => "
|
390
|
-
"provider_friendly_name" => "
|
388
|
+
"name" => "libvirt_compute_resource",
|
389
|
+
"provider" => "Libvirt",
|
390
|
+
"provider_friendly_name" => "Libvirt",
|
391
391
|
}
|
392
392
|
|
393
393
|
end
|
@@ -491,7 +491,7 @@ describe "parameters" do
|
|
491
491
|
"id" => 2,
|
492
492
|
"compute_resource_id" => 1,
|
493
493
|
"compute_resource_name" => "bla",
|
494
|
-
"provider_friendly_name" => "
|
494
|
+
"provider_friendly_name" => "Libvirt",
|
495
495
|
"compute_profile_id" => 1,
|
496
496
|
"compute_profile_name" => "profile2",
|
497
497
|
"vm_attrs" => {}
|
@@ -500,9 +500,9 @@ describe "parameters" do
|
|
500
500
|
|
501
501
|
@compute_resource = {
|
502
502
|
"id" => 1,
|
503
|
-
"name" => "
|
504
|
-
"provider" => "
|
505
|
-
"provider_friendly_name" => "
|
503
|
+
"name" => "libvirt_compute_resource",
|
504
|
+
"provider" => "Libvirt",
|
505
|
+
"provider_friendly_name" => "Libvirt",
|
506
506
|
}
|
507
507
|
end
|
508
508
|
|
@@ -574,23 +574,23 @@ describe "parameters" do
|
|
574
574
|
"id" => 2,
|
575
575
|
"compute_resource_id" => 1,
|
576
576
|
"compute_resource_name" => "bla",
|
577
|
-
"provider_friendly_name" => "
|
577
|
+
"provider_friendly_name" => "Libvirt",
|
578
578
|
"compute_profile_id" => 1,
|
579
579
|
"compute_profile_name" => "profile2",
|
580
|
-
"vm_attrs" => {"
|
580
|
+
"vm_attrs" => {"nics_attributes" => { "1" => {"compute_name"=>"eth0"}}}
|
581
581
|
}]
|
582
582
|
}
|
583
583
|
@compute_attribute = {
|
584
584
|
"id" => 2, "compute_resource_id" => 1, "compute_resource_name" => "bla",
|
585
|
-
"provider_friendly_name" => "
|
585
|
+
"provider_friendly_name" => "Libvirt", "compute_profile_id" => 1,
|
586
586
|
"compute_profile_name" => "profile2", "vm_attrs" => {"interfaces_attributes" => {}}
|
587
587
|
}
|
588
588
|
|
589
589
|
@compute_resource = {
|
590
590
|
"id" => 1,
|
591
|
-
"name" => "
|
592
|
-
"provider" => "
|
593
|
-
"provider_friendly_name" => "
|
591
|
+
"name" => "libvirt_compute_resource",
|
592
|
+
"provider" => "Libvirt",
|
593
|
+
"provider_friendly_name" => "Libvirt",
|
594
594
|
}
|
595
595
|
|
596
596
|
end
|
@@ -26,7 +26,7 @@ describe "parameters" do
|
|
26
26
|
"id": 2,
|
27
27
|
"compute_resource_id": 3,
|
28
28
|
"compute_resource_name": "bla",
|
29
|
-
"provider_friendly_name": "
|
29
|
+
"provider_friendly_name": "Libvirt",
|
30
30
|
"compute_profile_id": 1,
|
31
31
|
"compute_profile_name": "profile2",
|
32
32
|
}]
|
@@ -64,7 +64,7 @@ describe "parameters" do
|
|
64
64
|
"id": 4,
|
65
65
|
"compute_resource_id": 3,
|
66
66
|
"compute_resource_name": "bla",
|
67
|
-
"provider_friendly_name": "
|
67
|
+
"provider_friendly_name": "Libvirt",
|
68
68
|
"compute_profile_id": 3,
|
69
69
|
"compute_profile_name": "profile3",
|
70
70
|
}]
|
@@ -61,7 +61,7 @@ describe 'compute-resource' do
|
|
61
61
|
assert_cmd(expected_result, result)
|
62
62
|
end
|
63
63
|
end
|
64
|
-
|
64
|
+
|
65
65
|
|
66
66
|
it 'should print error for blank --provider option' do
|
67
67
|
params = %w(--provider= --name=new'')
|
@@ -109,55 +109,6 @@ describe 'compute-resource' do
|
|
109
109
|
|
110
110
|
assert_cmd(success_result("Compute resource created.\n"), result)
|
111
111
|
end
|
112
|
-
|
113
|
-
it 'should create a compute-resource ovirt' do
|
114
|
-
params = %w(--name=test-ovirt
|
115
|
-
--provider=ovirt
|
116
|
-
--url=https://ovirt.example.com/ovirt-engine/api
|
117
|
-
--user=foreman
|
118
|
-
--password=changeme
|
119
|
-
--datacenter=ovirt.example.com)
|
120
|
-
|
121
|
-
api_expects(:compute_resources, :create, 'Create Compute Resource') do |params|
|
122
|
-
(params['compute_resource']['name'] == 'test-ovirt') &&
|
123
|
-
(params['compute_resource']['provider'] == 'ovirt') &&
|
124
|
-
(params['compute_resource']['url'] == 'https://ovirt.example.com/ovirt-engine/api') &&
|
125
|
-
(params['compute_resource']['user'] == 'foreman') &&
|
126
|
-
(params['compute_resource']['password'] == 'changeme') &&
|
127
|
-
(params['compute_resource']['datacenter'] == 'ovirt.example.com')
|
128
|
-
end
|
129
|
-
|
130
|
-
result = run_cmd(@cmd + params)
|
131
|
-
|
132
|
-
assert_cmd(success_result("Compute resource created.\n"), result)
|
133
|
-
end
|
134
|
-
|
135
|
-
|
136
|
-
it 'should create a compute-resource ovirt with custom public key' do
|
137
|
-
tempfile = Tempfile.new('ca.pem')
|
138
|
-
tempfile << 'test data'
|
139
|
-
tempfile.close
|
140
|
-
params = %W(--name=test-ovirt
|
141
|
-
--provider=ovirt
|
142
|
-
--url=https://ovirt.example.com/ovirt-engine/api
|
143
|
-
--user=foreman
|
144
|
-
--password=changeme
|
145
|
-
--datacenter=ovirt.example.com
|
146
|
-
--public-key-path=#{tempfile.path})
|
147
|
-
|
148
|
-
api_expects(:compute_resources, :create, 'Create Compute Resource') do |params|
|
149
|
-
(params['compute_resource']['name'] =='test-ovirt') &&
|
150
|
-
(params['compute_resource']['provider'] == 'ovirt') &&
|
151
|
-
(params['compute_resource']['url'] == 'https://ovirt.example.com/ovirt-engine/api') &&
|
152
|
-
(params['compute_resource']['user'] == 'foreman') &&
|
153
|
-
(params['compute_resource']['password'] == 'changeme') &&
|
154
|
-
(params['compute_resource']['datacenter'] == 'ovirt.example.com' &&
|
155
|
-
(params['compute_resource']['public_key'] == 'test data'))
|
156
|
-
end
|
157
|
-
result = run_cmd(@cmd + params)
|
158
|
-
|
159
|
-
assert_cmd(success_result("Compute resource created.\n"), result)
|
160
|
-
end
|
161
112
|
end
|
162
113
|
|
163
114
|
describe 'clusters' do
|
@@ -210,31 +161,6 @@ end
|
|
210
161
|
end
|
211
162
|
end
|
212
163
|
|
213
|
-
describe 'vnic profiles' do
|
214
|
-
let(:cmd) { base_cmd << 'vnic-profiles' }
|
215
|
-
let(:vnic_profile_1) { { id: 1, name: 'network1', network: 2 } }
|
216
|
-
let(:vnic_profile_2) { { id: 2, name: 'network2', network: 2 } }
|
217
|
-
let(:vnic_profiles) { [vnic_profile_1, vnic_profile_2] }
|
218
|
-
|
219
|
-
it 'lists available vnic profiles for a compute resource' do
|
220
|
-
api_expects(:compute_resources, :available_vnic_profiles, 'vnic-profiles').with_params(
|
221
|
-
'id' => '1'
|
222
|
-
).returns(index_response(vnic_profiles))
|
223
|
-
|
224
|
-
output = IndexMatcher.new(
|
225
|
-
[
|
226
|
-
['VNIC PROFILE ID', 'NAME', 'NETWORK ID'],
|
227
|
-
['1', 'network1','2'],
|
228
|
-
['2', 'network2','2']
|
229
|
-
]
|
230
|
-
)
|
231
|
-
expected_result = success_result(output)
|
232
|
-
|
233
|
-
result = run_cmd(cmd + base_params)
|
234
|
-
assert_cmd(expected_result, result)
|
235
|
-
end
|
236
|
-
end
|
237
|
-
|
238
164
|
describe 'images' do
|
239
165
|
let(:cmd) { base_cmd << 'images' }
|
240
166
|
let(:image1) { { uuid: 1, name: 'image1' } }
|
@@ -11,10 +11,7 @@ describe HammerCLIForeman::VirtualMachine do
|
|
11
11
|
@vm = {
|
12
12
|
'id' => 1,
|
13
13
|
'name' => 'vm1',
|
14
|
-
'provider' => '
|
15
|
-
'cpu' => 1,
|
16
|
-
'memory' => 1,
|
17
|
-
'status' => 'down'
|
14
|
+
'provider' => 'Libvirt',
|
18
15
|
}
|
19
16
|
end
|
20
17
|
|
@@ -38,7 +35,7 @@ describe HammerCLIForeman::VirtualMachine do
|
|
38
35
|
par['id'] == '1' && par['vm_id'] == '1'
|
39
36
|
end.returns(@vm)
|
40
37
|
result = run_cmd(@cmd + params)
|
41
|
-
assert_match("Id:
|
38
|
+
assert_match("Id: 1\nName: vm1\n\n", result.out)
|
42
39
|
end
|
43
40
|
|
44
41
|
end
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hammer_cli_foreman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomáš Strachota
|
8
8
|
- Martin Bačovský
|
9
|
-
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: hammer_cli
|
@@ -80,6 +79,7 @@ email: tstracho@redhat.com
|
|
80
79
|
executables: []
|
81
80
|
extensions: []
|
82
81
|
extra_rdoc_files:
|
82
|
+
- README.md
|
83
83
|
- doc/configuration.md
|
84
84
|
- doc/developer_docs.md
|
85
85
|
- doc/host_create.md
|
@@ -89,7 +89,6 @@ extra_rdoc_files:
|
|
89
89
|
- doc/release_notes.md
|
90
90
|
- doc/testing.md
|
91
91
|
- doc/using_hammer_cli_foreman_command.md
|
92
|
-
- README.md
|
93
92
|
files:
|
94
93
|
- LICENSE
|
95
94
|
- README.md
|
@@ -148,7 +147,6 @@ files:
|
|
148
147
|
- lib/hammer_cli_foreman/compute_resource/ec2.rb
|
149
148
|
- lib/hammer_cli_foreman/compute_resource/libvirt.rb
|
150
149
|
- lib/hammer_cli_foreman/compute_resource/openstack.rb
|
151
|
-
- lib/hammer_cli_foreman/compute_resource/ovirt.rb
|
152
150
|
- lib/hammer_cli_foreman/compute_resource/register_compute_resources.rb
|
153
151
|
- lib/hammer_cli_foreman/compute_resource/utils.rb
|
154
152
|
- lib/hammer_cli_foreman/compute_resource/vmware.rb
|
@@ -342,7 +340,6 @@ homepage: https://github.com/theforeman/hammer-cli-foreman
|
|
342
340
|
licenses:
|
343
341
|
- GPL-3.0-or-later
|
344
342
|
metadata: {}
|
345
|
-
post_install_message:
|
346
343
|
rdoc_options: []
|
347
344
|
require_paths:
|
348
345
|
- lib
|
@@ -357,8 +354,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
357
354
|
- !ruby/object:Gem::Version
|
358
355
|
version: '0'
|
359
356
|
requirements: []
|
360
|
-
rubygems_version: 3.
|
361
|
-
signing_key:
|
357
|
+
rubygems_version: 3.6.7
|
362
358
|
specification_version: 4
|
363
359
|
summary: Foreman commands for Hammer
|
364
360
|
test_files:
|
@@ -1,70 +0,0 @@
|
|
1
|
-
module HammerCLIForeman
|
2
|
-
module ComputeResources
|
3
|
-
class Ovirt < Base
|
4
|
-
def name
|
5
|
-
'oVirt'
|
6
|
-
end
|
7
|
-
|
8
|
-
def compute_attributes
|
9
|
-
[
|
10
|
-
['cluster', _('ID or name of cluster to use')],
|
11
|
-
['template', _('Hardware profile to use')],
|
12
|
-
['cores', _('Integer value, number of cores')],
|
13
|
-
['sockets', _('Integer value, number of sockets')],
|
14
|
-
['memory', _('Amount of memory, integer value in bytes')],
|
15
|
-
['ha', _('Boolean, set 1 to high availability')],
|
16
|
-
['display_type', _('Possible values: %s') % 'VNC, SPICE'],
|
17
|
-
['keyboard_layout', _('Possible values: %s. Not usable if display type is SPICE.') % 'ar, de-ch, es, fo, fr-ca, hu, ja, mk, no, pt-br, sv, da, en-gb, et, fr, fr-ch, is, lt, nl, pl, ru, th, de, en-us, fi, fr-be, hr, it, lv, nl-be, pt, sl, tr']
|
18
|
-
]
|
19
|
-
end
|
20
|
-
|
21
|
-
def host_attributes
|
22
|
-
[
|
23
|
-
['start', _('Boolean, set 1 to start the vm')]
|
24
|
-
]
|
25
|
-
end
|
26
|
-
|
27
|
-
def interface_attributes
|
28
|
-
[
|
29
|
-
['compute_name', _('Compute name, e.g. eth0')],
|
30
|
-
['compute_network', _('Select one of available networks for a cluster, must be an ID or a name')],
|
31
|
-
['compute_interface', _('Interface type')],
|
32
|
-
['compute_vnic_profile', _('Vnic Profile')]
|
33
|
-
]
|
34
|
-
end
|
35
|
-
|
36
|
-
def volume_attributes
|
37
|
-
[
|
38
|
-
['size_gb', _('Volume size in GB, integer value')],
|
39
|
-
['storage_domain', _('ID or name of storage domain')],
|
40
|
-
['bootable', _('Boolean, set 1 for bootable, only one volume can be bootable')],
|
41
|
-
['preallocate', _('Boolean, set 1 to preallocate')],
|
42
|
-
['wipe_after_delete', _('Boolean, set 1 to wipe disk after delete')],
|
43
|
-
['interface', _('Disk interface name, must be ide, virtio or virtio_scsi')]
|
44
|
-
]
|
45
|
-
end
|
46
|
-
|
47
|
-
def provider_specific_fields
|
48
|
-
super + [
|
49
|
-
Fields::Field.new(:label => _('Datacenter'), :path => [:datacenter])
|
50
|
-
]
|
51
|
-
end
|
52
|
-
|
53
|
-
def provider_vm_specific_fields
|
54
|
-
[
|
55
|
-
Fields::Field.new(:label => _('CPUs'), :path => [:cpu]),
|
56
|
-
Fields::Field.new(:label => _('Memory'), :path => [:memory]),
|
57
|
-
Fields::Field.new(:label => _('Status'), :path => [:status]),
|
58
|
-
Fields::Field.new(:label => _('Cores'), :path => [:cores]),
|
59
|
-
Fields::Field.new(:label => _('Type'), :path => [:type])
|
60
|
-
]
|
61
|
-
end
|
62
|
-
|
63
|
-
def mandatory_resource_options
|
64
|
-
super + %i[url user password datacenter]
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
HammerCLIForeman.register_compute_resource('ovirt', Ovirt.new)
|
69
|
-
end
|
70
|
-
end
|