Remove copy of incubated Oslo code

The Oslo team has moved all previously incubated code from the
openstack/oslo-incubator repository into separate library repositories
and released those libraries to the Python Package Index. Many of our
big tent project teams are still using the old, unsupported, incubated
versions of the code. The Oslo team has been working to remove that
incubated code from projects, and the time has come to finish that work.

As one of community-wide goals in Ocata, please see:
https://github.com/openstack/governance/blob/master/goals/ocata/remove-incubated-oslo-code.rst

Note: This commit also fix pep8 violations.

Change-Id: Ic2d8079b85ebd302a27785772462378f13d593d0
This commit is contained in:
ChangBo Guo(gcb)
2016-09-28 11:31:14 +08:00
committed by ChangBo Guo(gcb)
parent d2d3a475e2
commit ce263ecc9e
17 changed files with 32 additions and 66 deletions

View File

@@ -24,7 +24,7 @@ import os
import six
from stevedore import extension
from karborclient.openstack.common.apiclient import exceptions
from karborclient.common.apiclient import exceptions
_discovered_plugins = {}
@@ -41,7 +41,7 @@ def discover_auth_systems():
def add_plugin(ext):
_discovered_plugins[ext.name] = ext.plugin
ep_namespace = "karborclient.openstack.common.apiclient.auth"
ep_namespace = "karborclient.common.apiclient.auth"
mgr = extension.ExtensionManager(ep_namespace)
mgr.map(add_plugin)
@@ -143,8 +143,7 @@ class BaseAuthPlugin(object):
@classmethod
def add_opts(cls, parser):
"""Populate the parser with the options for this plugin.
"""
"""Populate the parser with the options for this plugin."""
for opt in cls.opt_names:
# use `BaseAuthPlugin.common_opt_names` since it is never
# changed in child classes
@@ -153,8 +152,7 @@ class BaseAuthPlugin(object):
@classmethod
def add_common_opts(cls, parser):
"""Add options that are common for several plugins.
"""
"""Add options that are common for several plugins."""
for opt in cls.common_opt_names:
cls._parser_add_opt(parser, opt)
@@ -191,8 +189,7 @@ class BaseAuthPlugin(object):
@abc.abstractmethod
def _do_authenticate(self, http_client):
"""Protected method for authentication.
"""
"""Protected method for authentication."""
def sufficient_options(self):
"""Check if all required options are present.

View File

@@ -31,8 +31,8 @@ from oslo_utils import uuidutils
import six
from six.moves.urllib import parse
from karborclient.common.apiclient import exceptions
from karborclient.i18n import _
from karborclient.openstack.common.apiclient import exceptions
def getid(obj):
@@ -462,8 +462,7 @@ class Resource(object):
@property
def human_id(self):
"""Human-readable ID which can be used for bash completion.
"""
"""Human-readable ID which can be used for bash completion."""
if self.HUMAN_ID:
name = getattr(self, self.NAME_ATTR, None)
if name is not None:
@@ -481,7 +480,7 @@ class Resource(object):
def __getattr__(self, k):
if k not in self.__dict__:
#NOTE(bcwaldon): disallow lazy-loading if already loaded once
# NOTE(bcwaldon): disallow lazy-loading if already loaded once
if not self.is_loaded():
self.get()
return self.__getattr__(k)

View File

@@ -40,7 +40,6 @@ from karborclient.i18n import _
from karborclient.openstack.common.apiclient import exceptions
_logger = logging.getLogger(__name__)
@@ -63,7 +62,7 @@ class HTTPClient(object):
into terminal and send the same request with curl.
"""
user_agent = "karborclient.openstack.common.apiclient"
user_agent = "karborclient.common.apiclient"
def __init__(self,
auth_plugin,
@@ -272,7 +271,7 @@ class HTTPClient(object):
>>> def test_clients():
... from keystoneclient.auth import keystone
... from openstack.common.apiclient import client
... from karborclient.common.apiclient import client
... auth = keystone.KeystoneAuthPlugin(
... username="user", password="pass", tenant_name="tenant",
... auth_url="http://auth:5000/v2.0")
@@ -358,8 +357,7 @@ class BaseClient(object):
"Must be one of: %(version_map)s") % {
'api_name': api_name,
'version': version,
'version_map': ', '.join(version_map.keys())
}
'version_map': ', '.join(version_map.keys())}
raise exceptions.UnsupportedVersion(msg)
return importutils.import_class(client_path)

View File

