From 862c3d59fae99d514041d0023554f7581801bac2 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 19 Nov 2014 22:41:54 +0000 Subject: [PATCH] Use `quote` from six --- salt/cloud/clouds/aliyun.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/salt/cloud/clouds/aliyun.py b/salt/cloud/clouds/aliyun.py index ebf570ef96..e1c6744a3d 100644 --- a/salt/cloud/clouds/aliyun.py +++ b/salt/cloud/clouds/aliyun.py @@ -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', '~')