Update version according to OSCI-856
[packages/precise/mcollective.git] / lib / mcollective / matcher.rb
index d374776eb968ffc3454c2c4ed183e5d4b6093dbe..b4ea14167d8fd3906f6847d39f93518eac676d1f 100644 (file)
@@ -96,7 +96,12 @@ module MCollective
       result = Data.send(function_hash["name"], function_hash["params"])
 
       if function_hash["value"]
-        eval_result = result.send(function_hash["value"])
+        begin
+          eval_result = result.send(function_hash["value"])
+        rescue
+          # If data field has not been set we set the comparison result to nil
+          eval_result = nil
+        end
         return eval_result
       else
         return result
@@ -130,6 +135,9 @@ module MCollective
     def self.eval_compound_fstatement(function_hash)
       l_compare = execute_function(function_hash)
 
+      # Break out early and return false if the function returns nil
+      return false unless l_compare
+
       # Prevent unwanted discovery by limiting comparison operators
       # on Strings and Booleans
       if((l_compare.is_a?(String) || l_compare.is_a?(TrueClass) || l_compare.is_a?(FalseClass)) && function_hash["operator"].match(/<|>/))