Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 02c222d

Browse files
committed
Set up the dummy provider as the default on chefspec.
1 parent 09ab02c commit 02c222d

File tree

6 files changed

+15
-1
lines changed

6 files changed

+15
-1
lines changed

lib/poise_python/python_providers.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ module PythonProviders
3131
autoload :Base, 'poise_python/python_providers/base'
3232

3333
Chef::Platform::ProviderPriorityMap.instance.priority(:python_runtime, [
34+
PoisePython::PythonProviders::Dummy,
3435
PoisePython::PythonProviders::PortablePyPy3,
3536
PoisePython::PythonProviders::PortablePyPy,
3637
PoisePython::PythonProviders::Scl,

lib/poise_python/python_providers/dummy.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,18 @@ module PythonProviders
2727
class Dummy < Base
2828
provides(:dummy)
2929

30+
# Enable by default on ChefSpec.
31+
#
32+
# @api private
33+
def self.provides_auto?(node, _resource)
34+
node.platform?('chefspec')
35+
end
36+
37+
# Manual overrides for dummy data.
38+
#
39+
# @api private
3040
def self.default_inversion_options(node, resource)
3141
super.merge({
32-
# Manual overrides for dummy data.
3342
python_binary: ::File.join('', 'python'),
3443
python_environment: nil,
3544
})

test/spec/python_providers/portable_pypy3_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
step_into(:python_runtime)
2525
recipe do
2626
python_runtime 'test' do
27+
provider_no_auto 'dummy'
2728
version node['poise_python_version']
2829
virtualenv_version false
2930
end

test/spec/python_providers/portable_pypy_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
step_into(:python_runtime)
2525
recipe do
2626
python_runtime 'test' do
27+
provider_no_auto 'dummy'
2728
version node['poise_python_version']
2829
virtualenv_version false
2930
end

test/spec/python_providers/scl_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
step_into(:python_runtime)
2525
recipe do
2626
python_runtime 'test' do
27+
provider_no_auto 'dummy'
2728
version node['poise_python_version']
2829
virtualenv_version false
2930
end

test/spec/python_providers/system_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
step_into(:python_runtime)
2626
recipe do
2727
python_runtime 'test' do
28+
provider_no_auto 'dummy'
2829
version node['poise_python_version']
2930
virtualenv_version false
3031
end

0 commit comments

Comments
 (0)