From 4950563c8d0eb1455feb4796474ebd7493865629 Mon Sep 17 00:00:00 2001 From: Arnaud Morin Date: Tue, 23 May 2017 11:12:37 +0200 Subject: [PATCH] Warn instead of fail with wrong type_driver Some of us are using custom type_drivers. Puppet code should allow unexpected values for type_drivers. Change-Id: I4a308ad379dee61260e3d27da2da00d7fce14e56 Signed-off-by: Arnaud Morin --- manifests/plugins/ml2/type_driver.pp | 2 +- spec/classes/neutron_plugins_ml2_spec.rb | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/manifests/plugins/ml2/type_driver.pp b/manifests/plugins/ml2/type_driver.pp index 78c085da7..b15869590 100644 --- a/manifests/plugins/ml2/type_driver.pp +++ b/manifests/plugins/ml2/type_driver.pp @@ -130,6 +130,6 @@ define neutron::plugins::ml2::type_driver ( } else { # detect an invalid type_drivers value - fail('type_driver unknown.') + warning('type_driver unknown.') } } diff --git a/spec/classes/neutron_plugins_ml2_spec.rb b/spec/classes/neutron_plugins_ml2_spec.rb index 4c0fbce22..c4278d565 100644 --- a/spec/classes/neutron_plugins_ml2_spec.rb +++ b/spec/classes/neutron_plugins_ml2_spec.rb @@ -154,10 +154,9 @@ describe 'neutron::plugins::ml2' do context 'configure ml2 with bad driver value' do before :each do + scope.expects(:warning).with('type_driver unknown.') params.merge!(:type_drivers => ['foobar']) end - - it_raises 'a Puppet::Error', /type_driver unknown./ end context 'when using flat driver' do