Faidon Liambotis has submitted this change and it was merged. Change subject: librenms: minor fixes to phpdump ......................................................................
librenms: minor fixes to phpdump Handle integers properly, NULL & strings with embedded quotes. Borrowed from Ori's equivalent code that was developed before this but was never imported into this repo. Change-Id: I36dfd0f082ed48f62c537283ed24017f1ac8ada1 --- M modules/librenms/lib/puppet/parser/functions/phpdump.rb 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: Ori.livneh: Looks good to me, but someone else must approve Faidon Liambotis: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/librenms/lib/puppet/parser/functions/phpdump.rb b/modules/librenms/lib/puppet/parser/functions/phpdump.rb index 205f8ce..0c094b5 100644 --- a/modules/librenms/lib/puppet/parser/functions/phpdump.rb +++ b/modules/librenms/lib/puppet/parser/functions/phpdump.rb @@ -11,7 +11,7 @@ contents = '' o.sort.each do |k, v| contents += indent*level - contents += "\"#{k}\" => " + phpdump(v, level+1) + contents += k.to_pson + " => " + phpdump(v, level+1) contents += ",\n" end "array(\n" + contents + indent*(level-1) + ")" @@ -21,8 +21,10 @@ "TRUE" when FalseClass "FALSE" + when nil + "NULL" else - '"' + o.to_s + '"' + o.include?('.') ? Float(o).to_s : Integer(o).to_s rescue o.to_pson end end -- To view, visit https://gerrit.wikimedia.org/r/106876 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I36dfd0f082ed48f62c537283ed24017f1ac8ada1 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Faidon Liambotis <fai...@wikimedia.org> Gerrit-Reviewer: Faidon Liambotis <fai...@wikimedia.org> Gerrit-Reviewer: Ori.livneh <o...@wikimedia.org> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits