def get_node_by_name_and_ip(module, lb_driver, name, ip):
 nodes = lb_driver.ex_get_nodes()
 found_nodes = []
 if (not is_ipv4_addr(ip)):
  module.fail_json(msg=("Node '%s' ip is not a valid IPv4 address" % ip))
 found_nodes = [node for node in nodes if ((node.name == name) and (node.ip == ip))]
 if (len(found_nodes) == 0):
  return None
 elif (len(found_nodes) == 1):
  return found_nodes[0]
 else:
  module.fail_json(msg=("More than one node of name '%s' found." % name))

def get_node_by_name_and_ip ( module , lb_driver , name , ip ) : nodes = lb_driver . ex_get_nodes ( ) found_nodes = [ ] if ( not is_ipv4_addr ( ip ) ) : module . fail_json ( msg = ( "Node '%s' ip is not a valid IPv4 address" % ip ) ) found_nodes = [ node for node in nodes if ( ( node . name == name ) and ( node . ip == ip ) ) ] if ( len ( found_nodes ) == 0 ) : return None elif ( len ( found_nodes ) == 1 ) : return found_nodes [ 0 ] else : module . fail_json ( msg = ( "More than one node of name '%s' found." % name ) )
nodes do not have unique names .