From 693b93d77f353cfb0cce9810b0cb82bd0184a841 Mon Sep 17 00:00:00 2001 From: liusheng Date: Tue, 3 Jan 2017 17:16:14 +0800 Subject: [PATCH] Rename nimbleclient to moganclient We have decided to rename nimble to mogan because of name conflict, now we need also to rename nimbleclient to moganclient. Change-Id: Ibf9480d73bbabf8d3e2b92f9609b22b3b713b3db --- .coveragerc | 2 +- CONTRIBUTING.rst | 2 +- HACKING.rst | 4 +- README.rst | 12 +-- doc/source/conf.py | 2 +- doc/source/index.rst | 6 +- doc/source/installation.rst | 6 +- doc/source/usage.rst | 4 +- {nimbleclient => moganclient}/__init__.py | 2 +- .../common/__init__.py | 0 {nimbleclient => moganclient}/common/base.py | 2 +- .../common/exceptions.py | 2 +- {nimbleclient => moganclient}/common/http.py | 10 +-- {nimbleclient => moganclient}/common/i18n.py | 2 +- {nimbleclient => moganclient}/common/utils.py | 2 +- {nimbleclient => moganclient}/osc/__init__.py | 0 {nimbleclient => moganclient}/osc/plugin.py | 10 +-- .../osc/v1/__init__.py | 0 .../osc/v1/availability_zone.py | 2 +- .../osc/v1/flavor.py | 6 +- .../osc/v1/server.py | 4 +- .../tests/__init__.py | 0 .../tests/functional/__init__.py | 0 .../tests/functional/base.py | 0 .../tests/unit/__init__.py | 0 .../tests/unit/base.py | 2 +- .../tests/unit/common/__init__.py | 0 .../tests/unit/common/test_base.py | 8 +- .../tests/unit/common/test_exceptions.py | 4 +- .../tests/unit/common/test_http.py | 76 +++++++++---------- .../tests/unit/common/test_utils.py | 4 +- .../tests/unit/fakes.py | 8 +- .../tests/unit/osc/__init__.py | 0 .../tests/unit/osc/test_plugin.py | 16 ++-- .../tests/unit/osc/v1/__init__.py | 0 .../unit/osc/v1/test_availability_zone.py | 6 +- .../tests/unit/osc/v1/test_flavor.py | 10 +-- .../tests/unit/osc/v1/test_server.py | 8 +- {nimbleclient => moganclient}/v1/__init__.py | 0 .../v1/availability_zone.py | 2 +- {nimbleclient => moganclient}/v1/client.py | 12 +-- {nimbleclient => moganclient}/v1/flavor.py | 2 +- {nimbleclient => moganclient}/v1/server.py | 2 +- releasenotes/source/conf.py | 2 +- releasenotes/source/index.rst | 6 +- setup.cfg | 46 +++++------ tox.ini | 2 +- 47 files changed, 148 insertions(+), 148 deletions(-) rename {nimbleclient => moganclient}/__init__.py (93%) rename {nimbleclient => moganclient}/common/__init__.py (100%) rename {nimbleclient => moganclient}/common/base.py (99%) rename {nimbleclient => moganclient}/common/exceptions.py (99%) rename {nimbleclient => moganclient}/common/http.py (98%) rename {nimbleclient => moganclient}/common/i18n.py (94%) rename {nimbleclient => moganclient}/common/utils.py (96%) rename {nimbleclient => moganclient}/osc/__init__.py (100%) rename {nimbleclient => moganclient}/osc/plugin.py (89%) rename {nimbleclient => moganclient}/osc/v1/__init__.py (100%) rename {nimbleclient => moganclient}/osc/v1/availability_zone.py (94%) rename {nimbleclient => moganclient}/osc/v1/flavor.py (98%) rename {nimbleclient => moganclient}/osc/v1/server.py (99%) rename {nimbleclient => moganclient}/tests/__init__.py (100%) rename {nimbleclient => moganclient}/tests/functional/__init__.py (100%) rename {nimbleclient => moganclient}/tests/functional/base.py (100%) rename {nimbleclient => moganclient}/tests/unit/__init__.py (100%) rename {nimbleclient => moganclient}/tests/unit/base.py (96%) rename {nimbleclient => moganclient}/tests/unit/common/__init__.py (100%) rename {nimbleclient => moganclient}/tests/unit/common/test_base.py (98%) rename {nimbleclient => moganclient}/tests/unit/common/test_exceptions.py (97%) rename {nimbleclient => moganclient}/tests/unit/common/test_http.py (92%) rename {nimbleclient => moganclient}/tests/unit/common/test_utils.py (95%) rename {nimbleclient => moganclient}/tests/unit/fakes.py (98%) rename {nimbleclient => moganclient}/tests/unit/osc/__init__.py (100%) rename {nimbleclient => moganclient}/tests/unit/osc/test_plugin.py (86%) rename {nimbleclient => moganclient}/tests/unit/osc/v1/__init__.py (100%) rename {nimbleclient => moganclient}/tests/unit/osc/v1/test_availability_zone.py (90%) rename {nimbleclient => moganclient}/tests/unit/osc/v1/test_flavor.py (98%) rename {nimbleclient => moganclient}/tests/unit/osc/v1/test_server.py (99%) rename {nimbleclient => moganclient}/v1/__init__.py (100%) rename {nimbleclient => moganclient}/v1/availability_zone.py (95%) rename {nimbleclient => moganclient}/v1/client.py (79%) rename {nimbleclient => moganclient}/v1/flavor.py (98%) rename {nimbleclient => moganclient}/v1/server.py (98%) diff --git a/.coveragerc b/.coveragerc index 6d1a824..b814104 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,6 +1,6 @@ [run] branch = True -source = nimbleclient +source = moganclient [report] ignore_errors = True diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 7e826ae..5b04b52 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -14,4 +14,4 @@ Pull requests submitted through GitHub will be ignored. Bugs should be filed on Launchpad, not GitHub: - https://bugs.launchpad.net/python-nimbleclient + https://bugs.launchpad.net/python-moganclient diff --git a/HACKING.rst b/HACKING.rst index 5453f38..c2935d5 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -1,4 +1,4 @@ -python-nimbleclient Style Commandments -====================================== +python-moganclient Style Commandments +===================================== Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/ diff --git a/README.rst b/README.rst index 4de1788..0cf0b73 100644 --- a/README.rst +++ b/README.rst @@ -1,17 +1,17 @@ -=================== -python-nimbleclient -=================== +================== +python-moganclient +================== -Python client library for OpenStack Nimble project. +Python client library for OpenStack Mogan project. Please fill here a long description which must be at least 3 lines wrapped on 80 cols, so that distribution package maintainers can use it in their packages. Note that this is a hard requirement. * Free software: Apache license -* Documentation: http://docs.openstack.org/developer/python-nimbleclient +* Documentation: http://docs.openstack.org/developer/python-moganclient * Source: http://git.openstack.org/cgit/openstack/python-nimbleclient -* Bugs: http://bugs.launchpad.net/python-nimbleclient +* Bugs: http://bugs.launchpad.net/python-moganclient Features -------- diff --git a/doc/source/conf.py b/doc/source/conf.py index c308fe2..ae0b58d 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -39,7 +39,7 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = u'python-nimbleclient' +project = u'python-moganclient' copyright = u'2016, OpenStack Foundation' # If true, '()' will be appended to :func: etc. cross-reference text. diff --git a/doc/source/index.rst b/doc/source/index.rst index 2f5b237..2ee28ef 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -1,10 +1,10 @@ -.. python-nimbleclient documentation master file, created by +.. python-moganclient documentation master file, created by sphinx-quickstart on Tue Jul 9 22:26:36 2013. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to python-nimbleclient's documentation! -=============================================== +Welcome to python-moganclient's documentation! +============================================== Contents: diff --git a/doc/source/installation.rst b/doc/source/installation.rst index 96b718a..e0f2316 100644 --- a/doc/source/installation.rst +++ b/doc/source/installation.rst @@ -4,9 +4,9 @@ Installation At the command line:: - $ pip install python-nimbleclient + $ pip install python-moganclient Or, if you have virtualenvwrapper installed:: - $ mkvirtualenv python-nimbleclient - $ pip install python-nimbleclient + $ mkvirtualenv python-moganclient + $ pip install python-moganclient diff --git a/doc/source/usage.rst b/doc/source/usage.rst index 243327a..f1eeb0a 100644 --- a/doc/source/usage.rst +++ b/doc/source/usage.rst @@ -2,6 +2,6 @@ Usage ===== -To use python-nimbleclient in a project:: +To use python-moganclient in a project:: - import nimbleclient + import moganclient diff --git a/nimbleclient/__init__.py b/moganclient/__init__.py similarity index 93% rename from nimbleclient/__init__.py rename to moganclient/__init__.py index 2bf90ff..26f88ae 100644 --- a/nimbleclient/__init__.py +++ b/moganclient/__init__.py @@ -18,4 +18,4 @@ import pbr.version __version__ = pbr.version.VersionInfo( - 'python-nimbleclient').version_string() + 'python-moganclient').version_string() diff --git a/nimbleclient/common/__init__.py b/moganclient/common/__init__.py similarity index 100% rename from nimbleclient/common/__init__.py rename to moganclient/common/__init__.py diff --git a/nimbleclient/common/base.py b/moganclient/common/base.py similarity index 99% rename from nimbleclient/common/base.py rename to moganclient/common/base.py index 7e8ffe8..88708f1 100644 --- a/nimbleclient/common/base.py +++ b/moganclient/common/base.py @@ -23,7 +23,7 @@ import copy from requests import Response import six -from nimbleclient.common import exceptions +from moganclient.common import exceptions def getid(obj): diff --git a/nimbleclient/common/exceptions.py b/moganclient/common/exceptions.py similarity index 99% rename from nimbleclient/common/exceptions.py rename to moganclient/common/exceptions.py index 70cab5f..8208c6e 100644 --- a/nimbleclient/common/exceptions.py +++ b/moganclient/common/exceptions.py @@ -19,7 +19,7 @@ import sys from oslo_serialization import jsonutils import six -from nimbleclient.common.i18n import _ +from moganclient.common.i18n import _ class ClientException(Exception): diff --git a/nimbleclient/common/http.py b/moganclient/common/http.py similarity index 98% rename from nimbleclient/common/http.py rename to moganclient/common/http.py index aa10b4b..b518af2 100644 --- a/nimbleclient/common/http.py +++ b/moganclient/common/http.py @@ -27,14 +27,14 @@ import requests import six from six.moves.urllib import parse -from nimbleclient.common import exceptions as exc -from nimbleclient.common.i18n import _ -from nimbleclient.common.i18n import _LW -from nimbleclient.common import utils +from moganclient.common import exceptions as exc +from moganclient.common.i18n import _ +from moganclient.common.i18n import _LW +from moganclient.common import utils LOG = logging.getLogger(__name__) -USER_AGENT = 'python-nimbleclient' +USER_AGENT = 'python-moganclient' CHUNKSIZE = 1024 * 64 # 64kB SENSITIVE_HEADERS = ('X-Auth-Token',) osprofiler_web = importutils.try_import('osprofiler.web') diff --git a/nimbleclient/common/i18n.py b/moganclient/common/i18n.py similarity index 94% rename from nimbleclient/common/i18n.py rename to moganclient/common/i18n.py index 7788abb..b755a35 100644 --- a/nimbleclient/common/i18n.py +++ b/moganclient/common/i18n.py @@ -15,7 +15,7 @@ import oslo_i18n -_translators = oslo_i18n.TranslatorFactory(domain='nimbleclient') +_translators = oslo_i18n.TranslatorFactory(domain='moganclient') # The primary translation function using the well-known name "_" _ = _translators.primary diff --git a/nimbleclient/common/utils.py b/moganclient/common/utils.py similarity index 96% rename from nimbleclient/common/utils.py rename to moganclient/common/utils.py index 30c44cd..9e26075 100644 --- a/nimbleclient/common/utils.py +++ b/moganclient/common/utils.py @@ -15,7 +15,7 @@ import logging -from nimbleclient.common.i18n import _LE +from moganclient.common.i18n import _LE LOG = logging.getLogger(__name__) diff --git a/nimbleclient/osc/__init__.py b/moganclient/osc/__init__.py similarity index 100% rename from nimbleclient/osc/__init__.py rename to moganclient/osc/__init__.py diff --git a/nimbleclient/osc/plugin.py b/moganclient/osc/plugin.py similarity index 89% rename from nimbleclient/osc/plugin.py rename to moganclient/osc/plugin.py index 23552c5..3aec092 100644 --- a/nimbleclient/osc/plugin.py +++ b/moganclient/osc/plugin.py @@ -17,7 +17,7 @@ import logging from osc_lib import utils -from nimbleclient.common.i18n import _ +from moganclient.common.i18n import _ LOG = logging.getLogger(__name__) @@ -25,17 +25,17 @@ DEFAULT_BAREMETAL_COMPUTE_API_VERSION = '1' API_VERSION_OPTION = 'os_baremetal_compute_api_version' API_NAME = 'baremetal_compute' API_VERSIONS = { - '1': 'nimbleclient.v1.client.Client', + '1': 'moganclient.v1.client.Client', } def make_client(instance): """Returns an baremetal service client""" - nimble_client = utils.get_client_class( + mogan_client = utils.get_client_class( API_NAME, instance._api_version[API_NAME], API_VERSIONS) - LOG.debug('Instantiating baremetal-compute client: %s', nimble_client) + LOG.debug('Instantiating baremetal-compute client: %s', mogan_client) endpoint = instance.get_endpoint_for_service_type( API_NAME, @@ -53,7 +53,7 @@ def make_client(instance): else: kwargs.update(token=instance.auth_ref.auth_token) - client = nimble_client(**kwargs) + client = mogan_client(**kwargs) return client diff --git a/nimbleclient/osc/v1/__init__.py b/moganclient/osc/v1/__init__.py similarity index 100% rename from nimbleclient/osc/v1/__init__.py rename to moganclient/osc/v1/__init__.py diff --git a/nimbleclient/osc/v1/availability_zone.py b/moganclient/osc/v1/availability_zone.py similarity index 94% rename from nimbleclient/osc/v1/availability_zone.py rename to moganclient/osc/v1/availability_zone.py index b129d60..0591a9f 100644 --- a/nimbleclient/osc/v1/availability_zone.py +++ b/moganclient/osc/v1/availability_zone.py @@ -14,7 +14,7 @@ # -"""Nimble v1 availability zone action implementations""" +"""Mogan v1 availability zone action implementations""" import logging diff --git a/nimbleclient/osc/v1/flavor.py b/moganclient/osc/v1/flavor.py similarity index 98% rename from nimbleclient/osc/v1/flavor.py rename to moganclient/osc/v1/flavor.py index 1da93c0..061603a 100644 --- a/nimbleclient/osc/v1/flavor.py +++ b/moganclient/osc/v1/flavor.py @@ -14,7 +14,7 @@ # -"""Nimble v1 Baremetal flavor action implementations""" +"""Mogan v1 Baremetal flavor action implementations""" import copy import logging @@ -25,8 +25,8 @@ from osc_lib import exceptions from osc_lib import utils import six -from nimbleclient.common import base -from nimbleclient.common.i18n import _ +from moganclient.common import base +from moganclient.common.i18n import _ LOG = logging.getLogger(__name__) diff --git a/nimbleclient/osc/v1/server.py b/moganclient/osc/v1/server.py similarity index 99% rename from nimbleclient/osc/v1/server.py rename to moganclient/osc/v1/server.py index e296daf..82f5346 100644 --- a/nimbleclient/osc/v1/server.py +++ b/moganclient/osc/v1/server.py @@ -14,7 +14,7 @@ # -"""Nimble v1 Baremetal server action implementations""" +"""Mogan v1 Baremetal server action implementations""" import logging @@ -24,7 +24,7 @@ from osc_lib import exceptions from osc_lib import utils import six -from nimbleclient.common.i18n import _ +from moganclient.common.i18n import _ LOG = logging.getLogger(__name__) diff --git a/nimbleclient/tests/__init__.py b/moganclient/tests/__init__.py similarity index 100% rename from nimbleclient/tests/__init__.py rename to moganclient/tests/__init__.py diff --git a/nimbleclient/tests/functional/__init__.py b/moganclient/tests/functional/__init__.py similarity index 100% rename from nimbleclient/tests/functional/__init__.py rename to moganclient/tests/functional/__init__.py diff --git a/nimbleclient/tests/functional/base.py b/moganclient/tests/functional/base.py similarity index 100% rename from nimbleclient/tests/functional/base.py rename to moganclient/tests/functional/base.py diff --git a/nimbleclient/tests/unit/__init__.py b/moganclient/tests/unit/__init__.py similarity index 100% rename from nimbleclient/tests/unit/__init__.py rename to moganclient/tests/unit/__init__.py diff --git a/nimbleclient/tests/unit/base.py b/moganclient/tests/unit/base.py similarity index 96% rename from nimbleclient/tests/unit/base.py rename to moganclient/tests/unit/base.py index 85d0477..a7f3a38 100644 --- a/nimbleclient/tests/unit/base.py +++ b/moganclient/tests/unit/base.py @@ -16,7 +16,7 @@ from osc_lib.tests import utils -from nimbleclient.tests.unit import fakes +from moganclient.tests.unit import fakes class TestBase(utils.TestCommand): diff --git a/nimbleclient/tests/unit/common/__init__.py b/moganclient/tests/unit/common/__init__.py similarity index 100% rename from nimbleclient/tests/unit/common/__init__.py rename to moganclient/tests/unit/common/__init__.py diff --git a/nimbleclient/tests/unit/common/test_base.py b/moganclient/tests/unit/common/test_base.py similarity index 98% rename from nimbleclient/tests/unit/common/test_base.py rename to moganclient/tests/unit/common/test_base.py index 3b4fb8c..24c6d1f 100644 --- a/nimbleclient/tests/unit/common/test_base.py +++ b/moganclient/tests/unit/common/test_base.py @@ -18,10 +18,10 @@ import copy import mock import six -from nimbleclient.common import base -from nimbleclient.common import exceptions -from nimbleclient.tests.unit import base as test_base -from nimbleclient.tests.unit import fakes +from moganclient.common import base +from moganclient.common import exceptions +from moganclient.tests.unit import base as test_base +from moganclient.tests.unit import fakes class TestResource(test_base.TestBase): diff --git a/nimbleclient/tests/unit/common/test_exceptions.py b/moganclient/tests/unit/common/test_exceptions.py similarity index 97% rename from nimbleclient/tests/unit/common/test_exceptions.py rename to moganclient/tests/unit/common/test_exceptions.py index e15f358..8ca80ad 100644 --- a/nimbleclient/tests/unit/common/test_exceptions.py +++ b/moganclient/tests/unit/common/test_exceptions.py @@ -15,8 +15,8 @@ import mock -from nimbleclient.common import exceptions as exc -from nimbleclient.tests.unit import base +from moganclient.common import exceptions as exc +from moganclient.tests.unit import base class TestHTTPExceptions(base.TestBase): diff --git a/nimbleclient/tests/unit/common/test_http.py b/moganclient/tests/unit/common/test_http.py similarity index 92% rename from nimbleclient/tests/unit/common/test_http.py rename to moganclient/tests/unit/common/test_http.py index 29d74d6..824c1dc 100644 --- a/nimbleclient/tests/unit/common/test_http.py +++ b/moganclient/tests/unit/common/test_http.py @@ -22,21 +22,21 @@ from osc_lib.tests import fakes as osc_fakes from oslo_serialization import jsonutils import six -from nimbleclient.common import exceptions as exc -from nimbleclient.common import http -from nimbleclient.common import utils -from nimbleclient.tests.unit import base -from nimbleclient.tests.unit import fakes +from moganclient.common import exceptions as exc +from moganclient.common import http +from moganclient.common import utils +from moganclient.tests.unit import base +from moganclient.tests.unit import fakes -@mock.patch('nimbleclient.common.http.requests.request') +@mock.patch('moganclient.common.http.requests.request') class TestHttpClient(base.TestBase): def setUp(self): super(TestHttpClient, self).setUp() def test_http_raw_request(self, mock_request): - headers = {'User-Agent': 'python-nimbleclient', + headers = {'User-Agent': 'python-moganclient', 'Content-Type': 'application/octet-stream'} mock_request.return_value = fakes.FakeHTTPResponse(200, 'OK', {}, '') client = http.HTTPClient('http://example.com:6688') @@ -71,17 +71,17 @@ class TestHttpClient(base.TestBase): mock_request.assert_has_calls([ mock.call('GET', 'http://example.com:6688', allow_redirects=False, - headers={'User-Agent': 'python-nimbleclient', + headers={'User-Agent': 'python-moganclient', 'Content-Type': 'application/octet-stream'}), mock.call('GET', 'http://example.com:6688', allow_redirects=False, - headers={'User-Agent': 'python-nimbleclient', + headers={'User-Agent': 'python-moganclient', 'X-Auth-Key': osc_fakes.PASSWORD, 'X-Auth-User': osc_fakes.USERNAME, 'Content-Type': 'application/octet-stream'}), mock.call('GET', 'http://example.com:6688', allow_redirects=False, - headers={'User-Agent': 'python-nimbleclient', + headers={'User-Agent': 'python-moganclient', 'X-Auth-Token': osc_fakes.AUTH_TOKEN, 'Content-Type': 'application/octet-stream'}) ]) @@ -100,7 +100,7 @@ class TestHttpClient(base.TestBase): 'GET', 'http://example.com:6688', allow_redirects=False, headers={'X-Region-Name': osc_fakes.REGION_NAME, - 'User-Agent': 'python-nimbleclient', + 'User-Agent': 'python-moganclient', 'Content-Type': 'application/octet-stream'}) def test_http_json_request(self, mock_request): @@ -118,7 +118,7 @@ class TestHttpClient(base.TestBase): allow_redirects=False, headers={'Content-Type': 'application/json', 'Accept': 'application/json', - 'User-Agent': 'python-nimbleclient'}) + 'User-Agent': 'python-moganclient'}) def test_http_json_request_argument_passed_to_requests(self, mock_request): """Check that we have sent the proper arguments to requests.""" @@ -144,7 +144,7 @@ class TestHttpClient(base.TestBase): headers={'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Url': osc_fakes.AUTH_URL, - 'User-Agent': 'python-nimbleclient'}) + 'User-Agent': 'python-moganclient'}) def test_http_json_request_w_req_body(self, mock_request): # Record a 200 @@ -161,7 +161,7 @@ class TestHttpClient(base.TestBase): allow_redirects=False, headers={'Content-Type': 'application/json', 'Accept': 'application/json', - 'User-Agent': 'python-nimbleclient'}) + 'User-Agent': 'python-moganclient'}) def test_http_json_request_non_json_resp_cont_type(self, mock_request): # Record a 200 @@ -177,7 +177,7 @@ class TestHttpClient(base.TestBase): allow_redirects=False, headers={'Content-Type': 'application/json', 'Accept': 'application/json', - 'User-Agent': 'python-nimbleclient'}) + 'User-Agent': 'python-moganclient'}) def test_http_json_request_invalid_json(self, mock_request): # Record a 200 @@ -193,7 +193,7 @@ class TestHttpClient(base.TestBase): allow_redirects=False, headers={'Content-Type': 'application/json', 'Accept': 'application/json', - 'User-Agent': 'python-nimbleclient'}) + 'User-Agent': 'python-moganclient'}) def test_http_json_request_redirect_delete(self, mock_request): mock_request.side_effect = [ @@ -215,12 +215,12 @@ class TestHttpClient(base.TestBase): allow_redirects=False, headers={'Content-Type': 'application/json', 'Accept': 'application/json', - 'User-Agent': 'python-nimbleclient'}), + 'User-Agent': 'python-moganclient'}), mock.call('DELETE', 'http://example.com:6688/foo/bar', allow_redirects=False, headers={'Content-Type': 'application/json', 'Accept': 'application/json', - 'User-Agent': 'python-nimbleclient'}) + 'User-Agent': 'python-moganclient'}) ]) def test_http_json_request_redirect_post(self, mock_request): @@ -243,12 +243,12 @@ class TestHttpClient(base.TestBase): allow_redirects=False, headers={'Content-Type': 'application/json', 'Accept': 'application/json', - 'User-Agent': 'python-nimbleclient'}), + 'User-Agent': 'python-moganclient'}), mock.call('POST', 'http://example.com:6688/foo/bar', allow_redirects=False, headers={'Content-Type': 'application/json', 'Accept': 'application/json', - 'User-Agent': 'python-nimbleclient'}) + 'User-Agent': 'python-moganclient'}) ]) def test_http_json_request_redirect_put(self, mock_request): @@ -271,12 +271,12 @@ class TestHttpClient(base.TestBase): allow_redirects=False, headers={'Content-Type': 'application/json', 'Accept': 'application/json', - 'User-Agent': 'python-nimbleclient'}), + 'User-Agent': 'python-moganclient'}), mock.call('PUT', 'http://example.com:6688/foo/bar', allow_redirects=False, headers={'Content-Type': 'application/json', 'Accept': 'application/json', - 'User-Agent': 'python-nimbleclient'}) + 'User-Agent': 'python-moganclient'}) ]) def test_http_json_request_redirect_diff_location(self, mock_request): @@ -299,12 +299,12 @@ class TestHttpClient(base.TestBase): allow_redirects=False, headers={'Content-Type': 'application/json', 'Accept': 'application/json', - 'User-Agent': 'python-nimbleclient'}), + 'User-Agent': 'python-moganclient'}), mock.call('PUT', 'http://example.com:6688/diff_lcation', allow_redirects=False, headers={'Content-Type': 'application/json', 'Accept': 'application/json', - 'User-Agent': 'python-nimbleclient'}) + 'User-Agent': 'python-moganclient'}) ]) def test_http_json_request_redirect_error_without_location(self, @@ -319,7 +319,7 @@ class TestHttpClient(base.TestBase): allow_redirects=False, headers={'Content-Type': 'application/json', 'Accept': 'application/json', - 'User-Agent': 'python-nimbleclient'}) + 'User-Agent': 'python-moganclient'}) def test_http_json_request_redirect_get(self, mock_request): # Record the 302 @@ -343,12 +343,12 @@ class TestHttpClient(base.TestBase): allow_redirects=False, headers={'Content-Type': 'application/json', 'Accept': 'application/json', - 'User-Agent': 'python-nimbleclient'}), + 'User-Agent': 'python-moganclient'}), mock.call('GET', 'http://example.com:6688', allow_redirects=False, headers={'Content-Type': 'application/json', 'Accept': 'application/json', - 'User-Agent': 'python-nimbleclient'}) + 'User-Agent': 'python-moganclient'}) ]) def test_http_404_json_request(self, mock_request): @@ -365,7 +365,7 @@ class TestHttpClient(base.TestBase): allow_redirects=False, headers={'Content-Type': 'application/json', 'Accept': 'application/json', - 'User-Agent': 'python-nimbleclient'}) + 'User-Agent': 'python-moganclient'}) def test_http_300_json_request(self, mock_request): mock_request.return_value = fakes.FakeHTTPResponse( @@ -382,12 +382,12 @@ class TestHttpClient(base.TestBase): allow_redirects=False, headers={'Content-Type': 'application/json', 'Accept': 'application/json', - 'User-Agent': 'python-nimbleclient'}) + 'User-Agent': 'python-moganclient'}) def test_fake_json_request(self, mock_request): headers = {'Content-Type': 'application/json', 'Accept': 'application/json', - 'User-Agent': 'python-nimbleclient'} + 'User-Agent': 'python-moganclient'} mock_request.side_effect = [socket.gaierror] client = http.HTTPClient('fake://example.com:6688') @@ -400,7 +400,7 @@ class TestHttpClient(base.TestBase): def test_http_request_socket_error(self, mock_request): headers = {'Content-Type': 'application/json', 'Accept': 'application/json', - 'User-Agent': 'python-nimbleclient'} + 'User-Agent': 'python-moganclient'} mock_request.side_effect = [socket.error] client = http.HTTPClient('http://example.com:6688') @@ -413,7 +413,7 @@ class TestHttpClient(base.TestBase): def test_http_request_socket_timeout(self, mock_request): headers = {'Content-Type': 'application/json', 'Accept': 'application/json', - 'User-Agent': 'python-nimbleclient'} + 'User-Agent': 'python-moganclient'} mock_request.side_effect = [socket.timeout] client = http.HTTPClient('http://example.com:6688') @@ -436,7 +436,7 @@ class TestHttpClient(base.TestBase): allow_redirects=False, headers={'Content-Type': 'application/json', 'Accept': 'application/json', - 'User-Agent': 'python-nimbleclient'}, + 'User-Agent': 'python-moganclient'}, timeout=float(123)) def test_get_system_ca_file(self, mock_request): @@ -457,7 +457,7 @@ class TestHttpClient(base.TestBase): client = http.HTTPClient('https://foo', ca_file="NOWHERE") self.assertEqual("NOWHERE", client.verify_cert) - with mock.patch('nimbleclient.common.http.get_system_ca_file') as gsf: + with mock.patch('moganclient.common.http.get_system_ca_file') as gsf: gsf.return_value = "SOMEWHERE" client = http.HTTPClient('https://foo') self.assertEqual("SOMEWHERE", client.verify_cert) @@ -541,7 +541,7 @@ class TestSessionClient(base.TestBase): self.assertEqual(('', 'GET'), self.request.call_args_list[0][0]) self.assertEqual(('ishere', 'GET'), self.request.call_args_list[1][0]) for call in self.request.call_args_list: - self.assertEqual({'user_agent': 'python-nimbleclient', + self.assertEqual({'user_agent': 'python-moganclient', 'raise_exc': False, 'redirect': True}, call[1]) @@ -567,7 +567,7 @@ class TestSessionClient(base.TestBase): self.assertEqual(('http://no.where/ishere', 'GET'), self.request.call_args_list[1][0]) for call in self.request.call_args_list: - self.assertEqual({'user_agent': 'python-nimbleclient', + self.assertEqual({'user_agent': 'python-moganclient', 'raise_exc': False, 'redirect': True}, call[1]) @@ -634,7 +634,7 @@ class TestSessionClient(base.TestBase): self.assertEqual({'endpoint_override': 'http://no.where/', 'json': 'some_data', - 'user_agent': 'python-nimbleclient', + 'user_agent': 'python-moganclient', 'raise_exc': False}, self.request.call_args[1]) self.assertEqual(200, resp.status_code) self.assertEqual({}, body) @@ -656,7 +656,7 @@ class TestSessionClient(base.TestBase): self.assertEqual({'endpoint_override': 'http://no.where/', 'json': {'files': data}, - 'user_agent': 'python-nimbleclient', + 'user_agent': 'python-moganclient', 'raise_exc': False}, self.request.call_args[1]) self.assertEqual(200, resp.status_code) self.assertEqual({}, body) diff --git a/nimbleclient/tests/unit/common/test_utils.py b/moganclient/tests/unit/common/test_utils.py similarity index 95% rename from nimbleclient/tests/unit/common/test_utils.py rename to moganclient/tests/unit/common/test_utils.py index 5fced44..13aeb86 100644 --- a/nimbleclient/tests/unit/common/test_utils.py +++ b/moganclient/tests/unit/common/test_utils.py @@ -15,8 +15,8 @@ import mock -from nimbleclient.common import utils -from nimbleclient.tests.unit import base +from moganclient.common import utils +from moganclient.tests.unit import base class TestUtils(base.TestBase): diff --git a/nimbleclient/tests/unit/fakes.py b/moganclient/tests/unit/fakes.py similarity index 98% rename from nimbleclient/tests/unit/fakes.py rename to moganclient/tests/unit/fakes.py index f348885..aaeaa58 100644 --- a/nimbleclient/tests/unit/fakes.py +++ b/moganclient/tests/unit/fakes.py @@ -20,10 +20,10 @@ import mock from oslo_serialization import jsonutils from requests import Response -from nimbleclient.common import base -from nimbleclient.v1 import availability_zone -from nimbleclient.v1 import flavor -from nimbleclient.v1 import server +from moganclient.common import base +from moganclient.v1 import availability_zone +from moganclient.v1 import flavor +from moganclient.v1 import server # fake request id diff --git a/nimbleclient/tests/unit/osc/__init__.py b/moganclient/tests/unit/osc/__init__.py similarity index 100% rename from nimbleclient/tests/unit/osc/__init__.py rename to moganclient/tests/unit/osc/__init__.py diff --git a/nimbleclient/tests/unit/osc/test_plugin.py b/moganclient/tests/unit/osc/test_plugin.py similarity index 86% rename from nimbleclient/tests/unit/osc/test_plugin.py rename to moganclient/tests/unit/osc/test_plugin.py index 0c595d9..c392d64 100644 --- a/nimbleclient/tests/unit/osc/test_plugin.py +++ b/moganclient/tests/unit/osc/test_plugin.py @@ -17,14 +17,14 @@ import mock from osc_lib.tests import fakes -from nimbleclient.osc import plugin -from nimbleclient.tests.unit import base +from moganclient.osc import plugin +from moganclient.tests.unit import base class TestBaremetalComputePlugin(base.TestBase): - @mock.patch('nimbleclient.v1.client.Client') - def test_make_client_with_session(self, nimble_client): + @mock.patch('moganclient.v1.client.Client') + def test_make_client_with_session(self, mogan_client): instance = mock.Mock() instance._api_version = { plugin.API_NAME: plugin.DEFAULT_BAREMETAL_COMPUTE_API_VERSION} @@ -42,7 +42,7 @@ class TestBaremetalComputePlugin(base.TestBase): region_name=fakes.REGION_NAME, interface=fakes.INTERFACE, ) - nimble_client.assert_called_once_with( + mogan_client.assert_called_once_with( endpoint=mock.sentinel.ep, auth_url=fakes.AUTH_URL, region_name=fakes.REGION_NAME, @@ -50,8 +50,8 @@ class TestBaremetalComputePlugin(base.TestBase): session='fake_session', ) - @mock.patch('nimbleclient.v1.client.Client') - def test_make_client_no_session(self, nimble_client): + @mock.patch('moganclient.v1.client.Client') + def test_make_client_no_session(self, mogan_client): instance = mock.Mock() instance._api_version = { plugin.API_NAME: plugin.DEFAULT_BAREMETAL_COMPUTE_API_VERSION} @@ -70,7 +70,7 @@ class TestBaremetalComputePlugin(base.TestBase): region_name=fakes.REGION_NAME, interface=fakes.INTERFACE, ) - nimble_client.assert_called_once_with( + mogan_client.assert_called_once_with( endpoint=mock.sentinel.ep, auth_url=fakes.AUTH_URL, region_name=fakes.REGION_NAME, diff --git a/nimbleclient/tests/unit/osc/v1/__init__.py b/moganclient/tests/unit/osc/v1/__init__.py similarity index 100% rename from nimbleclient/tests/unit/osc/v1/__init__.py rename to moganclient/tests/unit/osc/v1/__init__.py diff --git a/nimbleclient/tests/unit/osc/v1/test_availability_zone.py b/moganclient/tests/unit/osc/v1/test_availability_zone.py similarity index 90% rename from nimbleclient/tests/unit/osc/v1/test_availability_zone.py rename to moganclient/tests/unit/osc/v1/test_availability_zone.py index abc6d68..6a86738 100644 --- a/nimbleclient/tests/unit/osc/v1/test_availability_zone.py +++ b/moganclient/tests/unit/osc/v1/test_availability_zone.py @@ -15,9 +15,9 @@ import mock -from nimbleclient.osc.v1 import availability_zone -from nimbleclient.tests.unit import base as test_base -from nimbleclient.v1 import availability_zone as az_mgr +from moganclient.osc.v1 import availability_zone +from moganclient.tests.unit import base as test_base +from moganclient.v1 import availability_zone as az_mgr @mock.patch.object(az_mgr.AvailabilityZoneManager, '_list') diff --git a/nimbleclient/tests/unit/osc/v1/test_flavor.py b/moganclient/tests/unit/osc/v1/test_flavor.py similarity index 98% rename from nimbleclient/tests/unit/osc/v1/test_flavor.py rename to moganclient/tests/unit/osc/v1/test_flavor.py index 9195849..9c9477e 100644 --- a/nimbleclient/tests/unit/osc/v1/test_flavor.py +++ b/moganclient/tests/unit/osc/v1/test_flavor.py @@ -18,11 +18,11 @@ import mock from osc_lib import utils -from nimbleclient.common import base -from nimbleclient.osc.v1 import flavor -from nimbleclient.tests.unit import base as test_base -from nimbleclient.tests.unit import fakes -from nimbleclient.v1 import flavor as flavor_mgr +from moganclient.common import base +from moganclient.osc.v1 import flavor +from moganclient.tests.unit import base as test_base +from moganclient.tests.unit import fakes +from moganclient.v1 import flavor as flavor_mgr class TestFlavor(test_base.TestBaremetalComputeV1): diff --git a/nimbleclient/tests/unit/osc/v1/test_server.py b/moganclient/tests/unit/osc/v1/test_server.py similarity index 99% rename from nimbleclient/tests/unit/osc/v1/test_server.py rename to moganclient/tests/unit/osc/v1/test_server.py index f13715b..b33c2c7 100644 --- a/nimbleclient/tests/unit/osc/v1/test_server.py +++ b/moganclient/tests/unit/osc/v1/test_server.py @@ -21,10 +21,10 @@ from osc_lib import exceptions from osc_lib.tests import utils as osc_test_utils from osc_lib import utils -from nimbleclient.osc.v1 import server -from nimbleclient.tests.unit import base as test_base -from nimbleclient.tests.unit import fakes -from nimbleclient.v1 import server as server_mgr +from moganclient.osc.v1 import server +from moganclient.tests.unit import base as test_base +from moganclient.tests.unit import fakes +from moganclient.v1 import server as server_mgr class TestServer(test_base.TestBaremetalComputeV1): diff --git a/nimbleclient/v1/__init__.py b/moganclient/v1/__init__.py similarity index 100% rename from nimbleclient/v1/__init__.py rename to moganclient/v1/__init__.py diff --git a/nimbleclient/v1/availability_zone.py b/moganclient/v1/availability_zone.py similarity index 95% rename from nimbleclient/v1/availability_zone.py rename to moganclient/v1/availability_zone.py index 73c90f2..291d046 100644 --- a/nimbleclient/v1/availability_zone.py +++ b/moganclient/v1/availability_zone.py @@ -13,7 +13,7 @@ # under the License. # -from nimbleclient.common import base +from moganclient.common import base class AvailabilityZoneManager(base.ManagerWithFind): diff --git a/nimbleclient/v1/client.py b/moganclient/v1/client.py similarity index 79% rename from nimbleclient/v1/client.py rename to moganclient/v1/client.py index 3268ffe..5ba8865 100644 --- a/nimbleclient/v1/client.py +++ b/moganclient/v1/client.py @@ -13,17 +13,17 @@ # under the License. # -from nimbleclient.common import http -from nimbleclient.v1 import availability_zone -from nimbleclient.v1 import flavor -from nimbleclient.v1 import server +from moganclient.common import http +from moganclient.v1 import availability_zone +from moganclient.v1 import flavor +from moganclient.v1 import server class Client(object): - """Client for the Nimble v1 API.""" + """Client for the Mogan v1 API.""" def __init__(self, *args, **kwargs): - """Initialize a new client for the Nimble v1 API.""" + """Initialize a new client for the Mogan v1 API.""" self.http_client = http._construct_http_client(*args, **kwargs) self.flavor = flavor.FlavorManager( diff --git a/nimbleclient/v1/flavor.py b/moganclient/v1/flavor.py similarity index 98% rename from nimbleclient/v1/flavor.py rename to moganclient/v1/flavor.py index eff0186..6434ff9 100644 --- a/nimbleclient/v1/flavor.py +++ b/moganclient/v1/flavor.py @@ -13,7 +13,7 @@ # under the License. # -from nimbleclient.common import base +from moganclient.common import base class Flavor(base.Resource): diff --git a/nimbleclient/v1/server.py b/moganclient/v1/server.py similarity index 98% rename from nimbleclient/v1/server.py rename to moganclient/v1/server.py index bfc8d3a..36b3065 100644 --- a/nimbleclient/v1/server.py +++ b/moganclient/v1/server.py @@ -13,7 +13,7 @@ # under the License. # -from nimbleclient.common import base +from moganclient.common import base class Server(base.Resource): diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index ed2f1ad..c4a6edc 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -58,7 +58,7 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = u'nimbleclient Release Notes' +project = u'moganclient Release Notes' copyright = u'2016, OpenStack Foundation' # The version info for the project you're documenting, acts as replacement for diff --git a/releasenotes/source/index.rst b/releasenotes/source/index.rst index 567c321..432d224 100644 --- a/releasenotes/source/index.rst +++ b/releasenotes/source/index.rst @@ -1,6 +1,6 @@ -================================= -python-nimbleclient Release Notes -================================= +================================ +python-moganclient Release Notes +================================ .. toctree:: :maxdepth: 1 diff --git a/setup.cfg b/setup.cfg index 1745821..d6012c7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] -name = python-nimbleclient -summary = Python client library for OpenStack Nimble project. +name = python-moganclient +summary = Python client library for OpenStack Mogan project. description-file = README.rst license = Apache License, Version 2.0 @@ -24,26 +24,26 @@ classifier = [files] packages = - nimbleclient + moganclient [entry_points] openstack.cli.extension = - baremetal_compute = nimbleclient.osc.plugin + baremetal_compute = moganclient.osc.plugin openstack.baremetal_compute.v1 = - baremetal_flavor_create = nimbleclient.osc.v1.flavor:CreateFlavor - baremetal_flavor_delete = nimbleclient.osc.v1.flavor:DeleteFlavor - baremetal_flavor_list = nimbleclient.osc.v1.flavor:ListFlavor - baremetal_flavor_set = nimbleclient.osc.v1.flavor:SetFlavor - baremetal_flavor_show = nimbleclient.osc.v1.flavor:ShowFlavor - baremetal_flavor_unset = nimbleclient.osc.v1.flavor:UnsetFlavor - baremetal_server_create = nimbleclient.osc.v1.server:CreateServer - baremetal_server_delete = nimbleclient.osc.v1.server:DeleteServer - baremetal_server_list = nimbleclient.osc.v1.server:ListServer - baremetal_server_show = nimbleclient.osc.v1.server:ShowServer - baremetal_server_power = nimbleclient.osc.v1.server:SetServerPowerState - baremetal_server_update = nimbleclient.osc.v1.server:UpdateServer - baremetal_availability_zone_list = nimbleclient.osc.v1.availability_zone:ListAvailabilityZone + baremetal_flavor_create = moganclient.osc.v1.flavor:CreateFlavor + baremetal_flavor_delete = moganclient.osc.v1.flavor:DeleteFlavor + baremetal_flavor_list = moganclient.osc.v1.flavor:ListFlavor + baremetal_flavor_set = moganclient.osc.v1.flavor:SetFlavor + baremetal_flavor_show = moganclient.osc.v1.flavor:ShowFlavor + baremetal_flavor_unset = moganclient.osc.v1.flavor:UnsetFlavor + baremetal_server_create = moganclient.osc.v1.server:CreateServer + baremetal_server_delete = moganclient.osc.v1.server:DeleteServer + baremetal_server_list = moganclient.osc.v1.server:ListServer + baremetal_server_show = moganclient.osc.v1.server:ShowServer + baremetal_server_power = moganclient.osc.v1.server:SetServerPowerState + baremetal_server_update = moganclient.osc.v1.server:UpdateServer + baremetal_availability_zone_list = moganclient.osc.v1.availability_zone:ListAvailabilityZone [build_sphinx] @@ -55,18 +55,18 @@ all_files = 1 upload-dir = doc/build/html [compile_catalog] -directory = nimbleclient/locale -domain = nimbleclient +directory = moganclient/locale +domain = moganclient [update_catalog] -domain = nimbleclient -output_dir = nimbleclient/locale -input_file = nimbleclient/locale/nimbleclient.pot +domain = moganclient +output_dir = moganclient/locale +input_file = moganclient/locale/moganclient.pot [extract_messages] keywords = _ gettext ngettext l_ lazy_gettext mapping_file = babel.cfg -output_file = nimbleclient/locale/nimbleclient.pot +output_file = moganclient/locale/moganclient.pot [build_releasenotes] all_files = 1 diff --git a/tox.ini b/tox.ini index 16e6492..461c639 100644 --- a/tox.ini +++ b/tox.ini @@ -28,7 +28,7 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [testenv:debug] -commands = oslo_debug_helper -t nimbleclient/tests {posargs} +commands = oslo_debug_helper -t moganclient/tests {posargs} [flake8] # E123, E125 skipped as they are invalid PEP-8.