summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Fields <travis@puppetlabs.com>2014-10-24 14:30:01 -0700
committerTravis Fields <travis@puppetlabs.com>2014-10-24 14:30:01 -0700
commitf0b207c03587f5c92915f86051dc139b939c53c0 (patch)
tree9e75a36b80885e255b1aa9dc5cb93de962bda3a8
parent0c0f7e13cdb407ca57d2808de9e6dc6ace9d856b (diff)
parentcb6c7d8e49cdd392dfa55c27cf78795125163c70 (diff)
Merge branch '4.3.x'
Conflicts: README.markdown lib/puppet/parser/functions/has_interface_with.rb
-rw-r--r--CHANGELOG.md6
-rw-r--r--lib/puppet/parser/functions/has_interface_with.rb1
-rw-r--r--lib/puppet/provider/file_line/ruby.rb10
-rw-r--r--metadata.json2
4 files changed, 14 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0a63ec6..fb5fd7f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,9 @@
+##2014-07-15 - Supported Release 4.3.2
+###Summary
+
+This release merely updates metadata.json so the module can be uninstalled and
+upgraded via the puppet module command.
+
##2014-07-14 - Supported Release 4.3.1
### Summary
This supported release updates the metadata.json to work around upgrade behavior of the PMT.
diff --git a/lib/puppet/parser/functions/has_interface_with.rb b/lib/puppet/parser/functions/has_interface_with.rb
index 10ad542..00e405d 100644
--- a/lib/puppet/parser/functions/has_interface_with.rb
+++ b/lib/puppet/parser/functions/has_interface_with.rb
@@ -41,6 +41,7 @@ has_interface_with("lo") => true
result = false
interfaces.each do |iface|
+ iface.downcase!
factval = nil
begin
factval = lookupvar("#{kind}_#{iface}")
diff --git a/lib/puppet/provider/file_line/ruby.rb b/lib/puppet/provider/file_line/ruby.rb
index 94e7fac..ae1a8b3 100644
--- a/lib/puppet/provider/file_line/ruby.rb
+++ b/lib/puppet/provider/file_line/ruby.rb
@@ -34,7 +34,7 @@ Puppet::Type.type(:file_line).provide(:ruby) do
def handle_create_with_match()
regex = resource[:match] ? Regexp.new(resource[:match]) : nil
- match_count = lines.select { |l| regex.match(l) }.size
+ match_count = count_matches(regex)
if match_count > 1 && resource[:multiple].to_s != 'true'
raise Puppet::Error, "More than one line in file '#{resource[:path]}' matches pattern '#{resource[:match]}'"
end
@@ -51,9 +51,7 @@ Puppet::Type.type(:file_line).provide(:ruby) do
def handle_create_with_after
regex = Regexp.new(resource[:after])
-
- count = lines.count {|l| l.match(regex)}
-
+ count = count_matches(regex)
case count
when 1 # find the line to put our line after
File.open(resource[:path], 'w') do |fh|
@@ -71,6 +69,10 @@ Puppet::Type.type(:file_line).provide(:ruby) do
end
end
+ def count_matches(regex)
+ lines.select{|l| l.match(regex)}.size
+ end
+
##
# append the line to the file.
#
diff --git a/metadata.json b/metadata.json
index bce75e0..26167b6 100644
--- a/metadata.json
+++ b/metadata.json
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-stdlib",
- "version": "4.3.1",
+ "version": "4.3.2",
"author": "puppetlabs",
"summary": "Puppet Module Standard Library",
"license": "Apache 2.0",