puppet-debugger 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +2 -0
- data/CHANGELOG.md +2 -1
- data/Gemfile +3 -2
- data/lib/puppet-debugger/support.rb +18 -2
- data/lib/puppet-debugger/version.rb +1 -1
- data/puppet-debugger.gemspec +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22a19451584961b6bc90d4e634da4b3c5002e92780d84a9e19d5eb9d720a2aaa
|
4
|
+
data.tar.gz: f3dae2f5c9d2648b886d126395797562358829de51fcc7dac13c166a8fa70b76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88c59044e15d8209a21ce58fb4491bc267e7146dfa32fc3f3ee18f4ad7c81dd7a9969fd04208b85bd4be169cd7a1c67b26de96f0e65cdf6df3b355945621fff8
|
7
|
+
data.tar.gz: 75ca9baae2f01da4696b57dd7c28aad61fe251a2dcdf9909c2a4d3ed4e254fcd6ee3b64624d3b78c4b7660a6b1b303cdda92c9d23380a3349d6bf2139a1bd722
|
data/.gitlab-ci.yml
CHANGED
@@ -11,6 +11,7 @@ stages:
|
|
11
11
|
.puppet_def: &puppet_job_def
|
12
12
|
stage: test
|
13
13
|
script:
|
14
|
+
- rm -f Gemfile.lock
|
14
15
|
- gem update --system > /dev/null
|
15
16
|
- gem install bundler > /dev/null
|
16
17
|
- bundle install --without development validate
|
@@ -36,6 +37,7 @@ rubocop_ruby:
|
|
36
37
|
tags:
|
37
38
|
- ruby
|
38
39
|
script:
|
40
|
+
- rm -f Gemfile.lock
|
39
41
|
- bundle install
|
40
42
|
- bundle exec rubocop -D
|
41
43
|
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -4,14 +4,15 @@ source 'http://rubygems.org'
|
|
4
4
|
gem 'awesome_print', '~> 1.7'
|
5
5
|
gem 'facterdb', '>= 0.5.0'
|
6
6
|
gem 'pluginator', '~> 1.5.0'
|
7
|
-
gem 'puppet', ENV['PUPPET_GEM_VERSION'] || '
|
7
|
+
gem 'puppet', ENV['PUPPET_GEM_VERSION'] || '~> 5.5'
|
8
8
|
gem 'rb-readline'
|
9
9
|
gem 'table_print'
|
10
10
|
gem 'tty-pager'
|
11
|
+
#gem 'bolt' if Gem::Version(ENV['PUPPET_GEM_VERSION'])
|
12
|
+
|
11
13
|
group :test, :development do
|
12
14
|
# ruby versions prior to 2.0 cannot install json_pure 2.0.2+
|
13
15
|
gem 'bundler'
|
14
|
-
gem 'CFPropertyList'
|
15
16
|
gem 'pry'
|
16
17
|
gem 'puppet-debugger', path: './'
|
17
18
|
gem 'rake', '~> 13.0'
|
@@ -142,6 +142,22 @@ module PuppetDebugger
|
|
142
142
|
file
|
143
143
|
end
|
144
144
|
|
145
|
+
# @return [Bolt::PuppetDB::Client]
|
146
|
+
def bolt_pdb_client
|
147
|
+
@bolt_pdb_client ||=
|
148
|
+
begin
|
149
|
+
require 'bolt/logger'
|
150
|
+
require 'bolt/puppetdb'
|
151
|
+
require 'bolt/puppetdb/client'
|
152
|
+
require 'bolt/puppetdb/config'
|
153
|
+
config = Bolt::PuppetDB::Config.load_config({})
|
154
|
+
Bolt::PuppetDB::Client.new(config)
|
155
|
+
rescue LoadError
|
156
|
+
# not puppet 6+
|
157
|
+
nil
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
145
161
|
# @param String - any valid puppet language code
|
146
162
|
# @return Object - returns either a string of the result or object from puppet evaulation
|
147
163
|
def puppet_eval(input, file: nil)
|
@@ -151,9 +167,9 @@ module PuppetDebugger
|
|
151
167
|
manifest_file = file || manifest_file(input)
|
152
168
|
manfifest_content = input || File.read(manifest_file)
|
153
169
|
ast = generate_ast(manfifest_content)
|
154
|
-
|
155
170
|
Puppet.override({ current_environment: puppet_environment, manifest: manifest_file,
|
156
|
-
global_scope: scope,
|
171
|
+
global_scope: scope, bolt_pdb_client: bolt_pdb_client,
|
172
|
+
loaders: scope.compiler.loaders }, 'For puppet-debugger') do
|
157
173
|
# because the debugger is not a module we leave the modname blank
|
158
174
|
scope.environment.known_resource_types.import_ast(ast, '')
|
159
175
|
|
data/puppet-debugger.gemspec
CHANGED
@@ -37,6 +37,7 @@ Gem::Specification.new do |s|
|
|
37
37
|
s.add_runtime_dependency('facterdb', ['>= 0.4.0'])
|
38
38
|
s.add_runtime_dependency('pluginator', ['~> 1.5.0'])
|
39
39
|
s.add_runtime_dependency('puppet', ['>= 5.5'])
|
40
|
+
# s.add_runtime_dependency('bolt', ['>= 2.42.0'])
|
40
41
|
s.add_runtime_dependency('rb-readline', ['>= 0.5.5'])
|
41
42
|
s.add_runtime_dependency('table_print', ['>= 1.0.0'])
|
42
43
|
s.add_runtime_dependency('tty-pager', ['~> 0.13.0'])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-debugger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Corey Osman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|