Author: tomaz
Date: Thu Apr  7 19:47:32 2011
New Revision: 1089962

URL: http://svn.apache.org/viewvc?rev=1089962&view=rev
Log:
Modify EC2 driver so now the EC2 response inherits from AWSBaseResponse class.

Modified:
    incubator/libcloud/trunk/libcloud/compute/drivers/ec2.py

Modified: incubator/libcloud/trunk/libcloud/compute/drivers/ec2.py
URL: 
http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/compute/drivers/ec2.py?rev=1089962&r1=1089961&r2=1089962&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/compute/drivers/ec2.py (original)
+++ incubator/libcloud/trunk/libcloud/compute/drivers/ec2.py Thu Apr  7 
19:47:32 2011
@@ -27,7 +27,8 @@ from hashlib import sha256
 from xml.etree import ElementTree as ET
 
 from libcloud.utils import fixxpath, findtext, findattr, findall
-from libcloud.common.base import Response, ConnectionUserAndKey
+from libcloud.common.base import ConnectionUserAndKey
+from libcloud.common.aws import AWSBaseResponse
 from libcloud.common.types import InvalidCredsError, MalformedResponseError, 
LibcloudError
 from libcloud.compute.providers import Provider
 from libcloud.compute.types import NodeState
@@ -147,19 +148,10 @@ class EC2NodeLocation(NodeLocation):
                 % (self.id, self.name, self.country,
                    self.availability_zone.name, self.driver.name))
 
-class EC2Response(Response):
+class EC2Response(AWSBaseResponse):
     """
     EC2 specific response parsing and error handling.
     """
-    def parse_body(self):
-        if not self.body:
-            return None
-        try:
-          body = ET.XML(self.body)
-        except:
-          raise MalformedResponseError("Failed to parse XML", body=self.body, 
driver=EC2NodeDriver)
-        return body
-
     def parse_error(self):
         err_list = []
         # Okay, so for Eucalyptus, you can get a 403, with no body,


Reply via email to