foreman_virt_who_configure 0.5.8 → 0.5.10

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: 4530753c078a8fb15731435042afcbc985207fe160b96d242e04ecfc9d2078f2
4
- data.tar.gz: 8013fca41321555482fe77a5203d7558b7828cfe7989208c4121686aa8c5dc2f
3
+ metadata.gz: 5653482998c6baa64d6021ec87387001da5da84b27b4765d468f7c94fb35904f
4
+ data.tar.gz: d0ac12b92107e1ad9ddf14b6addfebe7126914c99620e726188f8edad3593bb0
5
5
  SHA512:
6
- metadata.gz: 45f214c29a0c4e76fb92834bb6f5a124fbac03788e5e235da28dfe798be08d7a36c121d50e7e135bc5fb78a93ba6616784965e76ec6a1ea46949207c0c99e706
7
- data.tar.gz: 3f66cb56f3efa3e59c016e40d22ff0f9aeff357be3901f2c7937e3eeef98bfb802d7ae762ec83f40030dc4211b2f6c81c134127d548b9dc8162f9a50016e04bf
6
+ metadata.gz: ac40fb2c37aae92d55a166fb0b9a58e566970b4645717bacff12f275a579610b5eb0bd3e5107da5d4c0e01fc3c4a43471d87e6dbcff7abcb614a8cba2d552195
7
+ data.tar.gz: f34fd874e90719178f61299c83022b608c5b35167f72f77f78910dae0004afeb7d8dde9ebcee6c1acecb5ac86f840637071ac67378d907b73fcd6769712b7d7e
@@ -139,9 +139,7 @@ module ForemanVirtWhoConfigure
139
139
  end
140
140
 
141
141
  def validates_hypervisor_options
142
- invalid = hypervisor_type == 'kubevirt' ? KUBEVIRT_INVALID_OPTIONS : KUBEVIRT_VALID_OPTIONS
143
- invalid.concat(AHV_VALID_OPTIONS) unless hypervisor_type == 'ahv'
144
- invalid.each { |f| errors.add(f, "Invalid option for hypervisor [#{hypervisor_type}]") if eval(f).present? }
142
+ invalid_fields.each { |f| errors.add(f, "Invalid option for hypervisor [#{hypervisor_type}]") if eval(f).present? }
145
143
  end
146
144
 
147
145
  validates_lengths_from_database
@@ -276,5 +274,16 @@ module ForemanVirtWhoConfigure
276
274
  def remove_whitespaces
277
275
  satellite_url.strip! if satellite_url.present?
278
276
  end
277
+
278
+ def invalid_fields
279
+ case hypervisor_type
280
+ when 'kubevirt'
281
+ KUBEVIRT_INVALID_OPTIONS + AHV_VALID_OPTIONS
282
+ when 'ahv'
283
+ KUBEVIRT_VALID_OPTIONS
284
+ else
285
+ KUBEVIRT_VALID_OPTIONS + AHV_VALID_OPTIONS
286
+ end
287
+ end
279
288
  end
280
289
  end
@@ -51,6 +51,7 @@ module ForemanVirtWhoConfigure
51
51
  def virt_who_output(format = nil)
52
52
  kubeconfig = config.hypervisor_type == 'kubevirt' ? "\nkubeconfig=#{config.kubeconfig_path}" : ''
53
53
  result = ''
54
+ cr_password_base64 = Base64.strict_encode64("#{cr_password}")
54
55
  result += "#!/bin/bash\n" if format == :bash_script
55
56
  result += <<EOS
