core/rails/app/models/barclamp_rebar/ansible_playbook_jig.rb
# node is the node being operated on.
# data is the data to look through
# Cond is the eval string
#    cond is of the form <path> <operator> <value>
#    path = a / separated set of strings that index into hash and lists.
#    operator = == or !=
#    value = string
#
# Return boolean value of condition as applied to stringified path results.
#
node is the node being operated on.
data is the data to look through
Cond is the eval string
cond is of the form   
path = a / separated set of strings that index into hash and lists.
operator = == or .
value = string

Return boolean value of condition as applied to stringified path results.
node is the node being operated on . data is the data to look through Cond is the eval string cond is of the form path = a / separated set of strings that index into hash and lists . operator = == or . value = string Return boolean value of condition as applied to stringified path results .
def eval_condition(node, nr, data, cond)
    args = cond.split
    path = args[0]
    operator = args[1]
    rvalue = args[2]
    lvalue = get_value(node, nr, data, path)
    lvalue = "" if lvalue.nil?
    case operator
    when '=='
      lvalue.to_s == rvalue
    when '!='
      lvalue.to_s != rvalue
    else
      Rails.logger.info("EvalCondition in Ansible Playbook Jig: #{operator} unknown")
      false
    end
  end
def eval_condition ( node , nr , data , cond ) args = cond . split path = args [ 0 ] operator = args [ 1 ] rvalue = args [ 2 ] lvalue = get_value ( node , nr , data , path ) lvalue = "" if lvalue . nil? case operator when '==' lvalue . to_s == rvalue when '!=' lvalue . to_s != rvalue else Rails . logger . info ( "EvalCondition in Ansible Playbook Jig: #{operator} unknown" ) false end end
node is the node being operated on.
node is the node being operated on .
# Return the eval
node
<not_specific>
nr
<not_specific>
data
<not_specific>
cond
<not_specific>