You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by fr...@apache.org on 2013/12/05 19:51:12 UTC

git commit: updated refs/heads/4.3 to e5e3957

Updated Branches:
  refs/heads/4.3 fb1f3f086 -> e5e39577c


Change security_group_agent python side in line with default
security group rules change in 4.2


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e5e39577
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e5e39577
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e5e39577

Branch: refs/heads/4.3
Commit: e5e39577c09bee799a0f71e2df6c49cba34e2fa5
Parents: fb1f3f0
Author: Frank.Zhang <fr...@citrix.com>
Authored: Tue Oct 8 11:08:18 2013 -0700
Committer: Frank.Zhang <fr...@citrix.com>
Committed: Thu Dec 5 10:51:04 2013 -0800

----------------------------------------------------------------------
 .../security_group_agent/security_group_agent/sglib.py          | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e5e39577/plugins/hypervisors/baremetal/resources/security_group_agent/security_group_agent/sglib.py
----------------------------------------------------------------------
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 b4a39eb..4eb8e43 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