56
57
  heading() {
@@ -105,8 +106,8 @@ install_virt_who
105
106
 
106
107
  if verify_minimal_version; then
107
108
  step 2 "Encrypting password"
108
- cr_password=`virt-who-password --password '#{cr_password}' 2> /dev/null`
109
- user_password=`virt-who-password --password '#{service_user_password}' 2> /dev/null`
109
+ cr_password=$(virt-who-password --password $(echo #{cr_password_base64}|base64 -d) 2> /dev/null)
110
+ user_password=$(virt-who-password --password '#{service_user_password}' 2> /dev/null)
110
111
 
111
112
  step 3 "Creating virt-who configuration"
112
113
  cat > #{config_file_path} << EOF
@@ -116,7 +117,7 @@ if verify_minimal_version; then
116
117
  type=#{type}
117
118
  hypervisor_id=#{hypervisor_id}
118
119
  owner=#{owner}
119
- env=Library#{connection_details}#{filtering}
120
+ #{connection_details}#{filtering}
120
121
  rhsm_hostname=#{satellite_url}
121
122
  rhsm_username=#{service_user_username}
122
123
  rhsm_encrypted_password=$user_password
@@ -13,9 +13,9 @@
13
13
 
14
14
  <%= textarea_f f, :blacklist, inline_help_popover(_('Hosts which uuid (or hostname or hwuuid, based on <code>hypervisor_id</code>) is specified in comma-separated list in this option will <b>NOT</b> be reported. Wildcards and regular expressions are supported, multiple records must be separated by comma. Put the value into the double-quotes if it contains special characters like comma. All new line characters will be removed in resulting configuration file, white spaces are removed from beginning and end.')).merge(:label => _('Exclude hosts')) %>
15
15
 
16
- <%= textarea_f f, :filter_host_parents, inline_help_popover(_('Only hosts which parent (usually ComputeResource) name is specified in comma-separated list in this option will be reported. Wildcards and regular expressions are supported, multiple records must be separated by comma. Put the value into the double-quotes if it contains special characters like comma. All new line characters will be removed in resulting configuration file, white spaces are removed from beginning and end.')).merge(:label => _('Filter host parents')) %>
16
+ <%= textarea_f f, :filter_host_parents, inline_help_popover(_('Only hosts which cluster ID is specified in comma-separated list in this option will be reported. PowerCLI command to find the domain names in VMware <code>Get-Cluster “ClusterName” | Select ID</code>. Wildcards and regular expressions are supported, multiple records must be separated by comma. Put the value into the double-quotes if it contains special characters like comma. All new line characters will be removed in resulting configuration file, white spaces are removed from beginning and end.')).merge(:label => _('Filter host parents')) %>
17
17
 
18
- <%= textarea_f f, :exclude_host_parents, inline_help_popover(_('Hosts which parent (usually ComputeResource) name is specified in comma-separated list in this option will <b>NOT</b> be reported. Wildcards and regular expressions are supported, multiple records must be separated by comma. Put the value into the double-quotes if it contains special characters like comma. All new line characters will be removed in resulting configuration file, white spaces are removed from beginning and end.')).merge(:label => _('Exclude host parents')) %>
18
+ <%= textarea_f f, :exclude_host_parents, inline_help_popover(_('Exclude hosts which cluster ID is specified in comma-separated list in this option will <b>NOT</b> be reported. PowerCLI command to find the domain names in VMware <code>Get-Cluster “ClusterName” | Select ID</code>. Wildcards and regular expressions are supported, multiple records must be separated by comma. Put the value into the double-quotes if it contains special characters like comma. All new line characters will be removed in resulting configuration file, white spaces are removed from beginning and end.')).merge(:label => _('Exclude host parents')) %>
19
19
 
20
20
  <%= checkbox_f f, :debug, { :label => _('Enable debugging output') }.merge(inline_help_popover(_("Different debug value can't be set per hypervisor, therefore it will affect all other deployed configurations on the host on which this configuration will be deployed."))) %>
21
21
  <%= select_f f, :http_proxy_id, HttpProxy.all, :id, :full_url, {:include_blank => true}, { :label => _('HTTP Proxy') }.merge(
@@ -1,3 +1,3 @@
1
1
  module ForemanVirtWhoConfigure
2
- VERSION = '0.5.8'.freeze
2
+ VERSION = '0.5.10'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_virt_who_configure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.8
4
+ version: 0.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman virt-who-configure team
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-10 00:00:00.000000000 Z
11
+ date: 2022-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: katello
@@ -166,7 +166,7 @@ homepage: https://github.com/theforeman/foreman_virt_who_configure
166
166
  licenses:
167
167
  - GPLv3
168
168
  metadata: {}
169
- post_install_message:
169
+ post_install_message:
170
170
  rdoc_options: []
171
171
  require_paths:
172
172
  - lib
@@ -182,13 +182,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
182
  version: '0'
183
183
  requirements: []
184
184
  rubygems_version: 3.1.6
185
- signing_key:
185
+ signing_key:
186
186
  specification_version: 4
187
187
  summary: A plugin to make virt-who configuration easy
188
188
  test_files:
189
189
  - test/factories/foreman_virt_who_configure_factories.rb
190
190
  - test/functional/api/v2/configs_controller_test.rb
191
- - test/unit/migrate_config_proxy_to_http_proxy.rb
191
+ - test/test_plugin_helper.rb
192
192
  - test/unit/config_test.rb
193
+ - test/unit/migrate_config_proxy_to_http_proxy.rb
193
194
  - test/unit/output_generator_test.rb
194
- - test/test_plugin_helper.rb