Refactored code to use new olso namespace
Change-Id: Ia591851b89022dcb158a026bc5093be0e2951415
This commit is contained in:
parent
a37e6ec6c1
commit
980dbac279
@ -15,7 +15,7 @@ from keystoneclient.auth.identity import v3 as v3_auth
|
||||
from keystoneclient import discover
|
||||
from keystoneclient import exceptions as ks_exc
|
||||
from keystoneclient import session
|
||||
from oslo.utils import strutils
|
||||
from oslo_utils import strutils
|
||||
import six.moves.urllib.parse as urlparse
|
||||
|
||||
from cloudkittyclient.common import utils
|
||||
|
@ -20,9 +20,9 @@ import sys
|
||||
import textwrap
|
||||
import uuid
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import encodeutils
|
||||
from oslo.utils import importutils
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import encodeutils
|
||||
from oslo_utils import importutils
|
||||
import prettytable
|
||||
import six
|
||||
|
||||
|
@ -17,14 +17,14 @@ See http://docs.openstack.org/developer/oslo.i18n/usage.html
|
||||
"""
|
||||
|
||||
try:
|
||||
import oslo.i18n
|
||||
import oslo_i18n
|
||||
|
||||
# NOTE(dhellmann): This reference to o-s-l-o will be replaced by the
|
||||
# application name when this module is synced into the separate
|
||||
# repository. It is OK to have more than one translation function
|
||||
# using the same domain, since there will still only be one message
|
||||
# catalog.
|
||||
_translators = oslo.i18n.TranslatorFactory(domain='cloudkittyclient')
|
||||
_translators = oslo_i18n.TranslatorFactory(domain='cloudkittyclient')
|
||||
|
||||
# The primary translation function using the well-known name "_"
|
||||
_ = _translators.primary
|
||||
|
@ -40,7 +40,7 @@ Base utilities to build API operation managers and objects on top of.
|
||||
import abc
|
||||
import copy
|
||||
|
||||
from oslo.utils import strutils
|
||||
from oslo_utils import strutils
|
||||
import six
|
||||
from six.moves.urllib import parse
|
||||
|
||||
@ -402,7 +402,7 @@ class CrudManager(BaseManager):
|
||||
'name': self.resource_class.__name__,
|
||||
'args': kwargs
|
||||
}
|
||||
raise exceptions.NotFound(404, msg)
|
||||
raise exceptions.NotFound(msg)
|
||||
elif num > 1:
|
||||
raise exceptions.NoUniqueMatch
|
||||
else:
|
||||
@ -509,8 +509,9 @@ class Resource(object):
|
||||
new = self.manager.get(self.id)
|
||||
if new:
|
||||
self._add_details(new._info)
|
||||
self._add_details(
|
||||
{'x_request_id': self.manager.client.last_request_id})
|
||||
if self.manager.client.last_request_id:
|
||||
self._add_details(
|
||||
{'x_request_id': self.manager.client.last_request_id})
|
||||
|
||||
def __eq__(self, other):
|
||||
if not isinstance(other, Resource):
|
||||
|
@ -34,8 +34,8 @@ try:
|
||||
except ImportError:
|
||||
import json
|
||||
|
||||
from oslo.utils import encodeutils
|
||||
from oslo.utils import importutils
|
||||
from oslo_utils import encodeutils
|
||||
from oslo_utils import importutils
|
||||
import requests
|
||||
|
||||
from cloudkittyclient.openstack.common._i18n import _
|
||||
@ -123,6 +123,9 @@ class HTTPClient(object):
|
||||
"'%s'" % url,
|
||||
]
|
||||
|
||||
if not kwargs.get('verify', self.verify):
|
||||
string_parts.insert(1, '--insecure')
|
||||
|
||||
for element in kwargs['headers']:
|
||||
header = ("-H '%s: %s'" %
|
||||
self._safe_header(element, kwargs['headers'][element]))
|
||||
|
@ -465,7 +465,7 @@ def from_response(response, method, url):
|
||||
kwargs["details"] = (error.get("details") or
|
||||
six.text_type(body))
|
||||
elif content_type.startswith("text/"):
|
||||
kwargs["details"] = response.text
|
||||
kwargs["details"] = getattr(response, 'text', '')
|
||||
|
||||
try:
|
||||
cls = _code_map[response.status_code]
|
||||
|
@ -181,8 +181,7 @@ class FakeHTTPClient(client.HTTPClient):
|
||||
else:
|
||||
status, body = resp
|
||||
headers = {}
|
||||
self.last_request_id = headers.get('x-openstack-request-id',
|
||||
'req-test')
|
||||
self.last_request_id = headers.get('x-openstack-request-id')
|
||||
return TestResponse({
|
||||
"status_code": status,
|
||||
"text": body,
|
||||
|
@ -24,8 +24,8 @@
|
||||
#
|
||||
########################################################################
|
||||
|
||||
from oslo.utils import encodeutils
|
||||
from oslo.utils import uuidutils
|
||||
from oslo_utils import encodeutils
|
||||
from oslo_utils import uuidutils
|
||||
import six
|
||||
|
||||
from cloudkittyclient.openstack.common._i18n import _
|
||||
|
@ -24,8 +24,8 @@ import os
|
||||
import sys
|
||||
import textwrap
|
||||
|
||||
from oslo.utils import encodeutils
|
||||
from oslo.utils import strutils
|
||||
from oslo_utils import encodeutils
|
||||
from oslo_utils import strutils
|
||||
import prettytable
|
||||
import six
|
||||
from six import moves
|
||||
|
@ -22,7 +22,7 @@ import argparse
|
||||
import logging
|
||||
import sys
|
||||
|
||||
from oslo.utils import encodeutils
|
||||
from oslo_utils import encodeutils
|
||||
import six
|
||||
from stevedore import extension
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
import functools
|
||||
|
||||
from oslo.utils import strutils
|
||||
from oslo_utils import strutils
|
||||
|
||||
from cloudkittyclient.common import utils
|
||||
from cloudkittyclient import exc
|
||||
|
@ -6,3 +6,6 @@ pbr>=0.6,!=0.7,<1.0
|
||||
Babel>=1.3
|
||||
python-keystoneclient
|
||||
stevedore
|
||||
oslo.i18n
|
||||
oslo.serialization
|
||||
oslo.utils
|
||||
|
Loading…
Reference in New Issue
Block a user