Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix use of user_data field with spot_price in ec2 module #37628

Merged
merged 1 commit into from
Mar 20, 2018

Conversation

abadger
Copy link
Contributor

@abadger abadger commented Mar 20, 2018

The user_data field is base64 encoded inside of the boto library. In
Python3, base64 must be used with byte strings. So we make sure to
encode the user_data into a byte string before passing it on to the boto
library.

Fixes #34978

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lib/ansible/modules/cloud/amazon/ec2.py

ANSIBLE VERSION
devel stable-2.5 stable-2.4

The user_data field is base64 encoded inside of the boto library.  In
Python3, base64 must be used with byte strings.  So we make sure to
encode the user_data into a byte string before passing it on to the boto
library.

Fixes ansible#34978
@ansibot
Copy link
Contributor

ansibot commented Mar 20, 2018

@ansibot ansibot added aws bug This issue/PR relates to a bug. cloud core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Mar 20, 2018
@s-hertel s-hertel removed the needs_triage Needs a first human triage before being processed. label Mar 20, 2018
@s-hertel
Copy link
Contributor

I was able to reproduce #34978 and this fixes it. Thanks @abadger!

@s-hertel s-hertel merged commit 0d55081 into ansible:devel Mar 20, 2018
@abadger
Copy link
Contributor Author

abadger commented Mar 20, 2018

Thanks for reviewing @s-hertel !

@abadger abadger deleted the fix-py3-ec2-user-data-param branch March 20, 2018 19:25
abadger added a commit to abadger/ansible that referenced this pull request Mar 20, 2018
The user_data field is base64 encoded inside of the boto library.  In
Python3, base64 must be used with byte strings.  So we make sure to
encode the user_data into a byte string before passing it on to the boto
library.

Fixes ansible#34978

(cherry picked from commit 0d55081)
@abadger abadger moved this from TODO to Done in Python 3 compatibility Mar 20, 2018
nitzmahone pushed a commit that referenced this pull request Mar 29, 2018
* Fix use of user_data field with spot_price in ec2 module (#37628)

The user_data field is base64 encoded inside of the boto library.  In
Python3, base64 must be used with byte strings.  So we make sure to
encode the user_data into a byte string before passing it on to the boto
library.

Fixes #34978

(cherry picked from commit 0d55081)

* Python3 ec2 fix added to changelog
abadger added a commit that referenced this pull request Mar 29, 2018
The user_data field is base64 encoded inside of the boto library.  In
Python3, base64 must be used with byte strings.  So we make sure to
encode the user_data into a byte string before passing it on to the boto
library.

Fixes #34978

(cherry picked from commit 0d55081)
aleskiontherun pushed a commit to billie-archives/ansible that referenced this pull request Apr 18, 2018
…-fix-2.4

* commit '0adcd7bd1a09489faebed2942b24427bc60f053e': (143 commits)
  New release v2.4.4.0-1
  Update the docs with the 2.4.4 release date
  New release v2.4.4.0-1
  New release v2.4.4.0-0.3.rc2
  Add changelog entries for nxos_* fixes
  add nxos_snapshot test for missing required param (ansible#37248)
  fix required args for nxos_snapshot and docs improvement (ansible#37232)
  Add changelog for consul module state=absent fix
  Add changelog entry for jira py3 fix
  make jira authentication Python3 compatible (ansible#33862)
  Add vagrant dyn inv fix to changelog
  Fix dynamic inventory for vagrant does not work on python3 (ansible#37631)
  Add digital ocean py3 fix to changelog
  DigitalOcean: typecast map function for Python3 (ansible#37126)
  changelog for ansible-pull python3 fix
  Compare byte strings to byte strings
  Add ec2 python3 fix to changelog
  Fix use of user_data field with spot_price in ec2 module (ansible#37628)
  Add csvfile py3 fix to changelog
  Fix csvfile traceback on Python3 (ansible#37625)
  ...
@ansible ansible locked and limited conversation to collaborators Apr 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
aws bug This issue/PR relates to a bug. cloud core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

EC2 user-data error when spot_price != null
3 participants