Yuvipanda has submitted this change and it was merged.

Change subject: ipresolve: Make passing in type of record optional
......................................................................


ipresolve: Make passing in type of record optional

Defaults to ipv4 because that's what we mean 99% of the time
in our current infrastructure

Change-Id: I028acd562860794178d7d7199bbdbb3651b2140e
---
M modules/wmflib/lib/puppet/parser/functions/ipresolve.rb
1 file changed, 6 insertions(+), 2 deletions(-)

Approvals:
  Yuvipanda: Looks good to me, approved
  Giuseppe Lavagetto: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/modules/wmflib/lib/puppet/parser/functions/ipresolve.rb 
b/modules/wmflib/lib/puppet/parser/functions/ipresolve.rb
index 400eb83..f7ae35f 100644
--- a/modules/wmflib/lib/puppet/parser/functions/ipresolve.rb
+++ b/modules/wmflib/lib/puppet/parser/functions/ipresolve.rb
@@ -108,9 +108,13 @@
 
 module Puppet::Parser::Functions
   dns = DNSCached.new
-  newfunction(:ipresolve, :type => :rvalue, :arity => -2) do |args|
+  newfunction(:ipresolve, :type => :rvalue, :arity => -1) do |args|
     name = args[0]
-    type = args[1].to_i
+    if args[1].nil?
+        type = 4
+    else
+        type = args[1].to_i
+    end
     if type == 4
       source = Resolv::DNS::Resource::IN::A
     elsif type == 6

-- 
To view, visit https://gerrit.wikimedia.org/r/215884
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I028acd562860794178d7d7199bbdbb3651b2140e
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to