[Pkg-puppet-devel] [facter] 65/352: (Maint) Override the `parse_results` method

Stig Sandbeck Mathisen ssm at debian.org
Sun Apr 6 22:21:32 UTC 2014


This is an automated email from the git hooks/post-receive script.

ssm pushed a commit to branch master
in repository facter.

commit f8410650b490ae209b73890de63559a470724672
Author: Josh Cooper <josh at puppetlabs.com>
Date:   Thu Dec 5 22:17:13 2013 -0800

    (Maint) Override the `parse_results` method
    
    Previously, the Base parser subclasses were not consistent in which
    parse method they overrode. The `parse` method wraps the `parse_results`
    method with exception handling. Subclasses that could potentially raise
    exceptions should override `parse_results` instead.
    
    Note the NothingParser is an exception, since it just returns nil.
---
 lib/facter/util/parser.rb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/facter/util/parser.rb b/lib/facter/util/parser.rb
index 7f9c514..cf3305a 100644
--- a/lib/facter/util/parser.rb
+++ b/lib/facter/util/parser.rb
@@ -102,7 +102,7 @@ module Facter::Util::Parser
   end
 
   class JsonParser < Base
-    def results
+    def parse_results
       if Facter.json?
         JSON.load(content)
       else
@@ -118,7 +118,7 @@ module Facter::Util::Parser
   end
 
   class ScriptParser < Base
-    def results
+    def parse_results
       KeyValuePairOutputFormat.parse Facter::Util::Resolution.exec(filename)
     end
   end
@@ -134,7 +134,7 @@ module Facter::Util::Parser
   # Executes and parses the key value output of Powershell scripts
   class PowershellParser < Base
     # Returns a hash of facts from powershell output
-    def results
+    def parse_results
       shell_command = "powershell -NoProfile -NonInteractive -NoLogo -ExecutionPolicy Bypass -File \"#{filename}\""
       KeyValuePairOutputFormat.parse Facter::Util::Resolution.exec(shell_command)
     end

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-puppet/facter.git



More information about the Pkg-puppet-devel mailing list