diff --git a/lib/puppet/type/vs_bridge.rb b/lib/puppet/type/vs_bridge.rb index c5a5e7ca..cbcce902 100644 --- a/lib/puppet/type/vs_bridge.rb +++ b/lib/puppet/type/vs_bridge.rb @@ -22,7 +22,7 @@ if !value.is_a?(String) raise ArgumentError, "Invalid external_ids #{value}. Requires a String, not a #{value.class}" end - if value !~ /^(?>[a-zA-Z]\w*=\w*){1}(?>[,][a-zA-Z]\w*=\w*)*$/ + if value !~ /^(?>[a-zA-Z]\S*=\S*){1}(?>[,][a-zA-Z]\S*=\S*)*$/ raise ArgumentError, "Invalid external_ids #{value}. Must a list of key1=value2,key2=value2" end end diff --git a/spec/unit/puppet/lib/type/vs_bridge_spec.rb b/spec/unit/puppet/lib/type/vs_bridge_spec.rb new file mode 100644 index 00000000..4b88b317 --- /dev/null +++ b/spec/unit/puppet/lib/type/vs_bridge_spec.rb @@ -0,0 +1,11 @@ +require 'spec_helper' + +describe Puppet::Type.type(:vs_bridge) do + + it "should support present as a value for ensure" do + expect do + described_class.new(:name => 'foo', :ensure => :present, :external_ids => 'foo=br-ex,blah-id=bar)') + end.to_not raise_error + end + +end