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:
@@ -31,7 +31,7 @@ from oslo_utils import strutils
|
|||||||
import six
|
import six
|
||||||
from six.moves.urllib import parse
|
from six.moves.urllib import parse
|
||||||
|
|
||||||
from monascaclient.openstack.common.apiclient import exceptions
|
from monascaclient.apiclient import exceptions
|
||||||
|
|
||||||
|
|
||||||
def getid(obj):
|
def getid(obj):
|
||||||
@@ -440,8 +440,7 @@ class Resource(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def human_id(self):
|
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:
|
if self.NAME_ATTR in self.__dict__ and self.HUMAN_ID:
|
||||||
return strutils.to_slug(getattr(self, self.NAME_ATTR))
|
return strutils.to_slug(getattr(self, self.NAME_ATTR))
|
||||||
return None
|
return None
|
@@ -28,8 +28,7 @@ import six
|
|||||||
|
|
||||||
|
|
||||||
class ClientException(Exception):
|
class ClientException(Exception):
|
||||||
"""The base exception class for all exceptions this library raises.
|
"""The base exception class for all exceptions this library raises."""
|
||||||
"""
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@@ -102,8 +101,7 @@ class AmbiguousEndpoints(EndpointException):
|
|||||||
|
|
||||||
|
|
||||||
class HttpError(ClientException):
|
class HttpError(ClientException):
|
||||||
"""The base exception class for all HTTP exceptions.
|
"""The base exception class for all HTTP exceptions."""
|
||||||
"""
|
|
||||||
http_status = 0
|
http_status = 0
|
||||||
message = "HTTP Error"
|
message = "HTTP Error"
|
||||||
|
|
@@ -13,7 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from monascaclient.openstack.common.apiclient import base
|
from monascaclient.apiclient import base
|
||||||
|
|
||||||
|
|
||||||
class MonascaManager(base.BaseManager):
|
class MonascaManager(base.BaseManager):
|
||||||
|
@@ -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.
|
|
@@ -15,8 +15,8 @@
|
|||||||
|
|
||||||
from six.moves.urllib import parse
|
from six.moves.urllib import parse
|
||||||
|
|
||||||
|
from monascaclient.apiclient import base
|
||||||
from monascaclient.common import monasca_manager
|
from monascaclient.common import monasca_manager
|
||||||
from monascaclient.openstack.common.apiclient import base
|
|
||||||
|
|
||||||
|
|
||||||
class AlarmDefinitions(base.Resource):
|
class AlarmDefinitions(base.Resource):
|
||||||
|
@@ -15,8 +15,8 @@
|
|||||||
|
|
||||||
from six.moves.urllib import parse
|
from six.moves.urllib import parse
|
||||||
|
|
||||||
|
from monascaclient.apiclient import base
|
||||||
from monascaclient.common import monasca_manager
|
from monascaclient.common import monasca_manager
|
||||||
from monascaclient.openstack.common.apiclient import base
|
|
||||||
|
|
||||||
|
|
||||||
class Alarms(base.Resource):
|
class Alarms(base.Resource):
|
||||||
|
@@ -17,8 +17,8 @@ from copy import deepcopy
|
|||||||
|
|
||||||
from six.moves.urllib import parse
|
from six.moves.urllib import parse
|
||||||
|
|
||||||
|
from monascaclient.apiclient import base
|
||||||
from monascaclient.common import monasca_manager
|
from monascaclient.common import monasca_manager
|
||||||
from monascaclient.openstack.common.apiclient import base
|
|
||||||
|
|
||||||
|
|
||||||
class Metrics(base.Resource):
|
class Metrics(base.Resource):
|
||||||
|
@@ -17,8 +17,8 @@ from copy import deepcopy
|
|||||||
|
|
||||||
from six.moves.urllib import parse
|
from six.moves.urllib import parse
|
||||||
|
|
||||||
|
from monascaclient.apiclient import base
|
||||||
from monascaclient.common import monasca_manager
|
from monascaclient.common import monasca_manager
|
||||||
from monascaclient.openstack.common.apiclient import base
|
|
||||||
|
|
||||||
|
|
||||||
class Notifications(base.Resource):
|
class Notifications(base.Resource):
|
||||||
|
@@ -15,8 +15,8 @@
|
|||||||
|
|
||||||
from six.moves.urllib import parse
|
from six.moves.urllib import parse
|
||||||
|
|
||||||
|
from monascaclient.apiclient import base
|
||||||
from monascaclient.common import monasca_manager
|
from monascaclient.common import monasca_manager
|
||||||
from monascaclient.openstack.common.apiclient import base
|
|
||||||
|
|
||||||
|
|
||||||
class NotificationTypes(base.Resource):
|
class NotificationTypes(base.Resource):
|
||||||
|
@@ -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
|
|
2
tox.ini
2
tox.ini
@@ -32,4 +32,4 @@ max-line-length = 120
|
|||||||
# H803 git commit title should not end with period
|
# H803 git commit title should not end with period
|
||||||
ignore = H302,H803
|
ignore = H302,H803
|
||||||
builtins = _
|
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
|
||||||
|
Reference in New Issue
Block a user