0

In test kitchen i am trying to search nodes but it is not giving any output

cookbook/test/integration/nodes

Json file { "id": "hive server", "chef_type": "node", "environment": "dev", "json_class": "Chef::Node", "run_list": [], "automatic": { "hostname": "test.net", "fqdn": "127.0.0.1", "name": "test.net", "ipaddress": "127.0.0.1", "node_zone": "green", "roles": []

    },

    "attributes": {
            "hiveserver": "true"
    }

}

Recipe

  hiveNodes = search(:node, "hiveserver:true AND environment:node.environment AND node_color:node["node_color"])



#hiveserverList = ""
#hiveNodes.each |hnode| do
#    hiveserverList += hnode
#end



#file '/tmp/test.txt' do
#  content '#{hiveserverList}'
#end
coderanger
  • 52,400
  • 4
  • 52
  • 75
Udhay
  • 7
  • 7
  • cookbook/test/integration/nodes Json file { "id": "hive server", "chef_type": "node", "environment": "dev", "json_class": "Chef::Node", "run_list": [], "automatic": { "hostname": "test.net", "fqdn": "127.0.0.1", "name": "test.net", "ipaddress": "127.0.0.1", "node_zone": "green", "roles": [] }, "attributes": { "hiveserver": "true" } } Recipe hiveNodes = search(:node, "hiveserver:true AND environment:node.environment AND node_color:node["node_color"]) – Udhay Mar 01 '17 at 04:50
  • Possible duplicate of [node search is giving nothing in test kitchen](http://stackoverflow.com/questions/42543383/node-search-is-giving-nothing-in-test-kitchen) – coderanger Mar 01 '17 at 23:04

0 Answers0