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: I03288adb94c702d1d63df88ef9ba33a2ff59eaa3
This commit is contained in:
ChangBo Guo(gcb) 2016-09-27 18:43:15 +08:00
parent b958b3a1cc
commit c8bb1a2755
44 changed files with 63 additions and 121 deletions

View File

@ -19,10 +19,10 @@ import re
import warnings
import manilaclient
from manilaclient.common._i18n import _
from manilaclient.common import cliutils
from manilaclient.common import constants
from manilaclient import exceptions
from manilaclient.openstack.common._i18n import _
from manilaclient.openstack.common import cliutils
from manilaclient import utils
LOG = logging.getLogger(__name__)

View File

@ -23,8 +23,8 @@ import contextlib
import hashlib
import os
from manilaclient.common import cliutils
from manilaclient import exceptions
from manilaclient.openstack.common import cliutils
from manilaclient import utils

View File

@ -24,7 +24,7 @@ import os
import six
from stevedore import extension
from manilaclient.openstack.common.apiclient import exceptions
from manilaclient.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 = "manilaclient.openstack.common.apiclient.auth"
ep_namespace = "manilaclient.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

@ -30,8 +30,8 @@ from oslo_utils import strutils
import six
from six.moves.urllib import parse
from manilaclient.openstack.common._i18n import _
from manilaclient.openstack.common.apiclient import exceptions
from manilaclient.common._i18n import _
from manilaclient.common.apiclient import exceptions
def getid(obj):
@ -453,8 +453,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:

View File

@ -36,8 +36,8 @@ except ImportError:
from oslo_utils import importutils
import requests
from manilaclient.openstack.common._i18n import _
from manilaclient.openstack.common.apiclient import exceptions
from manilaclient.common._i18n import _
from manilaclient.common.apiclient import exceptions
_logger = logging.getLogger(__name__)
@ -62,7 +62,7 @@ class HTTPClient(object):
into terminal and send the same request with curl.
"""
user_agent = "manilaclient.openstack.common.apiclient"
user_agent = "manilaclient.common.apiclient"
def __init__(self,
auth_plugin,
@ -275,7 +275,7 @@ class HTTPClient(object):
>>> def test_clients():
... from keystoneclient.auth import keystone
... from openstack.common.apiclient import client
... from manilaclient.common.apiclient import client
... auth = keystone.KeystoneAuthPlugin(
... username="user", password="pass", tenant_name="tenant",
... auth_url="http://auth:5000/v2.0")

View File

@ -38,12 +38,11 @@ import sys
import six
from manilaclient.openstack.common._i18n import _
from manilaclient.common._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
@ -118,8 +117,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")

View File

@ -30,7 +30,7 @@ import requests
import six
from six.moves.urllib import parse
from manilaclient.openstack.common.apiclient import client
from manilaclient.common.apiclient import client
def assert_has_keys(dct, required=None, optional=None):
@ -46,8 +46,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,8 +85,7 @@ class FakeHTTPClient(client.HTTPClient):
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, \
@ -103,8 +101,7 @@ class FakeHTTPClient(client.HTTPClient):
def assert_called_anytime(self, method, url, body=None,
clear_callstack=True):
"""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

@ -12,11 +12,11 @@
# under the License.
from oslo_utils import encodeutils
from oslo_utils import uuidutils
import six
from manilaclient.openstack.common._i18n import _
from manilaclient.openstack.common.apiclient import exceptions
from manilaclient.openstack.common import uuidutils
from manilaclient.common._i18n import _
from manilaclient.common.apiclient import exceptions
def find_resource(manager, name_or_id, **find_args):
@ -72,16 +72,12 @@ def find_resource(manager, name_or_id, **find_args):
except exceptions.NotFound:
msg = _("No %(name)s with a name or "
"ID of '%(name_or_id)s' exists.") % \
{
"name": manager.resource_class.__name__.lower(),
"name_or_id": name_or_id
}
{"name": manager.resource_class.__name__.lower(),
"name_or_id": name_or_id}
raise exceptions.CommandError(msg)
except exceptions.NoUniqueMatch:
msg = _("Multiple %(name)s matches found for "
"'%(name_or_id)s', use an ID to be more specific.") % \
{
"name": manager.resource_class.__name__.lower(),
"name_or_id": name_or_id
}
{"name": manager.resource_class.__name__.lower(),
"name_or_id": name_or_id}
raise exceptions.CommandError(msg)

View File

@ -30,7 +30,7 @@ import prettytable
import six
from six import moves
from manilaclient.openstack.common._i18n import _
from manilaclient.common._i18n import _
class MissingArgs(Exception):

View File

