Fix py3 compatibilty issues
1. replace urllib with six.moves.urllib 2. replace basestring with six.string_types Change-Id: I92dbbdb149ed35e1623184eb7a93162b5cc0bfb6
This commit is contained in:
parent
97ae902a8d
commit
a0eafcb093
designateclient
@ -15,9 +15,9 @@
|
||||
# under the License.
|
||||
import abc
|
||||
import json
|
||||
from urllib import urlencode
|
||||
|
||||
import six
|
||||
from six.moves.urllib import parse
|
||||
from stevedore import extension
|
||||
|
||||
from designateclient import exceptions
|
||||
@ -37,7 +37,7 @@ class Controller(object):
|
||||
if limit is not None:
|
||||
params['limit'] = limit
|
||||
|
||||
q = urlencode(params) if params else ''
|
||||
q = parse.urlencode(params) if params else ''
|
||||
return '%(url)s%(params)s' % {
|
||||
'url': url,
|
||||
'params': '?%s' % q
|
||||
|
@ -14,6 +14,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from oslo_utils import uuidutils
|
||||
import six
|
||||
|
||||
from designateclient import client
|
||||
from designateclient.v2 import utils as v2_utils
|
||||
@ -24,8 +25,9 @@ class RecordSetController(client.Controller):
|
||||
zone_info = None
|
||||
|
||||
# If we get a zone name we'll need to get the ID of it before POST.
|
||||
if isinstance(zone, basestring) and not uuidutils.is_uuid_like(zone):
|
||||
zone_info = self.client.zones.get(zone)
|
||||
if isinstance(zone, six.string_types) and not \
|
||||
uuidutils.is_uuid_like(zone):
|
||||
zone_info = self.client.zones.get(zone)
|
||||
elif isinstance(zone, dict):
|
||||
zone_info = zone
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user