diff options
| author | Paul Berry <paul@puppetlabs.com> | 2011-02-17 15:37:12 -0800 |
|---|---|---|
| committer | Paul Berry <paul@puppetlabs.com> | 2011-02-17 15:37:26 -0800 |
| commit | 6d5f1aa75c8c64033b56f49e87fc03258d5c158c (patch) | |
| tree | 13280ce802707d5a8d52e2d7a06d5ab2610d496d /lib/puppet/network | |
| parent | ab27da7967e1e145d5fbc130e5fbcec6795ca775 (diff) | |
| parent | 8a485608e2941ff8c7ecc706c21f906d59302dd6 (diff) | |
Merge branch 'ticket/2.6.next/6338' into 2.6.next
* ticket/2.6.next/6338:
(#5150) Make fact REST terminus configurable to connect to inventory service
(#5166) Inventory service is now searchable by timestamp.
Maint: backport timestamp accessor for facts from 2.7 branch
Refactored Puppet::Node::Inventory::Yaml tests in preparation for adding freshness check
Refactor Puppet::Node::Inventory::Yaml in preparation for adding freshness
(#5132) Provide a query REST interface for inventory
Diffstat (limited to 'lib/puppet/network')
| -rw-r--r-- | lib/puppet/network/http/api/v1.rb | 3 | ||||
| -rw-r--r-- | lib/puppet/network/http/handler.rb | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/lib/puppet/network/http/api/v1.rb b/lib/puppet/network/http/api/v1.rb index 8aa1f0ee1..0a04a465f 100644 --- a/lib/puppet/network/http/api/v1.rb +++ b/lib/puppet/network/http/api/v1.rb @@ -60,9 +60,8 @@ module Puppet::Network::HTTP::API::V1 # fix to not need this, and our goal is to move away from the complication # that leads to the fix being too long. return :singular if indirection == "facts" - - # "status" really is singular return :singular if indirection == "status" + return :plural if indirection == "inventory" result = (indirection =~ /s$/) ? :plural : :singular diff --git a/lib/puppet/network/http/handler.rb b/lib/puppet/network/http/handler.rb index 9e9356b2f..e192613ad 100644 --- a/lib/puppet/network/http/handler.rb +++ b/lib/puppet/network/http/handler.rb @@ -131,7 +131,7 @@ module Puppet::Network::HTTP::Handler def do_search(indirection_request, request, response) result = indirection_request.model.search(indirection_request.key, indirection_request.to_hash) - if result.nil? or (result.is_a?(Array) and result.empty?) + if result.nil? return do_exception(response, "Could not find instances in #{indirection_request.indirection_name} with '#{indirection_request.key}'", 404) end |
