Browse Source

Keep py3.X compatibility for urllib

Change-Id: If6c1b016c726070b5b326296ead933cbd74bd408
Partial-Bug:#1280105
tags/2.0.0
Swapnil Kulkarni (coolsvap) 4 years ago
parent
commit
d8a34e2d69
1 changed files with 2 additions and 9 deletions
  1. +2
    -9
      magnum/common/pythonk8sclient/swagger_client/api_client.py

+ 2
- 9
magnum/common/pythonk8sclient/swagger_client/api_client.py View File

@@ -24,7 +24,6 @@ from .rest import ApiException

import os
import re
import urllib
import json
import mimetypes
import random
@@ -36,13 +35,7 @@ from datetime import date

# python 2 and python 3 compatibility library
from six import iteritems

try:
# for python3
from urllib.parse import quote
except ImportError:
# for python2
from urllib import quote
from six.moves.urllib import parse as urlparse

from .configuration import Configuration

@@ -116,7 +109,7 @@ class ApiClient(object):
if path_params:
path_params = self.sanitize_for_serialization(path_params)
for k, v in iteritems(path_params):
replacement = quote(str(self.to_path_value(v)))
replacement = urlparse.quote(str(self.to_path_value(v)))
resource_path = resource_path.\
replace('{' + k + '}', replacement)


Loading…
Cancel
Save