diff options
author | Jesse Wolfe <jes5199@gmail.com> | 2010-07-14 18:26:30 -0700 |
---|---|---|
committer | Markus Roberts <Markus@reality.com> | 2010-07-18 19:44:22 -0700 |
commit | cf597d72dca288011cfa3e57451b8eba56ea51da (patch) | |
tree | 4160b208bccafb1ecc1258bf1d35b80131fa0dd0 /lib/puppet | |
parent | d6cbb2198e06bb6b8f0172b1a48c9717c7ce6e17 (diff) | |
download | puppet-cf597d72dca288011cfa3e57451b8eba56ea51da.tar.gz puppet-cf597d72dca288011cfa3e57451b8eba56ea51da.tar.xz puppet-cf597d72dca288011cfa3e57451b8eba56ea51da.zip |
[#4233] Ruby regexps are not multiline by default, but Resource titles can be multiline
Puppet allows resource titles to contain newlines. We recently
introduced several regexps that were failing on resources with multiline
titles.
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/resource/catalog.rb | 2 | ||||
-rw-r--r-- | lib/puppet/type.rb | 2 | ||||
-rw-r--r-- | lib/puppet/type/file.rb | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/puppet/resource/catalog.rb b/lib/puppet/resource/catalog.rb index d163fc17e..4ac99eeea 100644 --- a/lib/puppet/resource/catalog.rb +++ b/lib/puppet/resource/catalog.rb @@ -57,7 +57,7 @@ class Puppet::Resource::Catalog < Puppet::SimpleGraph end def title_key_for_ref( ref ) - ref =~ /^(.+)\[(.*)\]/ + ref =~ /^(.+)\[(.*)\]/m [$1, $2] end diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index 5676b5d12..880711066 100644 --- a/lib/puppet/type.rb +++ b/lib/puppet/type.rb @@ -193,7 +193,7 @@ class Type when 0; [] when 1; identity = lambda {|x| x} - [ [ /(.*)/, [ [key_attributes.first, identity ] ] ] ] + [ [ /(.*)/m, [ [key_attributes.first, identity ] ] ] ] else raise Puppet::DevError,"you must specify title patterns when there are two or more key attributes" end diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb index 195e8c86f..71f2756bc 100644 --- a/lib/puppet/type/file.rb +++ b/lib/puppet/type/file.rb @@ -25,7 +25,7 @@ Puppet::Type.newtype(:file) do native resource to support what you are doing." def self.title_patterns - [ [ /^(.*?)\/?$/, [ [ :path, lambda{|x| x} ] ] ] ] + [ [ /^(.*?)\/*\Z/m, [ [ :path, lambda{|x| x} ] ] ] ] end newparam(:path) do |