move old apiclient code out of openstack/common

As part of the first community-wide goal [1], teams were asked
to remove the openstack/common package of their projects
if one existed. This was a byproduct of the old oslo-incubator
form of syncing common functionality.

The package, apiclient, was moved to a top level location
and cliutils was moved to the common module. There are no oslo
specific libraries, the recommended solution is to move it
in tree and maintain it there.

[1] http://governance.openstack.org/goals/ocata/remove-incubated-oslo-code.html

Change-Id: If28f22e5ff6002bef8d9dfc27a694d1100535dc9
This commit is contained in:
Steve Martinelli
2016-11-08 10:11:56 -05:00
parent 8cc2dbde68
commit 43f63e00de
13 changed files with 11 additions and 35 deletions

View File

@@ -31,7 +31,7 @@ from oslo_utils import strutils
import six
from six.moves.urllib import parse
from monascaclient.openstack.common.apiclient import exceptions
from monascaclient.apiclient import exceptions
def getid(obj):
@@ -440,8 +440,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.NAME_ATTR in self.__dict__ and self.HUMAN_ID:
return strutils.to_slug(getattr(self, self.NAME_ATTR))
return None

View File

@@ -28,8 +28,7 @@ import six
class ClientException(Exception):
"""The base exception class for all exceptions this library raises.
"""
"""The base exception class for all exceptions this library raises."""
pass
@@ -102,8 +101,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

@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from monascaclient.openstack.common.apiclient import base
from monascaclient.apiclient import base
class MonascaManager(base.BaseManager):

View File

@@ -1,14 +0,0 @@
# Copyright 2013 OpenStack Foundation
# 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.

View File

@@ -15,8 +15,8 @@
from six.moves.urllib import parse
from monascaclient.apiclient import base
from monascaclient.common import monasca_manager
from monascaclient.openstack.common.apiclient import base
class AlarmDefinitions(base.Resource):

View File

@@ -15,8 +15,8 @@
from six.moves.urllib import parse
from monascaclient.apiclient import base
from monascaclient.common import monasca_manager
from monascaclient.openstack.common.apiclient import base
class Alarms(base.Resource):

View File

@@ -17,8 +17,8 @@ from copy import deepcopy
from six.moves.urllib import parse
from monascaclient.apiclient import base
from monascaclient.common import monasca_manager
from monascaclient.openstack.common.apiclient import base
class Metrics(base.Resource):

View File

@@ -17,8 +17,8 @@ from copy import deepcopy
from six.moves.urllib import parse
from monascaclient.apiclient import base
from monascaclient.common import monasca_manager
from monascaclient.openstack.common.apiclient import base
class Notifications(base.Resource):

View File

@@ -15,8 +15,8 @@
from six.moves.urllib import parse
from monascaclient.apiclient import base
from monascaclient.common import monasca_manager
from monascaclient.openstack.common.apiclient import base
class NotificationTypes(base.Resource):

View File

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

View File

@@ -32,4 +32,4 @@ max-line-length = 120
# H803 git commit title should not end with period
ignore = H302,H803
builtins = _
exclude=.venv,.git,.tox,dist,client_api_example.py,*openstack/common*,*lib/python*,*egg,build
exclude=.venv,.git,.tox,dist,client_api_example.py,*lib/python*,*egg,build