Fix Python 3 bytes string encoding when getting IAM credentials
Florent Viard authored on 2018/03/04 04:53:41... | ... |
@@ -222,7 +222,7 @@ class Config(object): |
222 | 222 |
resp = conn.getresponse() |
223 | 223 |
files = resp.read() |
224 | 224 |
if resp.status == 200 and len(files)>1: |
225 |
- conn.request('GET', "/latest/meta-data/iam/security-credentials/%s"%files) |
|
225 |
+ conn.request('GET', "/latest/meta-data/iam/security-credentials/%s"%files.decode()) |
|
226 | 226 |
resp=conn.getresponse() |
227 | 227 |
if resp.status == 200: |
228 | 228 |
creds=json.load(resp) |