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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b42685da91441b7bff1494b4be01e91ebfb9e5e291e1483c129fff536fd2c75c
4
- data.tar.gz: 3746ddb94008917e9394800a2c1553986128af574f68368865d509e0b9d60343
3
+ metadata.gz: 22a19451584961b6bc90d4e634da4b3c5002e92780d84a9e19d5eb9d720a2aaa
4
+ data.tar.gz: f3dae2f5c9d2648b886d126395797562358829de51fcc7dac13c166a8fa70b76
5
5
  SHA512:
6
- metadata.gz: 04dccda493638a6834d285edc4d79d4871181349ef9e57bfabe6ff8106bc2c371a1ab9ae76e052aca90c8cc1a3cdf76b7f6b3813f54931f9e3b363acfd3e94cf
7
- data.tar.gz: d60dd7a5fd14c6258a2a1c85612f3475e1b72081c0c1e9c6ca5cd3c777fd764caedacf18082abd0b2c5a5b863f78960e016f4086fc3e3b1ae3e23bf2a1f3b905
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
@@ -1,7 +1,8 @@
1
1
  # Puppet Debugger Changelog
2
2
 
3
3
  ## Unreleased
4
-
4
+ ## 1.2
5
+ - Fix puppetdb_query errors when bolt_pdb_client was not loaded
5
6
  ## 1.1
6
7
  - Catch signals and allow control-d for quitting.
7
8
  ## 1.0
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'] || '>= 5.5'
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, loaders: scope.compiler.loaders }, 'For puppet-debugger') do
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PuppetDebugger
4
- VERSION = '1.1.0'
4
+ VERSION = '1.2.0'
5
5
  end
@@ -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.1.0
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-07 00:00:00.000000000 Z
11
+ date: 2021-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print