Use quote from six

This commit is contained in:
Pedro Algarvio 2014-11-19 22:41:54 +00:00
parent 13df58d2e6
commit 862c3d59fa

View File

@ -30,15 +30,17 @@ from __future__ import absolute_import
import time
import json
import pprint
import requests
import logging
import hmac
import urllib
import uuid
import sys
import base64
from hashlib import sha1
# Import 3rd-party libs
import requests
from salt.ext.six.moves.urllib.parse import quote as _quote # pylint: disable=import-error,no-name-in-module
# Import salt cloud libs
import salt.utils.cloud
import salt.config as config
@ -664,7 +666,7 @@ def _compute_signature(parameters, access_key_secret):
s = line.decode().encode('utf8')
else:
s = line.decode(sys.stdin.encoding).encode('utf8')
res = urllib.quote(s, '')
res = _quote(s, '')
res = res.replace('+', '%20')
res = res.replace('*', '%2A')
res = res.replace('%7E', '~')