As I understood it, the dynamic scoping changes were only about variable references, but you are right that the scope of resource defaults is a similar issue.
For your case, I would recommend just expressing alternative providers explicitly instead of by setting a resource default. If you want to do that without writing "package => 'pip'" on every package, then you could wrap it in a defined type. That would also have the advantages of being a bit clearer at the point where you declare pip packages, and of localizing the pip dependency better:
define pip_package ($ensure) {
require 'pip'
package { $name:
ensure => $ensure,
provider => 'pip'
}
}
class testtools::lettuce {
pip_package {
'lettuce': ensure => installed; 'lettuce-webdriver': ensure => installed;
}
}
May I say, however, that I
strongly recommend avoiding the use of multiple package providers whose scopes overlap. On systems that provide a built-in package manager (most systems these days), that implies using only the built-in manager. Instead of using alternative package providers, repackage software so that you can manage it via the native package manager. It's all about ensuring that the package manager has all the information it needs to do its job properly.
Exceptions can be made for systems, such as Windows, whose package
management is too rudimentary to be reliable anyway. (I'm talking about
the systems themselves, not Puppet's providers.)
John