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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b728c2b2cca4f001c8a3dba0747303c9499290bc16a06d70a5cb7c5765e5cc7
4
- data.tar.gz: fef40b01976a85d5006b517066f6cc732490369f58bc8dfd18c34589a75ec5e1
3
+ metadata.gz: 68c0b075696587d6a45c65336c93004372c8322ad0b15066849205d42d136934
4
+ data.tar.gz: 76aae735617ae3c44133d56a4605fb5ef578634fae4f48a2e1bc955682e64e86
5
5
  SHA512:
6
- metadata.gz: bf060f1ccac3d9f41da96f03795bb4029692d8c053e6a4e30c90146efd04a38e485933de5e599f69e2d573ed474183160847dd340175a4dbc5b6173c61106bf2
7
- data.tar.gz: 89acced01c741343c528f2ddb6f52e7a522990c7d73add80ef8423c8ad8cf56f309e2c8121bb26ce11824f614646c2451a08ecf31aff25ed365aa747e0259fd1
6
+ metadata.gz: 12085efc8b06a244320250199e0c48e5272c63d0ae250d8d8a48610cd665fdac72915c2df8438c024a8f341c5034fabf57c9fb1adcab752616b0d243b30ad735
7
+ data.tar.gz: 48bdc56003426cc52d5669aabec38cde68eb310f077ffe9ec42ec9b517b3a6605d157fe044de938d647809db6dd60955338471a1c32d24a42b0b909c412f9857
data/doc/host_create.md CHANGED
@@ -195,6 +195,7 @@ Available keys for `--compute-attributes`:
195
195
  cpus # number of CPUs
196
196
  memory # string, amount of memory, value in bytes
197
197
  start # Must be a 1 or 0, whether to start the machine or not
198
+ firmware # automatic/bios/uefi/uefi_secure_boot (UEFI with Secure Boot enabled)
198
199
  ```
199
200
 
200
201
  Available keys for `--interface`:
@@ -257,7 +258,7 @@ Available keys for `--compute-attributes`:
257
258
  cpus CPU count
258
259
  corespersocket Number of cores per socket (applicable to hardware versions < 10 only)
259
260
  memory_mb Integer number, amount of memory in MB
260
- firmware automatic/bios/efi
261
+ firmware automatic/bios/uefi/uefi_secure_boot (UEFI with Secure Boot enabled)
261
262
  cluster Cluster ID from VMware
262
263
  resource_pool Resource Pool ID from VMware
263
264
  path Path to folder
@@ -270,6 +271,7 @@ annotation Annotation Notes
270
271
  scsi_controllers List with SCSI controllers definitions
271
272
  type - ID of the controller from VMware
272
273
  key - Key of the controller (e.g. 1000)
274
+ virtual_tpm Must be a 1 or 0, Enable virtual TPM. Only compatible with EFI firmware
273
275
  start # Must be a 1 or 0, whether to start the machine or not
274
276
  ```
275
277
 
data/doc/release_notes.md CHANGED
@@ -1,5 +1,15 @@
1
1
  Release notes
2
2
  =============
