hammer_cli_foreman_virt_who_configure 0.0.2 → 0.0.7
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 +5 -5
- data/lib/hammer_cli_foreman_virt_who_configure/config.rb +11 -4
- data/lib/hammer_cli_foreman_virt_who_configure/system_caller.rb +15 -3
- data/lib/hammer_cli_foreman_virt_who_configure/version.rb +1 -1
- data/locale/ca/LC_MESSAGES/hammer-cli-foreman-virt-who-configure.mo +0 -0
- data/locale/de/LC_MESSAGES/hammer-cli-foreman-virt-who-configure.mo +0 -0
- data/locale/en/LC_MESSAGES/hammer-cli-foreman-virt-who-configure.mo +0 -0
- data/locale/en_GB/LC_MESSAGES/hammer-cli-foreman-virt-who-configure.mo +0 -0
- data/locale/es/LC_MESSAGES/hammer-cli-foreman-virt-who-configure.mo +0 -0
- data/locale/fr/LC_MESSAGES/hammer-cli-foreman-virt-who-configure.mo +0 -0
- data/locale/it/LC_MESSAGES/hammer-cli-foreman-virt-who-configure.mo +0 -0
- data/locale/ja/LC_MESSAGES/hammer-cli-foreman-virt-who-configure.mo +0 -0
- data/locale/ko/LC_MESSAGES/hammer-cli-foreman-virt-who-configure.mo +0 -0
- data/locale/pt_BR/LC_MESSAGES/hammer-cli-foreman-virt-who-configure.mo +0 -0
- data/locale/ru/LC_MESSAGES/hammer-cli-foreman-virt-who-configure.mo +0 -0
- data/locale/zh_CN/LC_MESSAGES/hammer-cli-foreman-virt-who-configure.mo +0 -0
- data/locale/zh_TW/LC_MESSAGES/hammer-cli-foreman-virt-who-configure.mo +0 -0
- metadata +11 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 845377dff0db8f196099f05ed594c4bbdd4b33aa9f44dcd9fb42745e12e778d5
|
4
|
+
data.tar.gz: d3170a6efee5bed8b717986a0fc36d23a178f391357dcd01dbcb07ec56634a85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0c9a9013c306d41ecde2c2be58608b98a95d725d0d42e7aeff0d4656b951fa01916fc0183f74ea15f1fc70c6f3e4b1f6be916189eb7feaae5599d55e3317371
|
7
|
+
data.tar.gz: 51490292ea0e37bb750a2385b3780d69b124e68e269e1d21926f1243fd06a85cdba1ca89c94856809fe2e67680822f5080f5dd3a05f5a22601be85be956f0f86
|
@@ -69,7 +69,6 @@ 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 :hypervisor_password, _('Hypervisor password')
|
73
72
|
field :_status, _('Status')
|
74
73
|
end
|
75
74
|
label _('Schedule') do
|
@@ -82,9 +81,17 @@ module HammerCLIForemanVirtWhoConfigure
|
|
82
81
|
field :_filtering_mode, _('Filtering')
|
83
82
|
field :blacklist, _('Excluded hosts'), Fields::Field, :hide_blank => true
|
84
83
|
field :whitelist, _('Filtered hosts'), Fields::Field, :hide_blank => true
|
84
|
+
field :filter_host_parents, _('Filter host parents'), Fields::Field, :hide_blank => true
|
85
|
+
field :exclude_host_parents, _('Exclude host parents'), Fields::Field, :hide_blank => true
|
85
86
|
field :debug, _('Debug mode'), Fields::Boolean
|
86
|
-
field :
|
87
|
-
|
87
|
+
field :no_proxy, _('Ignore proxy'), Fields::Field, :hide_blank => true
|
88
|
+
end
|
89
|
+
label _('HTTP Proxy') do
|
90
|
+
from :http_proxy do
|
91
|
+
field :id, _('HTTP proxy ID'), Fields::Field, :hide_blank => true
|
92
|
+
field :name, _('HTTP proxy name'), Fields::Field, :hide_blank => true
|
93
|
+
field :url, _('HTTP proxy URL'), Fields::Field, :hide_blank => true
|
94
|
+
end
|
88
95
|
end
|
89
96
|
HammerCLIForeman::References.taxonomies(self)
|
90
97
|
end
|
@@ -116,7 +123,7 @@ module HammerCLIForemanVirtWhoConfigure
|
|
116
123
|
|
117
124
|
failure_message _('Could not fetch the Virt Who configuration')
|
118
125
|
|
119
|
-
option ['
|
126
|
+
option ['-o', '--output'], 'FILE', _('File where the script will be written')
|
120
127
|
|
121
128
|
def execute
|
122
129
|
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
|
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(
|
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
|
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
|
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.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomáš Strachota
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hammer_cli
|
@@ -76,9 +76,9 @@ files:
|
|
76
76
|
- test/functional/test_helper.rb
|
77
77
|
- test/test_helper.rb
|
78
78
|
- test/unit/system_caller_test.rb
|
79
|
-
homepage:
|
79
|
+
homepage: https://github.com/theforeman/hammer-cli-foreman-virt-who-configure
|
80
80
|
licenses:
|
81
|
-
- GPL
|
81
|
+
- GPL-3.0+
|
82
82
|
metadata: {}
|
83
83
|
post_install_message:
|
84
84
|
rdoc_options: []
|
@@ -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
|
-
|
99
|
-
rubygems_version: 2.5.1
|
98
|
+
rubygems_version: 3.1.4
|
100
99
|
signing_key:
|
101
100
|
specification_version: 4
|
102
101
|
summary: Plugin for configuring Virt Who
|
103
102
|
test_files:
|
104
|
-
- test/
|
105
|
-
- test/functional/config/config_create_test.rb
|
106
|
-
- test/functional/config/config_deploy_test.rb
|
107
|
-
- test/functional/config/config_list_test.rb
|
103
|
+
- test/functional/config/config_info_test.rb
|
108
104
|
- test/functional/config/config_update_test.rb
|
105
|
+
- test/functional/config/config_list_test.rb
|
106
|
+
- test/functional/config/config_deploy_test.rb
|
109
107
|
- test/functional/config/config_fetch_test.rb
|
110
|
-
- test/functional/config/
|
108
|
+
- test/functional/config/config_create_test.rb
|
111
109
|
- test/functional/test_helper.rb
|
112
|
-
- test/test_helper.rb
|
113
110
|
- test/unit/system_caller_test.rb
|
111
|
+
- test/test_helper.rb
|
112
|
+
- test/data/1.15/foreman_api.json
|