Skip to content

Commit

Permalink
Merge pull request boto#2402 from felixonmars/opsworks-py3
Browse files Browse the repository at this point in the history
opsworks module: add backward-compatible support for Python 3.3+. Fixes boto#2402.
  • Loading branch information
danielgtaylor committed Jul 15, 2014
2 parents a4d0a7a + e5be2ec commit 68d15a5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ At the moment, boto supports:
* AWS Elastic Beanstalk
* AWS CloudFormation (Python 3)
* AWS Data Pipeline (Python 3)
* AWS Opsworks
* AWS Opsworks (Python 3)
* AWS CloudTrail (Python 3)

* Identity & Access
Expand Down
8 changes: 2 additions & 6 deletions boto/opsworks/layer1.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,13 @@
# IN THE SOFTWARE.
#

try:
import json
except ImportError:
import simplejson as json

import boto
from boto.connection import AWSQueryConnection
from boto.regioninfo import RegionInfo
from boto.exception import JSONResponseError
from boto.opsworks import exceptions
from boto.compat import json


class OpsWorksConnection(AWSQueryConnection):
Expand Down Expand Up @@ -2580,7 +2577,7 @@ def make_request(self, action, body):
headers=headers, data=body)
response = self._mexe(http_request, sender=None,
override_num_retries=10)
response_body = response.read()
response_body = response.read().decode('utf-8')
boto.log.debug(response_body)
if response.status == 200:
if response_body:
Expand All @@ -2591,4 +2588,3 @@ def make_request(self, action, body):
exception_class = self._faults.get(fault_name, self.ResponseError)
raise exception_class(response.status, response.reason,
body=json_body)

2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Currently Supported Services
* CloudFormation -- (:doc:`API Reference <ref/cloudformation>`) (Python 3)
* Elastic Beanstalk -- (:doc:`API Reference <ref/beanstalk>`)
* Data Pipeline -- (:doc:`API Reference <ref/datapipeline>`) (Python 3)
* Opsworks -- (:doc:`API Reference <ref/opsworks>`)
* Opsworks -- (:doc:`API Reference <ref/opsworks>`) (Python 3)
* CloudTrail -- (:doc:`API Reference <ref/cloudtrail>`) (Python 3)

* **Identity & Access**
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/opsworks/test_layer1.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
import unittest

from boto.exception import JSONResponseError
from boto.opsworks import connect_to_region, regions, RegionInfo
from boto.opsworks.layer1 import OpsWorksConnection
from boto.compat import unittest


class TestOpsWorksConnection(unittest.TestCase):
Expand Down

0 comments on commit 68d15a5

Please sign in to comment.