Skip to content

Commit

Permalink
Merge pull request #16452 from markdoliner/develop
Browse files Browse the repository at this point in the history
Fix salt-cloud ec2 requests containing spaces.
  • Loading branch information
techhat committed Oct 7, 2014
2 parents b03b675 + c6eeca1 commit e3a556d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions salt/cloud/clouds/ec2.py
Expand Up @@ -333,6 +333,10 @@ def query(params=None, setname=None, requesturl=None, location=None,
values = map(params_with_headers.get, keys)
querystring = urllib.urlencode(list(zip(keys, values)))

# AWS signature version 2 requires that spaces be encoded as
# %20, however urlencode uses '+'. So replace pluses with %20.
querystring = querystring.replace('+', '%20')

uri = '{0}\n{1}\n/\n{2}'.format(method.encode('utf-8'),
endpoint.encode('utf-8'),
querystring.encode('utf-8'))
Expand Down

0 comments on commit e3a556d

Please sign in to comment.