@@ -28,8 +28,7 @@ from karborclient.i18n import _
class ClientException(Exception):
"""The base exception class for all exceptions this library raises.
"""
"""The base exception class for all exceptions this library raises."""
pass
@@ -107,8 +106,7 @@ class AmbiguousEndpoints(EndpointException):
class HttpError(ClientException):
"""The base exception class for all HTTP exceptions.
"""
"""The base exception class for all HTTP exceptions."""
http_status = 0
message = _("HTTP Error")
@@ -426,7 +424,7 @@ def from_response(response, method, url):
"""
req_id = response.headers.get("x-openstack-request-id")
#NOTE(hdd) true for older versions of nova and cinder
# NOTE(hdd) true for older versions of nova and cinder
if not req_id:
req_id = response.headers.get("x-compute-request-id")
kwargs = {

View File

@@ -30,7 +30,7 @@ import requests
import six
from six.moves.urllib import parse
from karborclient.openstack.common.apiclient import client
from karborclient.common.apiclient import client
def assert_has_keys(dct, required=None, optional=None):
@@ -48,8 +48,7 @@ def assert_has_keys(dct, required=None, optional=None):
class TestResponse(requests.Response):
"""Wrap requests.Response and provide a convenient initialization.
"""
"""Wrap requests.Response and provide a convenient initialization."""
def __init__(self, data):
super(TestResponse, self).__init__()
@@ -86,13 +85,12 @@ class FakeHTTPClient(client.HTTPClient):
def __init__(self, *args, **kwargs):
self.callstack = []
self.fixtures = kwargs.pop("fixtures", None) or {}
if not args and not "auth_plugin" in kwargs:
if not args and "auth_plugin" not in kwargs:
args = (None, )
super(FakeHTTPClient, self).__init__(*args, **kwargs)
def assert_called(self, method, url, body=None, pos=-1):
"""Assert than an API method was just called.
"""
"""Assert than an API method was just called."""
expected = (method, url)
called = self.callstack[pos][0:2]
assert self.callstack, \
@@ -107,8 +105,7 @@ class FakeHTTPClient(client.HTTPClient):
(self.callstack[pos][3], body))
def assert_called_anytime(self, method, url, body=None):
"""Assert than an API method was called anytime in the test.
"""
"""Assert than an API method was called anytime in the test."""
expected = (method, url)
assert self.callstack, \

View File

@@ -20,8 +20,9 @@ import copy
import six
from six.moves.urllib import parse
from karborclient.common.apiclient import exceptions
from karborclient.common import http
from karborclient.openstack.common.apiclient import exceptions
SORT_DIR_VALUES = ('asc', 'desc')
SORT_KEY_VALUES = ('id', 'status', 'name', 'created_at')

View File

@@ -26,7 +26,7 @@ import requests
import six
from six.moves import urllib
from karborclient.openstack.common.apiclient import exceptions as exc
from karborclient.common.apiclient import exceptions as exc
LOG = logging.getLogger(__name__)
USER_AGENT = 'python-karborclient'

View File

@@ -23,7 +23,7 @@ from oslo_utils import importutils
import prettytable
from karborclient.openstack.common.apiclient import exceptions
from karborclient.common.apiclient import exceptions
# Decorator for cli-args

View File

@@ -1,17 +0,0 @@
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import six
six.add_move(six.MovedModule('mox', 'mox', 'mox3.mox'))

View File

@@ -33,8 +33,9 @@ import six.moves.urllib.parse as urlparse
import karborclient
from karborclient import client as karbor_client
from karborclient.common.apiclient import exceptions as exc
from karborclient.common import utils
from karborclient.openstack.common.apiclient import exceptions as exc
logger = logging.getLogger(__name__)

View File

@@ -16,8 +16,8 @@ import socket
import mock
import testtools
from karborclient.common.apiclient import exceptions as exc
from karborclient.common import http
from karborclient.openstack.common.apiclient import exceptions as exc
from karborclient.tests.unit import fakes

View File

@@ -23,7 +23,7 @@ from oslo_log import log
import six
from testtools import matchers
from karborclient.openstack.common.apiclient import exceptions
from karborclient.common.apiclient import exceptions
import karborclient.shell
from karborclient.tests.unit import base

View File

@@ -11,15 +11,15 @@
# under the License.
import argparse
import os
from karborclient.common import base
from karborclient.common import utils
from karborclient.openstack.common.apiclient import exceptions
from oslo_serialization import jsonutils
from oslo_utils import uuidutils
from karborclient.common.apiclient import exceptions
from karborclient.common import base
from karborclient.common import utils
@utils.arg('--all-tenants',
dest='all_tenants',

View File

@@ -1,8 +0,0 @@
[DEFAULT]
# The list of modules to copy from openstack-common
module=apiclient.exceptions
module=apiclient
# The base module to hold the copy of openstack.common
base=karborclient

View File

@@ -37,4 +37,4 @@ commands = oslo_debug_helper {posargs}
show-source = True
ignore = E123,E125
builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools