mirror of
https://github.com/valitydev/salt.git
synced 2024-11-06 00:25:22 +00:00
Merge pull request #47879 from dwoz/ami_role_fix
Fix ami role usage warts #47269
This commit is contained in:
commit
b88ec5258d
@ -89,9 +89,7 @@ def creds(provider):
|
||||
proxies={'http': ''}, timeout=AWS_METADATA_TIMEOUT,
|
||||
)
|
||||
result.raise_for_status()
|
||||
role = result.text.encode(
|
||||
result.encoding if result.encoding else 'utf-8'
|
||||
)
|
||||
role = result.text
|
||||
except (requests.exceptions.HTTPError, requests.exceptions.ConnectionError):
|
||||
return provider['id'], provider['key'], ''
|
||||
|
||||
@ -451,7 +449,7 @@ def query(params=None, setname=None, requesturl=None, location=None,
|
||||
log.debug('AWS Response Status Code: %s', result.status_code)
|
||||
log.trace(
|
||||
'AWS Response Text: %s',
|
||||
result.text.encode(result.encoding if result.encoding else 'utf-8')
|
||||
result.text
|
||||
)
|
||||
result.raise_for_status()
|
||||
break
|
||||
@ -488,11 +486,7 @@ def query(params=None, setname=None, requesturl=None, location=None,
|
||||
return {'error': data}, requesturl
|
||||
return {'error': data}
|
||||
|
||||
response = result.text.encode(
|
||||
result.encoding if result.encoding else 'utf-8'
|
||||
)
|
||||
|
||||
root = ET.fromstring(response)
|
||||
root = ET.fromstring(result.text)
|
||||
items = root[1]
|
||||
if return_root is True:
|
||||
items = root
|
||||
|
Loading…
Reference in New Issue
Block a user