hammer_cli_foreman_virt_who_configure 0.0.3 → 0.0.8

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
- SHA1:
3
- metadata.gz: 675556beb3ecffcdfb25c8c8abf9e24764d8188a
4
- data.tar.gz: 239382fee77faec05ff165595755fdfebc09b56d
2
+ SHA256:
3
+ metadata.gz: f7c96871810cee34bc4e5b2ac7ff1b15edf614dbc2619b8b07b65cd1b56370a5
4
+ data.tar.gz: 12687b71a396b7c7293c71f4d1c675bd77ba60a90dd84fb6ac42a4b180da2b1c
5
5
  SHA512:
6
- metadata.gz: 3c6191c3affd8ffa95480173af1eda0d263d8e3a2ed0c484b644061e01bb425833f913a95987830d0451529e3525223facd253f8d6dbae044ff241635b6ef74a
7
- data.tar.gz: 7fdfef029cc203601eed1461daea717172c1dc1dda4e3b72002827d467a23d3fe8bf9fa8c24c5322326325ff06d5795046794041324cc30cc2803ae63a73f052
6
+ metadata.gz: 24848ae6e6b22fe1ac9d6e20660d0bc7ff59825772bf9d8ed391d8ef4c68a0278e688db91f1a5497df449b9056016e0359a5af5bb6c66840be23a36e99e6d315
7
+ data.tar.gz: e26889b6dabf00f5659ce741b6351d8f003d26de15102adde7e554d8cea5eae00197fee6e3b65035a5791c43e369b3b3d43bf176e2f849a0784909ca4958783c
@@ -69,6 +69,7 @@ module HammerCLIForemanVirtWhoConfigure
69
69
  field :hypervisor_type, _('Hypervisor type')
70
70
  field :hypervisor_server, _('Hypervisor server')
71
71
  field :hypervisor_username, _('Hypervisor username')
72
+ field :kubeconfig_path, _('Configuration file'), Fields::Field, :hide_blank => true
72
73
  field :_status, _('Status')
73
74
  end
74
75
  label _('Schedule') do
@@ -81,9 +82,17 @@ module HammerCLIForemanVirtWhoConfigure
81
82
  field :_filtering_mode, _('Filtering')
82
83
  field :blacklist, _('Excluded hosts'), Fields::Field, :hide_blank => true
83
84
  field :whitelist, _('Filtered hosts'), Fields::Field, :hide_blank => true
85
+ field :filter_host_parents, _('Filter host parents'), Fields::Field, :hide_blank => true
86
+ field :exclude_host_parents, _('Exclude host parents'), Fields::Field, :hide_blank => true
84
87
  field :debug, _('Debug mode'), Fields::Boolean
85
- field :proxy, _('HTTP proxy')
86
- field :no_proxy, _('Ignore proxy')
88
+ field :no_proxy, _('Ignore proxy'), Fields::Field, :hide_blank => true
89
+ end
90
+ label _('HTTP Proxy') do
91
+ from :http_proxy do
92
+ field :id, _('HTTP proxy ID'), Fields::Field, :hide_blank => true
93
+ field :name, _('HTTP proxy name'), Fields::Field, :hide_blank => true
94
+ field :url, _('HTTP proxy URL'), Fields::Field, :hide_blank => true
95
+ end
87
96
  end
88
97
  HammerCLIForeman::References.taxonomies(self)
89
98
  end
@@ -115,7 +124,7 @@ module HammerCLIForemanVirtWhoConfigure
115
124
 
116
125
  failure_message _('Could not fetch the Virt Who configuration')
117
126
 
118
- option ['--output', '-o'], 'FILE', _('File where the script will be written.')
127
+ option ['-o', '--output'], 'FILE', _('File where the script will be written')
119
128
 
120
129
  def execute
121
130
  data = send_request
@@ -1,15 +1,27 @@
1
1
  module HammerCLIForemanVirtWhoConfigure
2
2
  class SystemCaller
3
+ WHITELISTED_VARS = %w[HOME USER LANG].freeze
4
+
3
5
  def initialize(tempfile = nil)
4
6
  @tempfile = tempfile || Tempfile.new('virt_who')
5
7
  end
6
8
 
7
- def system(commad)
9
+ def clean_env_vars
10
+ # Cleaning ENV vars and keeping required vars only because,
11
+ # When using SCL it adds GEM_HOME and GEM_PATH ENV vars.
12
+ # These vars break foreman-maintain tool.
13
+ # This way we use system ruby to execute the bash script.
14
+ cleaned_env = ENV.select { |var| WHITELISTED_VARS.include?(var) || var.start_with?('LC_') }
15
+ cleaned_env['PATH'] = '/sbin:/bin:/usr/sbin:/usr/bin'
16
+ cleaned_env
17
+ end
18
+
19
+ def system(command)
8
20
  result = nil
9
21
  begin
10
- @tempfile.write(commad)
22
+ @tempfile.write(command)
11
23
  @tempfile.flush # to make sure the command is complete
12
- result = Kernel.system("/usr/bin/bash #{@tempfile.path}")
24
+ result = Kernel.system(clean_env_vars, "/usr/bin/bash #{@tempfile.path}", unsetenv_others: true)
13
25
  ensure
14
26
  @tempfile.close
15
27
  @tempfile.unlink
@@ -1,5 +1,5 @@
1
1
  module HammerCLIForemanVirtWhoConfigure
2
2
  def self.version
3
- @version ||= Gem::Version.new '0.0.3'
3
+ @version ||= Gem::Version.new '0.0.8'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hammer_cli_foreman_virt_who_configure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomáš Strachota
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-20 00:00:00.000000000 Z
11
+ date: 2021-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hammer_cli
@@ -76,11 +76,11 @@ files:
76
76
  - test/functional/test_helper.rb
77
77
  - test/test_helper.rb
78
78
  - test/unit/system_caller_test.rb
79
- homepage: http://github.com/theforeman/hammer-cli-foreman-virt-who-configure
79
+ homepage: https://github.com/theforeman/hammer-cli-foreman-virt-who-configure
80
80
  licenses:
81
- - GPL v3+
81
+ - GPL-3.0+
82
82
  metadata: {}
83
- post_install_message:
83
+ post_install_message:
84
84
  rdoc_options: []
85
85
  require_paths:
86
86
  - lib
@@ -95,19 +95,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  requirements: []
98
- rubyforge_project:
99
- rubygems_version: 2.5.1
100
- signing_key:
98
+ rubygems_version: 3.1.6
99
+ signing_key:
101
100
  specification_version: 4
102
101
  summary: Plugin for configuring Virt Who
103
102
  test_files:
104
- - test/data/1.15/foreman_api.json
103
+ - test/functional/test_helper.rb
105
104
  - test/functional/config/config_create_test.rb
106
105
  - test/functional/config/config_deploy_test.rb
107
106
  - test/functional/config/config_list_test.rb
108
- - test/functional/config/config_update_test.rb
109
107
  - test/functional/config/config_fetch_test.rb
110
108
  - test/functional/config/config_info_test.rb
111
- - test/functional/test_helper.rb
112
- - test/test_helper.rb
109
+ - test/functional/config/config_update_test.rb
113
110
  - test/unit/system_caller_test.rb
111
+ - test/data/1.15/foreman_api.json
112
+ - test/test_helper.rb