From 950db49ea87ddfb3019579ba48557bc8f28ee344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20L=C3=A9tourneau?= Date: Fri, 8 Jan 2016 16:01:16 -0500 Subject: [PATCH] utils.aws.query calls for any other product than ec2 do not seem to work --- salt/utils/aws.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/salt/utils/aws.py b/salt/utils/aws.py index a63f086624..88244276db 100644 --- a/salt/utils/aws.py +++ b/salt/utils/aws.py @@ -225,7 +225,7 @@ def sig4(method, endpoint, params, prov_dict, location = DEFAULT_LOCATION params_with_headers = params.copy() - if product != 's3': + if product not in ('s3', 'ssm'): params_with_headers['Version'] = aws_api_version keys = sorted(params_with_headers.keys()) values = list(map(params_with_headers.get, keys)) @@ -428,6 +428,11 @@ def query(params=None, setname=None, requesturl=None, location=None, ) ) + # Fallback to ec2's id & key if none is found, for this component + if not prov_dict.get('id', None): + prov_dict['id'] = providers.get(provider, {}).get('ec2', {}).get('id', {}) + prov_dict['key'] = providers.get(provider, {}).get('ec2', {}).get('key', {}) + if sigver == '4': headers, requesturl = sig4( method, endpoint, params, prov_dict, aws_api_version, location, product, requesturl=requesturl