@ -17,7 +17,7 @@
Exception definitions.
"""
from manilaclient.openstack.common.apiclient.exceptions import * # noqa
from manilaclient.common.apiclient.exceptions import * # noqa
class NoTokenLookupException(ClientException):

View File

@ -1,37 +0,0 @@
# Copyright (c) 2012 Intel Corporation.
# All Rights Reserved.
#
# 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.
"""
UUID related utilities and helper functions.
"""
import uuid
def generate_uuid():
return str(uuid.uuid4())
def is_uuid_like(val):
"""Returns validation of a value as a UUID.
For our purposes, a UUID is a canonical form string:
aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
"""
try:
return str(uuid.UUID(val)) == val
except (TypeError, ValueError, AttributeError):
return False

View File

@ -34,10 +34,10 @@ import six
from manilaclient import api_versions
from manilaclient import client
from manilaclient.common import cliutils
from manilaclient.common import constants
from manilaclient import exceptions as exc
import manilaclient.extension
from manilaclient.openstack.common import cliutils
from manilaclient.v2 import shell as shell_v2
DEFAULT_OS_SHARE_API_VERSION = api_versions.MAX_VERSION

View File

@ -17,8 +17,8 @@ import mock
import manilaclient
from manilaclient import api_versions
from manilaclient.common import cliutils
from manilaclient import exceptions
from manilaclient.openstack.common import cliutils
from manilaclient.tests.unit import utils

View File

@ -10,8 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from manilaclient.common.apiclient import base as common_base
from manilaclient import exceptions
from manilaclient.openstack.common.apiclient import base as common_base
from manilaclient.tests.unit import utils
from manilaclient.tests.unit.v2 import fakes
from manilaclient.v2 import shares

View File

@ -21,9 +21,9 @@ from tempest.lib.cli import output_parser
from testtools import matchers
import manilaclient
from manilaclient.common import cliutils
from manilaclient.common import constants
from manilaclient import exceptions
from manilaclient.openstack.common import cliutils
from manilaclient import shell
from manilaclient.tests.unit import utils
from manilaclient.tests.unit.v2 import fakes

View File

@ -22,10 +22,10 @@ import six
from six.moves.urllib import parse
from manilaclient import client
from manilaclient.common.apiclient import utils as apiclient_utils
from manilaclient.common import cliutils
from manilaclient.common import constants
from manilaclient import exceptions
from manilaclient.openstack.common.apiclient import utils as apiclient_utils
from manilaclient.openstack.common import cliutils
from manilaclient import shell
from manilaclient.tests.unit import utils as test_utils
from manilaclient.tests.unit.v2 import fakes

View File

@ -15,7 +15,7 @@
from manilaclient import api_versions
from manilaclient import base
from manilaclient.openstack.common.apiclient import base as common_base
from manilaclient.common.apiclient import base as common_base
RESOURCE_PATH_LEGACY = '/os-availability-zone'
RESOURCE_PATH = '/availability-zones'

View File

@ -18,7 +18,7 @@ from six.moves.urllib import parse
from manilaclient import api_versions
from manilaclient import base
from manilaclient.openstack.common.apiclient import base as common_base
from manilaclient.common.apiclient import base as common_base
RESOURCES_PATH = '/cgsnapshots'
RESOURCE_PATH = '/cgsnapshots/%s'

View File

@ -19,7 +19,7 @@ from six.moves.urllib import parse
from manilaclient import api_versions
from manilaclient import base
from manilaclient.openstack.common.apiclient import base as common_base
from manilaclient.common.apiclient import base as common_base
RESOURCES_PATH = '/consistency-groups'
RESOURCE_PATH = '/consistency-groups/%s'

View File

@ -14,8 +14,8 @@
# under the License.
from manilaclient import base
from manilaclient.openstack.common.apiclient import base as common_base
from manilaclient.openstack.common import cliutils
from manilaclient.common.apiclient import base as common_base
from manilaclient.common import cliutils
class ListExtResource(common_base.Resource):

View File

@ -15,7 +15,7 @@
# under the License.
from manilaclient import base
from manilaclient.openstack.common.apiclient import base as common_base
from manilaclient.common.apiclient import base as common_base
class Limits(common_base.Resource):

View File

@ -15,7 +15,7 @@
from manilaclient import api_versions
from manilaclient import base
from manilaclient.openstack.common.apiclient import base as common_base
from manilaclient.common.apiclient import base as common_base
RESOURCE_PATH_LEGACY = '/os-quota-class-sets'
RESOURCE_PATH = '/quota-class-sets'

View File

@ -15,7 +15,7 @@
from manilaclient import api_versions
from manilaclient import base
from manilaclient.openstack.common.apiclient import base as common_base
from manilaclient.common.apiclient import base as common_base
RESOURCE_PATH_LEGACY = '/os-quota-sets'
RESOURCE_PATH = '/quota-sets'

View File

@ -15,7 +15,7 @@
import six.moves.urllib.parse as urlparse
from manilaclient import base
from manilaclient.openstack.common.apiclient import base as common_base
from manilaclient.common.apiclient import base as common_base
RESOURCES_PATH = '/scheduler-stats/pools'

View File

@ -21,8 +21,8 @@ except ImportError:
import six
from manilaclient import base
from manilaclient.common.apiclient import base as common_base
from manilaclient import exceptions
from manilaclient.openstack.common.apiclient import base as common_base
RESOURCES_PATH = '/security-services'
RESOURCE_PATH = "/security-services/%s"

View File

@ -21,7 +21,7 @@ except ImportError:
from manilaclient import api_versions
from manilaclient import base
from manilaclient.openstack.common.apiclient import base as common_base
from manilaclient.common.apiclient import base as common_base
RESOURCE_PATH_LEGACY = '/os-services'
RESOURCE_PATH = '/services'

View File

@ -15,7 +15,7 @@
from manilaclient import api_versions
from manilaclient import base
from manilaclient.openstack.common.apiclient import base as common_base
from manilaclient.common.apiclient import base as common_base
class ShareExportLocation(common_base.Resource):

View File

@ -15,7 +15,7 @@
from manilaclient import api_versions
from manilaclient import base
from manilaclient.openstack.common.apiclient import base as common_base
from manilaclient.common.apiclient import base as common_base
class ShareInstanceExportLocation(common_base.Resource):

View File

@ -15,7 +15,7 @@
from manilaclient import api_versions
from manilaclient import base
from manilaclient.openstack.common.apiclient import base as common_base
from manilaclient.common.apiclient import base as common_base
class ShareInstance(common_base.Resource):

View File

@ -21,8 +21,9 @@ except ImportError:
import six
from manilaclient import base
from manilaclient.common.apiclient import base as common_base
from manilaclient import exceptions
from manilaclient.openstack.common.apiclient import base as common_base
RESOURCES_PATH = '/share-networks'
RESOURCE_PATH = "/share-networks/%s"

View File

@ -15,7 +15,7 @@
from manilaclient import api_versions
from manilaclient import base
from manilaclient.openstack.common.apiclient import base as common_base
from manilaclient.common.apiclient import base as common_base
RESOURCES_PATH = '/share-replicas'
RESOURCE_PATH = '/share-replicas/%s'

View File

@ -20,7 +20,7 @@ except ImportError:
from urllib.parse import urlencode # noqa
from manilaclient import base
from manilaclient.openstack.common.apiclient import base as common_base
from manilaclient.common.apiclient import base as common_base
RESOURCES_PATH = '/share-servers'
RESOURCE_PATH = '/share-servers/%s'

View File

@ -15,7 +15,7 @@
from manilaclient import api_versions
from manilaclient import base
from manilaclient.openstack.common.apiclient import base as common_base
from manilaclient.common.apiclient import base as common_base
class ShareSnapshotInstance(common_base.Resource):

View File

@ -21,8 +21,8 @@ except ImportError:
from manilaclient import api_versions
from manilaclient import base
from manilaclient.common.apiclient import base as common_base
from manilaclient.common import constants
from manilaclient.openstack.common.apiclient import base as common_base
class ShareSnapshot(common_base.Resource):

View File

@ -16,7 +16,7 @@
from manilaclient import api_versions
from manilaclient import base
from manilaclient.openstack.common.apiclient import base as common_base
from manilaclient.common.apiclient import base as common_base
class ShareTypeAccess(common_base.Resource):

View File

@ -20,8 +20,8 @@ Share Type interface.
from manilaclient import api_versions
from manilaclient import base
from manilaclient.common.apiclient import base as common_base
from manilaclient import exceptions
from manilaclient.openstack.common.apiclient import base as common_base
class ShareType(common_base.Resource):

View File

@ -24,9 +24,9 @@ except ImportError:
from manilaclient import api_versions
from manilaclient import base
from manilaclient.common.apiclient import base as common_base
from manilaclient.common import constants
from manilaclient import exceptions
from manilaclient.openstack.common.apiclient import base as common_base
from manilaclient.v2 import share_instances

View File

@ -24,10 +24,10 @@ from oslo_utils import strutils
import six
from manilaclient import api_versions
from manilaclient.common.apiclient import utils as apiclient_utils
from manilaclient.common import cliutils
from manilaclient.common import constants
from manilaclient import exceptions
from manilaclient.openstack.common.apiclient import utils as apiclient_utils
from manilaclient.openstack.common import cliutils
from manilaclient.v2 import quotas

View File

@ -1,9 +0,0 @@
[DEFAULT]
# The list of modules to copy from openstack-common
module=apiclient
module=cliutils
module=uuidutils
# The base module to hold the copy of openstack.common
base=manilaclient

View File

@ -65,4 +65,4 @@ commands = python setup.py testr --coverage --testr-args='{posargs}'
# F821: undefined name
ignore = F821
builtins = _
exclude = .venv,.tox,dist,doc,openstack,*egg
exclude = .venv,.tox,dist,doc,*egg