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

Remove the last of the botocore conns #287

Merged
merged 2 commits into from
Dec 5, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions stacker/lookups/handlers/kms.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import base64

import botocore.session
import boto3

from ...util import read_value_from_path

Expand Down Expand Up @@ -48,8 +46,6 @@ def handler(value, **kwargs):
if "@" in value:
region, value = value.split("@", 1)

s = botocore.session.get_session()
kms = s.create_client("kms", region_name=region)
decoded = base64.b64decode(value)
response = kms.decrypt(CiphertextBlob=decoded)
return response["Plaintext"]
kms = boto3.client("kms", region_name=region)
decoded = value.decode("base64")
return kms.decrypt(CiphertextBlob=decoded)["Plaintext"]