nwops / puppet-debugger

A interactive live debugger and REPL for the puppet language
https://gitlab.com/puppet-debugger/puppet-debugger
MIT License
121 stars 11 forks source link

Fix bolt plan failures #74

Closed op-ct closed 1 year ago

op-ct commented 1 year ago

Starting with Bolt 3.23.0, running a plan with debug::break() fails after entering any DSL expression with an error like undefined method load_config' for Bolt::PuppetDB::Config:Class . This happens because puppetlabs/bolt#3092 changed the internal API of Bolt::PuppetDB::Config, including dropping load_config and changing constructor parameters .

This patch fixes the problem by updating the code to use the new API, too. If the load_config method is available, it will initialize the PuppetDB client the old way and preserve backward-compatibility with Bolt < 3.23.

The constraints fix from #73 is included to allow Bolt plans using puppet-debugger to run without failing on gem conflicts.