kafo_parsers 1.1.2 → 1.2.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/lib/kafo_parsers/puppet_strings_module_parser.rb +22 -2
- data/lib/kafo_parsers/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f510d851fccf71e96f9fd835195990a4e669fd5722592f1673823a4a651eeb77
|
4
|
+
data.tar.gz: e98e7f725fd65d900371fef825db343b25fedd70ac9aee21edaeeaef25ca7d98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdbe4e4c5ebab2e4e41f29209c4b84f8c595e7585f0deb1d8f94ae2c90519810874b76458a96acf98255de9721c3502cbbd97390829180caa125bcda0673778b
|
7
|
+
data.tar.gz: da851240e0bde3e0fe253b9c3e9e6953fb83e21eea8c15740f28df6065192b0d446c4dcc7825d0d8204ebcdfb4368c69238e0d978a3cf598d10115e21fd5485e
|
@@ -133,10 +133,30 @@ module KafoParsers
|
|
133
133
|
|
134
134
|
private
|
135
135
|
|
136
|
+
def self.search_puppet_path(bin_name)
|
137
|
+
# Find the location of the puppet executable and use that to
|
138
|
+
# determine the path of all executables
|
139
|
+
bin_path = (::ENV['PATH'].split(File::PATH_SEPARATOR) + ['/opt/puppetlabs/bin']).find do |path|
|
140
|
+
File.executable?(File.join(path, 'puppet')) && File.executable?(File.join(path, bin_name))
|
141
|
+
end
|
142
|
+
File.join([bin_path, bin_name].compact)
|
143
|
+
end
|
144
|
+
|
145
|
+
def self.is_aio_puppet?
|
146
|
+
puppet_command = search_puppet_path('puppet')
|
147
|
+
File.realpath(puppet_command).start_with?('/opt/puppetlabs')
|
148
|
+
rescue Errno::ENOENT
|
149
|
+
false
|
150
|
+
end
|
151
|
+
|
136
152
|
def self.run_puppet(command)
|
137
|
-
env_vars = self.puppet_bin.start_with?('/opt/puppetlabs') ? clean_env_vars : ::ENV
|
138
153
|
command = command.unshift(self.puppet_bin)
|
139
|
-
|
154
|
+
|
155
|
+
if is_aio_puppet?
|
156
|
+
Open3.capture3(clean_env_vars, *command, :unsetenv_others => true)
|
157
|
+
else
|
158
|
+
Open3.capture3(::ENV, *command, :unsetenv_others => false)
|
159
|
+
end
|
140
160
|
end
|
141
161
|
|
142
162
|
def self.clean_env_vars
|
data/lib/kafo_parsers/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kafo_parsers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marek Hulan
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -130,7 +130,7 @@ homepage: https://github.com/theforeman/kafo_parsers
|
|
130
130
|
licenses:
|
131
131
|
- GPL-3.0+
|
132
132
|
metadata: {}
|
133
|
-
post_install_message:
|
133
|
+
post_install_message:
|
134
134
|
rdoc_options: []
|
135
135
|
require_paths:
|
136
136
|
- lib
|
@@ -145,8 +145,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
- !ruby/object:Gem::Version
|
146
146
|
version: '0'
|
147
147
|
requirements: []
|
148
|
-
rubygems_version: 3.1.
|
149
|
-
signing_key:
|
148
|
+
rubygems_version: 3.1.4
|
149
|
+
signing_key:
|
150
150
|
specification_version: 4
|
151
151
|
summary: Puppet module parsers
|
152
152
|
test_files: []
|