3
+ ### 3.14.0 (2025-02-20)
4
+ * Invalidate tokens for specific user/users ([PR #636](https://github.com/theforeman/hammer-cli-foreman/pull/636)), [#38124](http://projects.theforeman.org/issues/38124)
5
+ * Don't build hidden params as options ([PR #634](https://github.com/theforeman/hammer-cli-foreman/pull/634)), [#38077](http://projects.theforeman.org/issues/38077)
6
+ * Use master branch of apipie-bindings in ci
7
+ * Drop el 8 from packit config
8
+ * Add secure boot and tpm options to vmware ([PR #630](https://github.com/theforeman/hammer-cli-foreman/pull/630)), [#37685](http://projects.theforeman.org/issues/37685)
9
+ * Add firmware option for libvirt hosts creation ([PR #631](https://github.com/theforeman/hammer-cli-foreman/pull/631)), [#37692](http://projects.theforeman.org/issues/37692)
10
+ * Use non-deprecated gpl-3.0-or-later license tag
11
+ * Bump to 3.14.0-develop
12
+
3
13
  ### 3.13.0 (2024-11-08)
4
14
  * Bump to 3.13.0-develop
5
15
 
@@ -96,7 +96,7 @@ module HammerCLIForeman
96
96
  def self.create_option_builder
97
97
  configurator = BuilderConfigurator.new(searchables, dependency_resolver)
98
98
 
99
- builder = ForemanOptionBuilder.new(searchables)
99
+ builder = ForemanOptionBuilder.new(searchables, resource_defined? ? resource.action(action) : nil)
100
100
  builder.builders = super.builders
101
101
  builder.builders += configurator.builders_for(resource, resource.action(action)) if resource_defined?
102
102
  builder
@@ -9,7 +9,8 @@ module HammerCLIForeman
9
9
  [
10
10
  ['cpus', _('Number of CPUs'), { bold: true }],
11
11
  ['memory', _('String, amount of memory, value in bytes'), { bold: true }],
12
- ['boot_order', _('Device names to specify the boot order')]
12
+ ['boot_order', _('Device names to specify the boot order')],
13
+ ['firmware', _('automatic/bios/uefi/uefi_secure_boot (UEFI with Secure Boot enabled)')]
13
14
  ]
14
15
  end
15
16
 
@@ -49,7 +50,9 @@ module HammerCLIForeman
49
50
  Fields::Field.new(:label => _('OS Type'), :path => [:os_type]),
50
51
  Fields::Field.new(:label => _('Domain Type'), :path => [:domain_type]),
51
52
  Fields::Field.new(:label => _('Persistent'), :path => [:persistent]),
52
- Fields::List.new(:label => _('Boot order'), :path => [:boot_order])
53
+ Fields::List.new(:label => _('Boot order'), :path => [:boot_order]),
54
+ Fields::Field.new(:label => _('Firmware'), :path => [:firmware]),
55
+ Fields::Field.new(:label => _('Secure Boot'), :path => [:secure_boot])
53
56
  ]
54
57
  end
55
58
 
@@ -16,7 +16,7 @@ module HammerCLIForeman
16
16
  ['memory_mb', _('Integer number, amount of memory in MB'), { bold: true }],
17
17
  ['path', _('Path to folder'), { bold: true }],
18
18
  ['resource_pool', _('Resource Pool ID from VMware'), { bold: true }],
19
- ['firmware', 'automatic/bios/efi'],
19
+ ['firmware', _('automatic/bios/uefi/uefi_secure_boot (UEFI with Secure Boot enabled)')],
20
20
  ['guest_id', _('Guest OS ID form VMware')],
21
21
  ['hardware_version', _('Hardware version ID from VMware')],
22
22
  ['memoryHotAddEnabled', _('Must be a 1 or 0, lets you add memory resources while the machine is on')],
@@ -26,10 +26,11 @@ module HammerCLIForeman
26
26
  ['scsi_controllers', [_('List with SCSI controllers definitions'),
27
27
  ' type - ' + _('ID of the controller type from VMware'),
28
28
  ' key - ' + _('Key of the controller (e.g. 1000)')].flatten(1).join("\n")],
29
- ['nvme_controllers', [_('List with NVME controllers definitions'),
30
- ' type - ' + _('ID of the controller type from VMware'),
31
- ' key - ' + _('Key of the controller (e.g. 2000)')].flatten(1).join("\n")],
32
- ['boot_order', _('Device names to specify the boot order')]
29
+ ['nvme_controllers', [_('List with NVME controllers definitions'),
30
+ ' type - ' + _('ID of the controller type from VMware'),
31
+ ' key - ' + _('Key of the controller (e.g. 2000)')].flatten(1).join("\n")],
32
+ ['boot_order', _('Device names to specify the boot order')],
33
+ ['virtual_tpm', _('Must be a 1 or 0, Enable virtual TPM. Only compatible with EFI firmware.')]
33
34
  ]
34
35
  end
35
36
 
@@ -84,7 +85,9 @@ module HammerCLIForeman
84
85
  Fields::Field.new(label: _('Path'), path: [:path]),
85
86
  Fields::Field.new(label: _('Operating System'), path: [:operatingsystem]),
86
87
  Fields::Field.new(label: _('Mac'), path: [:mac]),
87
- Fields::List.new(label: _('Boot order'), path: [:boot_order])
88
+ Fields::List.new(label: _('Boot order'), path: [:boot_order]),
89
+ Fields::Field.new(label: _('Virtual TPM'), path: [:virtual_tpm]),
90
+ Fields::Field.new(label: _('Secure Boot'), path: [:secure_boot])
88
91
  ]
89
92
  end
90
93
 
@@ -95,15 +95,17 @@ module HammerCLIForeman
95
95
 
96
96
  class ForemanOptionBuilder < HammerCLI::OptionBuilderContainer
97
97
 
98
- def initialize(searchables)
98
+ def initialize(searchables, action = nil)
99
99
  @searchables = searchables
100
+ @action = action
100
101
  end
101
102
 
102
103
  def build(builder_params={})
103
104
  expansion_options = builder_params[:expand] || {}
104
105
 
106
+ except_default = @action&.params&.select { |p| !p.show? }&.map { |p| HammerCLIForeman.param_to_resource(p.name).name } || []
105
107
  allowed_resources = expansion_options[:only] || default_dependent_resources
106
- allowed_resources -= expansion_options[:except] || []
108
+ allowed_resources -= expansion_options[:except] || except_default
107
109
  allowed_resources += expansion_options[:including] || []
108
110
  allowed_resources.uniq!
109
111
 
@@ -0,0 +1,27 @@
1
+ module HammerCLIForeman
2
+ class RegistrationTokens < HammerCLIForeman::Command
3
+ resource :registration_tokens
4
+ command_name 'registration-tokens'
5
+ desc _('Manage registration tokens')
6
+
7
+ class InvalidateMultipleCommand < HammerCLIForeman::DeleteCommand
8
+ action :invalidate_jwt_tokens
9
+ command_name 'invalidate-multiple'
10
+ success_message _('Successfully invalidated registration tokens for %{users}.')
11
+ failure_message _('Could not invalidate registration tokens')
12
+
13
+ build_options
14
+ end
15
+
16
+ class InvalidateCommand < HammerCLIForeman::DeleteCommand
17
+ action :invalidate_jwt
18
+ command_name 'invalidate'
19
+ success_message _('Successfully invalidated registration tokens for %{user}.')
20
+ failure_message _('Could not invalidate registration tokens')
21
+
22
+ build_options
23
+ end
24
+
25
+ autoload_subcommands
26
+ end
27
+ end
@@ -93,7 +93,8 @@ module HammerCLIForeman
93
93
  lazy_subcommand('table-preference', _("Managing table preferences"),
94
94
  'HammerCLIForeman::TablePreference', 'hammer_cli_foreman/table_preference'
95
95
  )
96
+ lazy_subcommand('registration-tokens', _("Managing registration tokens"),
97
+ 'HammerCLIForeman::RegistrationTokens', 'hammer_cli_foreman/registration_tokens')
96
98
  autoload_subcommands
97
99
  end
98
-
99
100
  end
@@ -1,5 +1,5 @@
1
1
  module HammerCLIForeman
2
2
  def self.version
3
- @version ||= Gem::Version.new "3.13.0"
3
+ @version ||= Gem::Version.new "3.14.0"
4
4
  end
5
5
  end