Method: Chef::Provisioning::ChefManagedEntryStore#get_data
- Defined in:
- lib/chef/provisioning/chef_managed_entry_store.rb
#get_data(resource_type, name) ⇒ Hash, Array
Get the given data
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/chef/provisioning/chef_managed_entry_store.rb', line 25 def get_data(resource_type, name) begin if resource_type == :machine chef_api.get("nodes/#{name}") else chef_api.get("data/#{resource_type}/#{name}") end rescue Net::HTTPServerException => e if e.response.code == '404' backcompat_type = ChefManagedEntryStore.type_names_for_backcompat[resource_type] if backcompat_type && backcompat_type != resource_type get_data(backcompat_type, name) else nil end else raise end end end |