summaryrefslogtreecommitdiff
path: root/lib/chef_zero/endpoints/environment_nodes_endpoint.rb
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2016-07-29 17:00:49 +0100
committerThom May <thom@may.lt>2016-07-29 17:00:49 +0100
commite257f450c044616fefbd15e9a180387aaaa572a1 (patch)
tree6a148967013485078af6601546bdb7b61c623f3c /lib/chef_zero/endpoints/environment_nodes_endpoint.rb
parent4c86d798010b73c76c916e601ff48c24ffb65dd6 (diff)
downloadchef-zero-e257f450c044616fefbd15e9a180387aaaa572a1.tar.gz
ChefStyletm/style
Signed-off-by: Thom May <thom@may.lt>
Diffstat (limited to 'lib/chef_zero/endpoints/environment_nodes_endpoint.rb')
-rw-r--r--lib/chef_zero/endpoints/environment_nodes_endpoint.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/chef_zero/endpoints/environment_nodes_endpoint.rb b/lib/chef_zero/endpoints/environment_nodes_endpoint.rb
index e8eaca2..cffe596 100644
--- a/lib/chef_zero/endpoints/environment_nodes_endpoint.rb
+++ b/lib/chef_zero/endpoints/environment_nodes_endpoint.rb
@@ -1,5 +1,5 @@
-require 'ffi_yajl'
-require 'chef_zero/rest_base'
+require "ffi_yajl"
+require "chef_zero/rest_base"
module ChefZero
module Endpoints
@@ -10,10 +10,10 @@ module ChefZero
get_data(request, request.rest_path[0..3])
result = {}
- list_data(request, request.rest_path[0..1] + ['nodes']).each do |name|
- node = FFI_Yajl::Parser.parse(get_data(request, request.rest_path[0..1] + ['nodes', name]), :create_additions => false)
- if node['chef_environment'] == request.rest_path[3]
- result[name] = build_uri(request.base_uri, request.rest_path[0..1] + ['nodes', name])
+ list_data(request, request.rest_path[0..1] + ["nodes"]).each do |name|
+ node = FFI_Yajl::Parser.parse(get_data(request, request.rest_path[0..1] + ["nodes", name]), :create_additions => false)
+ if node["chef_environment"] == request.rest_path[3]
+ result[name] = build_uri(request.base_uri, request.rest_path[0..1] + ["nodes", name])
end
end
json_response(200, result)