New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LaunchConfiguration] Fix user_data encoded Python 3.3+ #2591

Merged
merged 1 commit into from Sep 22, 2014

Conversation

Projects
None yet
2 participants
@nishigori
Contributor

nishigori commented Sep 5, 2014

Occurred the Error calling boto.ec2.autoscale.AutoScaleConnection.create_launch_configuration(...) with user_data (type str)

Hope to fix that behavior like boto.ec2.connection.run_instances 馃崪

category boto Python module
bug 2.32.1 py33, py34 autoscale

Traceback: 馃挃

...
  File "xxx/lib/python3.4/site-packages/boto/ec2/autoscale/__init__.py", line 225, in create_launch_configuration
    params['UserData'] = base64.b64encode(launch_config.user_data).decode('utf-8')
  File "xxx/lib/python3.4/base64.py", line 62, in b64encode
    encoded = binascii.b2a_base64(s)[:-1]
TypeError: 'str' does not support the buffer interface

Test Execution case 2.32.1: 馃挃

$ python3 tests/test.py tests/unit/ec2/autoscale/test_group.py
nose command: tests/test.py -a !notdefault tests/unit/ec2/autoscale/test_group.py
...............E.......
======================================================================
ERROR: test_launch_config (tests.unit.ec2.autoscale.test_group.TestLaunchConfiguration)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "xxx/boto/boto/tests/unit/ec2/autoscale/test_group.py", line 375, in test_launch_config
    response = self.service_connection.create_launch_configuration(lc)
  File "xxx/boto/boto/ec2/autoscale/__init__.py", line 225, in create_launch_configuration
    params['UserData'] = base64.b64encode(launch_config.user_data).decode('utf-8')
  File "xxx/.venv/boto.py34/lib/python3.4/base64.py", line 62, in b64encode
    encoded = binascii.b2a_base64(s)[:-1]
nose.proxy.TypeError: 'str' does not support the buffer interface
-------------------- >> begin captured logging << --------------------
boto: DEBUG: Using access key provided by client.
boto: DEBUG: Using secret key provided by client.
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 23 tests in 0.057s

FAILED (errors=1)

btw Travis's running test python tests/test.py default is without target tests/unit/ec2/autoscale/test_group.py?


References

@danielgtaylor danielgtaylor self-assigned this Sep 22, 2014

@danielgtaylor danielgtaylor merged commit 6f4d0bb into boto:develop Sep 22, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

danielgtaylor added a commit that referenced this pull request Sep 22, 2014

Merge branch 'nishigori-b64encode-launch-config-user-data' into develop
Fix an error in Python 3 when creating launch configs. Enables AutoScaling
unit tests to run by default. Fixes #2591.
@danielgtaylor

This comment has been minimized.

Show comment
Hide comment
@danielgtaylor

danielgtaylor Sep 22, 2014

Member

Thanks! 馃憤

Member

danielgtaylor commented Sep 22, 2014

Thanks! 馃憤

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment