From 30a680efc5bddd5c6ff670f9a8f41b4fafe45dca Mon Sep 17 00:00:00 2001 From: "Frank.Zhang" Date: Tue, 8 Oct 2013 11:08:18 -0700 Subject: [PATCH] Change security_group_agent python side in line with default security group rules change in 4.2 --- .../security_group_agent/security_group_agent/sglib.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/hypervisors/baremetal/resources/security_group_agent/security_group_agent/sglib.py b/plugins/hypervisors/baremetal/resources/security_group_agent/security_group_agent/sglib.py index b4a39eb5cc0..4eb8e437b6d 100755 --- a/plugins/hypervisors/baremetal/resources/security_group_agent/security_group_agent/sglib.py +++ b/plugins/hypervisors/baremetal/resources/security_group_agent/security_group_agent/sglib.py @@ -77,7 +77,10 @@ class Request(object): def from_cherrypy_request(creq): req = Request() req.headers = copy.copy(creq.headers) - req.body = creq.body.fp.read() if creq.body else None + if hasattr(creq.body, 'fp'): + req.body = creq.body.fp.read() if creq.body else None + else: + req.body = creq.body.read() if creq.body else None req.method = copy.copy(creq.method) req.query_string = copy.copy(creq.query_string) if creq.query_string else None return req