fixes puppet + facter variables for users using puppet with mongrel
This commit is contained in:
robert 2011-11-24 18:45:14 +00:00
parent ff9908d97d
commit 7ffaf47aca
2 changed files with 28 additions and 2 deletions

View File

@ -1,11 +1,11 @@
# $OpenBSD: Makefile,v 1.36 2011/11/24 08:39:12 jasper Exp $
# $OpenBSD: Makefile,v 1.37 2011/11/24 18:45:14 robert Exp $
COMMENT= centralised configuration management for networks
VERSION= 2.7.5
DISTNAME= puppet-${VERSION}
PKGNAME= ruby-${DISTNAME}
REVISION= 0
REVISION= 1
CATEGORIES= sysutils net
HOMEPAGE= http://reductivelabs.com/projects/puppet/

View File

@ -0,0 +1,26 @@
$OpenBSD: patch-lib_puppet_network_http_mongrel_rest_rb,v 1.1 2011/11/24 18:45:14 robert Exp $
--- lib/puppet/network/http/mongrel/rest.rb.orig Thu Nov 24 19:44:09 2011
+++ lib/puppet/network/http/mongrel/rest.rb Thu Nov 24 19:44:03 2011
@@ -28,6 +28,8 @@ class Puppet::Network::HTTP::MongrelREST < Mongrel::Ht
# testing purposes.
def params(request)
params = Mongrel::HttpRequest.query_parse(request.params["QUERY_STRING"])
+ params.merge!(Mongrel::HttpRequest.query_parse(body(request))) if http_method(request).upcase == 'POST'
+
params = decode_params(params)
params.merge(client_info(request))
end
@@ -41,7 +43,12 @@ class Puppet::Network::HTTP::MongrelREST < Mongrel::Ht
# return the request body
def body(request)
- request.body.read
+ body = request.body.read
+ # We rewind the body, since read on a StringIO is destructive, and
+ # subsequent reads will return an empty string.
+ request.body.rewind
+
+ body
end
def set_content_type(response, format)