mirror of
https://github.com/valitydev/salt.git
synced 2024-11-06 08:35:21 +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,
|
proxies={'http': ''}, timeout=AWS_METADATA_TIMEOUT,
|
||||||
)
|
)
|
||||||
result.raise_for_status()
|
result.raise_for_status()
|
||||||
role = result.text.encode(
|
role = result.text
|
||||||
result.encoding if result.encoding else 'utf-8'
|
|
||||||
)
|
|
||||||
except (requests.exceptions.HTTPError, requests.exceptions.ConnectionError):
|
except (requests.exceptions.HTTPError, requests.exceptions.ConnectionError):
|
||||||
return provider['id'], provider['key'], ''
|
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.debug('AWS Response Status Code: %s', result.status_code)
|
||||||
log.trace(
|
log.trace(
|
||||||
'AWS Response Text: %s',
|
'AWS Response Text: %s',
|
||||||
result.text.encode(result.encoding if result.encoding else 'utf-8')
|
result.text
|
||||||
)
|
)
|
||||||
result.raise_for_status()
|
result.raise_for_status()
|
||||||
break
|
break
|
||||||
@ -488,11 +486,7 @@ def query(params=None, setname=None, requesturl=None, location=None,
|
|||||||
return {'error': data}, requesturl
|
return {'error': data}, requesturl
|
||||||
return {'error': data}
|
return {'error': data}
|
||||||
|
|
||||||
response = result.text.encode(
|
root = ET.fromstring(result.text)
|
||||||
result.encoding if result.encoding else 'utf-8'
|
|
||||||
)
|
|
||||||
|
|
||||||
root = ET.fromstring(response)
|
|
||||||
items = root[1]
|
items = root[1]
|
||||||
if return_root is True:
|
if return_root is True:
|
||||||
items = root
|
items = root
|
||||||
|
Loading…
Reference in New Issue
Block a user