Permalink
Browse files

Merge remote-tracking branch 'upstream/develop' into develop

Conflicts:
	setup.py
  • Loading branch information...
2 parents dff43fa + ca3ad11 commit e8af13302c71239c0baf735bed2e6a1884220547 @kurin kurin committed Mar 10, 2013
View
@@ -139,7 +139,7 @@ Getting Started with Boto
*************************
Your credentials can be passed into the methods that create
-connections. Alternatively, boto will check for the existance of the
+connections. Alternatively, boto will check for the existence of the
following environment variables to ascertain your credentials:
**AWS_ACCESS_KEY_ID** - Your AWS Access Key ID
View
@@ -667,6 +667,16 @@ def connect_elastictranscoder(aws_access_key_id=None,
**kwargs)
+def connect_opsworks(aws_access_key_id=None,
+ aws_secret_access_key=None,
+ **kwargs):
+ from boto.opsworks.layer1 import OpsWorksConnection
+ return OpsWorksConnection(
+ aws_access_key_id=aws_access_key_id,
+ aws_secret_access_key=aws_secret_access_key,
+ **kwargs)
+
+
def storage_uri(uri_str, default_scheme='file', debug=0, validate=True,
bucket_storage_uri_class=BucketStorageUri,
suppress_consec_slashes=True, is_latest=False):
View
@@ -83,8 +83,8 @@ def __init__(self, status, reason, body=None, *args):
# then just ignore the error response.
if self.body:
try:
- h = handler.XmlHandler(self, self)
- xml.sax.parseString(self.body, h)
+ h = handler.XmlHandlerWrapper(self, self)
+ h.parseString(self.body)
except (TypeError, xml.sax.SAXParseException), pe:
# Remove unparsable message body so we don't include garbage
# in exception. But first, save self.body in self.error_message
View
@@ -397,7 +397,7 @@ def _set_acl_helper(self, acl_or_str, key_name, headers, query_args,
if if_metageneration is not None and if_generation is None:
raise ValueError("Received if_metageneration argument with no "
- "if_generation argument. A meta-generation has no "
+ "if_generation argument. A metageneration has no "
"meaning without a content generation.")
if not key_name and (if_generation or if_metageneration):
raise ValueError("Received if_generation or if_metageneration "
View
@@ -19,6 +19,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
+import StringIO
import xml.sax
class XmlHandler(xml.sax.ContentHandler):
@@ -42,3 +43,14 @@ def endElement(self, name):
def characters(self, content):
self.current_text += content
+
+
+class XmlHandlerWrapper(object):
+ def __init__(self, root_node, connection):
+ self.handler = XmlHandler(root_node, connection)
+ self.parser = xml.sax.make_parser()
+ self.parser.setContentHandler(self.handler)
+ self.parser.setFeature(xml.sax.handler.feature_external_ges, 0)
+
+ def parseString(self, content):
+ return self.parser.parse(StringIO.StringIO(content))
No changes.
@@ -0,0 +1,30 @@
+# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish, dis-
+# tribute, sublicense, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the fol-
+# lowing conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
+# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+#
+from boto.exception import JSONResponseError
+
+
+class ResourceNotFoundException(JSONResponseError):
+ pass
+
+
+class ValidationException(JSONResponseError):
+ pass
Oops, something went wrong.

0 comments on commit e8af133

Please sign in to comment.