diff options
-rw-r--r-- | lib/puppet/network/http/handler.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/puppet/network/http/handler.rb b/lib/puppet/network/http/handler.rb index 8c6abde8a..3c14c8a40 100644 --- a/lib/puppet/network/http/handler.rb +++ b/lib/puppet/network/http/handler.rb @@ -48,10 +48,16 @@ module Puppet::Network::HTTP::Handler raise ArgumentError, "No data to save" if !data or data.empty? args = params(request) obj = model.from_yaml(data) - result = obj.save(args).to_yaml + result = save_object(obj, args).to_yaml encode_result(request, response, result) end + # LAK:NOTE This has to be here for testing; it's a stub-point so + # we keep infinite recursion from happening. + def save_object(object, args) + object.save(args) + end + def do_exception(request, response, exception, status=404) encode_result(request, response, exception.to_yaml, status) end |