From d9b787ae0853b36807bf3890d03cab19f142beb1 Mon Sep 17 00:00:00 2001 From: Paula McMaw Date: Wed, 22 Nov 2017 11:13:02 +0000 Subject: [PATCH] Adding in else additional else statement --- lib/puppet/parser/functions/min.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/puppet/parser/functions/min.rb b/lib/puppet/parser/functions/min.rb index a2ec99f44..712902dc3 100644 --- a/lib/puppet/parser/functions/min.rb +++ b/lib/puppet/parser/functions/min.rb @@ -13,8 +13,11 @@ module Puppet::Parser::Functions # Sometimes we get numbers as numerics and sometimes as strings. # We try to compare them as numbers when possible return args.min do |a, b| - a.to_f <=> b.to_f if a.to_s =~ %r{\A^-?\d+(.\d+)?\z} && b.to_s =~ %r{\A-?\d+(.\d+)?\z} - a.to_s <=> b.to_s + if a.to_s =~ %r{\A^-?\d+(.\d+)?\z} && b.to_s =~ %r{\A-?\d+(.\d+)?\z} + a.to_f <=> b.to_f + else + a.to_s <=> b.to_s + end end end end