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
This commit is contained in:
liusheng
2017-01-03 17:16:14 +08:00
parent 2494e1140f
commit 693b93d77f
47 changed files with 148 additions and 148 deletions

View File

@@ -1,6 +1,6 @@
[run] [run]
branch = True branch = True
source = nimbleclient source = moganclient
[report] [report]
ignore_errors = True ignore_errors = True

View File

@@ -14,4 +14,4 @@ Pull requests submitted through GitHub will be ignored.
Bugs should be filed on Launchpad, not GitHub: Bugs should be filed on Launchpad, not GitHub:
https://bugs.launchpad.net/python-nimbleclient https://bugs.launchpad.net/python-moganclient

View File

@@ -1,4 +1,4 @@
python-nimbleclient Style Commandments python-moganclient Style Commandments
====================================== =====================================
Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/ Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/

View File

@@ -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 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. 80 cols, so that distribution package maintainers can use it in their packages.
Note that this is a hard requirement. Note that this is a hard requirement.
* Free software: Apache license * 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 * Source: http://git.openstack.org/cgit/openstack/python-nimbleclient
* Bugs: http://bugs.launchpad.net/python-nimbleclient * Bugs: http://bugs.launchpad.net/python-moganclient
Features Features
-------- --------

View File

@@ -39,7 +39,7 @@ source_suffix = '.rst'
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
project = u'python-nimbleclient' project = u'python-moganclient'
copyright = u'2016, OpenStack Foundation' copyright = u'2016, OpenStack Foundation'
# If true, '()' will be appended to :func: etc. cross-reference text. # If true, '()' will be appended to :func: etc. cross-reference text.

View File

@@ -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. sphinx-quickstart on Tue Jul 9 22:26:36 2013.
You can adapt this file completely to your liking, but it should at least You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive. contain the root `toctree` directive.
Welcome to python-nimbleclient's documentation! Welcome to python-moganclient's documentation!
=============================================== ==============================================
Contents: Contents:

View File

@@ -4,9 +4,9 @@ Installation
At the command line:: At the command line::
$ pip install python-nimbleclient $ pip install python-moganclient
Or, if you have virtualenvwrapper installed:: Or, if you have virtualenvwrapper installed::
$ mkvirtualenv python-nimbleclient $ mkvirtualenv python-moganclient
$ pip install python-nimbleclient $ pip install python-moganclient

View File

@@ -2,6 +2,6 @@
Usage Usage
===== =====
To use python-nimbleclient in a project:: To use python-moganclient in a project::
import nimbleclient import moganclient

View File

@@ -18,4 +18,4 @@ import pbr.version
__version__ = pbr.version.VersionInfo( __version__ = pbr.version.VersionInfo(
'python-nimbleclient').version_string() 'python-moganclient').version_string()

View File

@@ -23,7 +23,7 @@ import copy
from requests import Response from requests import Response
import six import six
from nimbleclient.common import exceptions from moganclient.common import exceptions
def getid(obj): def getid(obj):

View File

@@ -19,7 +19,7 @@ import sys
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
import six import six
from nimbleclient.common.i18n import _ from moganclient.common.i18n import _
class ClientException(Exception): class ClientException(Exception):

View File

@@ -27,14 +27,14 @@ import requests
import six import six
from six.moves.urllib import parse from six.moves.urllib import parse
from nimbleclient.common import exceptions as exc from moganclient.common import exceptions as exc
from nimbleclient.common.i18n import _ from moganclient.common.i18n import _
from nimbleclient.common.i18n import _LW from moganclient.common.i18n import _LW
from nimbleclient.common import utils from moganclient.common import utils
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
USER_AGENT = 'python-nimbleclient' USER_AGENT = 'python-moganclient'
CHUNKSIZE = 1024 * 64 # 64kB CHUNKSIZE = 1024 * 64 # 64kB
SENSITIVE_HEADERS = ('X-Auth-Token',) SENSITIVE_HEADERS = ('X-Auth-Token',)
osprofiler_web = importutils.try_import('osprofiler.web') osprofiler_web = importutils.try_import('osprofiler.web')

View File

@@ -15,7 +15,7 @@
import oslo_i18n import oslo_i18n
_translators = oslo_i18n.TranslatorFactory(domain='nimbleclient') _translators = oslo_i18n.TranslatorFactory(domain='moganclient')
# The primary translation function using the well-known name "_" # The primary translation function using the well-known name "_"
_ = _translators.primary _ = _translators.primary

View File

@@ -15,7 +15,7 @@
import logging import logging
from nimbleclient.common.i18n import _LE from moganclient.common.i18n import _LE
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@@ -17,7 +17,7 @@ import logging
from osc_lib import utils from osc_lib import utils
from nimbleclient.common.i18n import _ from moganclient.common.i18n import _
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@@ -25,17 +25,17 @@ DEFAULT_BAREMETAL_COMPUTE_API_VERSION = '1'
API_VERSION_OPTION = 'os_baremetal_compute_api_version' API_VERSION_OPTION = 'os_baremetal_compute_api_version'
API_NAME = 'baremetal_compute' API_NAME = 'baremetal_compute'
API_VERSIONS = { API_VERSIONS = {
'1': 'nimbleclient.v1.client.Client', '1': 'moganclient.v1.client.Client',
} }
def make_client(instance): def make_client(instance):
"""Returns an baremetal service client""" """Returns an baremetal service client"""
nimble_client = utils.get_client_class( mogan_client = utils.get_client_class(
API_NAME, API_NAME,
instance._api_version[API_NAME], instance._api_version[API_NAME],
API_VERSIONS) 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( endpoint = instance.get_endpoint_for_service_type(
API_NAME, API_NAME,
@@ -53,7 +53,7 @@ def make_client(instance):
else: else:
kwargs.update(token=instance.auth_ref.auth_token) kwargs.update(token=instance.auth_ref.auth_token)
client = nimble_client(**kwargs) client = mogan_client(**kwargs)
return client return client

View File

@@ -14,7 +14,7 @@
# #
"""Nimble v1 availability zone action implementations""" """Mogan v1 availability zone action implementations"""
import logging import logging

View File

@@ -14,7 +14,7 @@
# #
"""Nimble v1 Baremetal flavor action implementations""" """Mogan v1 Baremetal flavor action implementations"""
import copy import copy
import logging import logging
@@ -25,8 +25,8 @@ from osc_lib import exceptions
from osc_lib import utils from osc_lib import utils
import six import six
from nimbleclient.common import base from moganclient.common import base
from nimbleclient.common.i18n import _ from moganclient.common.i18n import _
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@@ -14,7 +14,7 @@
# #
"""Nimble v1 Baremetal server action implementations""" """Mogan v1 Baremetal server action implementations"""
import logging import logging
@@ -24,7 +24,7 @@ from osc_lib import exceptions
from osc_lib import utils from osc_lib import utils
import six import six
from nimbleclient.common.i18n import _ from moganclient.common.i18n import _
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@@ -16,7 +16,7 @@
from osc_lib.tests import utils from osc_lib.tests import utils
from nimbleclient.tests.unit import fakes from moganclient.tests.unit import fakes
class TestBase(utils.TestCommand): class TestBase(utils.TestCommand):

View File

@@ -18,10 +18,10 @@ import copy
import mock import mock
import six import six
from nimbleclient.common import base from moganclient.common import base
from nimbleclient.common import exceptions from moganclient.common import exceptions
from nimbleclient.tests.unit import base as test_base from moganclient.tests.unit import base as test_base
from nimbleclient.tests.unit import fakes from moganclient.tests.unit import fakes
class TestResource(test_base.TestBase): class TestResource(test_base.TestBase):

View File

@@ -15,8 +15,8 @@
import mock import mock
from nimbleclient.common import exceptions as exc from moganclient.common import exceptions as exc
from nimbleclient.tests.unit import base from moganclient.tests.unit import base
class TestHTTPExceptions(base.TestBase): class TestHTTPExceptions(base.TestBase):

View File

@@ -22,21 +22,21 @@ from osc_lib.tests import fakes as osc_fakes
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
import six import six
from nimbleclient.common import exceptions as exc from moganclient.common import exceptions as exc
from nimbleclient.common import http from moganclient.common import http
from nimbleclient.common import utils from moganclient.common import utils
from nimbleclient.tests.unit import base from moganclient.tests.unit import base
from nimbleclient.tests.unit import fakes from moganclient.tests.unit import fakes
@mock.patch('nimbleclient.common.http.requests.request') @mock.patch('moganclient.common.http.requests.request')
class TestHttpClient(base.TestBase): class TestHttpClient(base.TestBase):
def setUp(self): def setUp(self):
super(TestHttpClient, self).setUp() super(TestHttpClient, self).setUp()
def test_http_raw_request(self, mock_request): def test_http_raw_request(self, mock_request):
headers = {'User-Agent': 'python-nimbleclient', headers = {'User-Agent': 'python-moganclient',
'Content-Type': 'application/octet-stream'} 'Content-Type': 'application/octet-stream'}
mock_request.return_value = fakes.FakeHTTPResponse(200, 'OK', {}, '') mock_request.return_value = fakes.FakeHTTPResponse(200, 'OK', {}, '')
client = http.HTTPClient('http://example.com:6688') client = http.HTTPClient('http://example.com:6688')
@@ -71,17 +71,17 @@ class TestHttpClient(base.TestBase):
mock_request.assert_has_calls([ mock_request.assert_has_calls([
mock.call('GET', 'http://example.com:6688', mock.call('GET', 'http://example.com:6688',
allow_redirects=False, allow_redirects=False,
headers={'User-Agent': 'python-nimbleclient', headers={'User-Agent': 'python-moganclient',
'Content-Type': 'application/octet-stream'}), 'Content-Type': 'application/octet-stream'}),
mock.call('GET', 'http://example.com:6688', mock.call('GET', 'http://example.com:6688',
allow_redirects=False, allow_redirects=False,
headers={'User-Agent': 'python-nimbleclient', headers={'User-Agent': 'python-moganclient',
'X-Auth-Key': osc_fakes.PASSWORD, 'X-Auth-Key': osc_fakes.PASSWORD,
'X-Auth-User': osc_fakes.USERNAME, 'X-Auth-User': osc_fakes.USERNAME,
'Content-Type': 'application/octet-stream'}), 'Content-Type': 'application/octet-stream'}),
mock.call('GET', 'http://example.com:6688', mock.call('GET', 'http://example.com:6688',
allow_redirects=False, allow_redirects=False,
headers={'User-Agent': 'python-nimbleclient', headers={'User-Agent': 'python-moganclient',
'X-Auth-Token': osc_fakes.AUTH_TOKEN, 'X-Auth-Token': osc_fakes.AUTH_TOKEN,
'Content-Type': 'application/octet-stream'}) 'Content-Type': 'application/octet-stream'})
]) ])
@@ -100,7 +100,7 @@ class TestHttpClient(base.TestBase):
'GET', 'http://example.com:6688', 'GET', 'http://example.com:6688',
allow_redirects=False, allow_redirects=False,
headers={'X-Region-Name': osc_fakes.REGION_NAME, headers={'X-Region-Name': osc_fakes.REGION_NAME,
'User-Agent': 'python-nimbleclient', 'User-Agent': 'python-moganclient',
'Content-Type': 'application/octet-stream'}) 'Content-Type': 'application/octet-stream'})
def test_http_json_request(self, mock_request): def test_http_json_request(self, mock_request):
@@ -118,7 +118,7 @@ class TestHttpClient(base.TestBase):
allow_redirects=False, allow_redirects=False,
headers={'Content-Type': 'application/json', headers={'Content-Type': 'application/json',
'Accept': '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): def test_http_json_request_argument_passed_to_requests(self, mock_request):
"""Check that we have sent the proper arguments to requests.""" """Check that we have sent the proper arguments to requests."""
@@ -144,7 +144,7 @@ class TestHttpClient(base.TestBase):
headers={'Content-Type': 'application/json', headers={'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'X-Auth-Url': osc_fakes.AUTH_URL, '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): def test_http_json_request_w_req_body(self, mock_request):
# Record a 200 # Record a 200
@@ -161,7 +161,7 @@ class TestHttpClient(base.TestBase):
allow_redirects=False, allow_redirects=False,
headers={'Content-Type': 'application/json', headers={'Content-Type': 'application/json',
'Accept': '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): def test_http_json_request_non_json_resp_cont_type(self, mock_request):
# Record a 200 # Record a 200
@@ -177,7 +177,7 @@ class TestHttpClient(base.TestBase):
allow_redirects=False, allow_redirects=False,
headers={'Content-Type': 'application/json', headers={'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'User-Agent': 'python-nimbleclient'}) 'User-Agent': 'python-moganclient'})
def test_http_json_request_invalid_json(self, mock_request): def test_http_json_request_invalid_json(self, mock_request):
# Record a 200 # Record a 200
@@ -193,7 +193,7 @@ class TestHttpClient(base.TestBase):
allow_redirects=False, allow_redirects=False,
headers={'Content-Type': 'application/json', headers={'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'User-Agent': 'python-nimbleclient'}) 'User-Agent': 'python-moganclient'})
def test_http_json_request_redirect_delete(self, mock_request): def test_http_json_request_redirect_delete(self, mock_request):
mock_request.side_effect = [ mock_request.side_effect = [
@@ -215,12 +215,12 @@ class TestHttpClient(base.TestBase):
allow_redirects=False, allow_redirects=False,
headers={'Content-Type': 'application/json', headers={'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'User-Agent': 'python-nimbleclient'}), 'User-Agent': 'python-moganclient'}),
mock.call('DELETE', 'http://example.com:6688/foo/bar', mock.call('DELETE', 'http://example.com:6688/foo/bar',
allow_redirects=False, allow_redirects=False,
headers={'Content-Type': 'application/json', headers={'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'User-Agent': 'python-nimbleclient'}) 'User-Agent': 'python-moganclient'})
]) ])
def test_http_json_request_redirect_post(self, mock_request): def test_http_json_request_redirect_post(self, mock_request):
@@ -243,12 +243,12 @@ class TestHttpClient(base.TestBase):
allow_redirects=False, allow_redirects=False,
headers={'Content-Type': 'application/json', headers={'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'User-Agent': 'python-nimbleclient'}), 'User-Agent': 'python-moganclient'}),
mock.call('POST', 'http://example.com:6688/foo/bar', mock.call('POST', 'http://example.com:6688/foo/bar',
allow_redirects=False, allow_redirects=False,
headers={'Content-Type': 'application/json', headers={'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'User-Agent': 'python-nimbleclient'}) 'User-Agent': 'python-moganclient'})
]) ])
def test_http_json_request_redirect_put(self, mock_request): def test_http_json_request_redirect_put(self, mock_request):
@@ -271,12 +271,12 @@ class TestHttpClient(base.TestBase):
allow_redirects=False, allow_redirects=False,
headers={'Content-Type': 'application/json', headers={'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'User-Agent': 'python-nimbleclient'}), 'User-Agent': 'python-moganclient'}),
mock.call('PUT', 'http://example.com:6688/foo/bar', mock.call('PUT', 'http://example.com:6688/foo/bar',
allow_redirects=False, allow_redirects=False,
headers={'Content-Type': 'application/json', headers={'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'User-Agent': 'python-nimbleclient'}) 'User-Agent': 'python-moganclient'})
]) ])
def test_http_json_request_redirect_diff_location(self, mock_request): def test_http_json_request_redirect_diff_location(self, mock_request):
@@ -299,12 +299,12 @@ class TestHttpClient(base.TestBase):
allow_redirects=False, allow_redirects=False,
headers={'Content-Type': 'application/json', headers={'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'User-Agent': 'python-nimbleclient'}), 'User-Agent': 'python-moganclient'}),
mock.call('PUT', 'http://example.com:6688/diff_lcation', mock.call('PUT', 'http://example.com:6688/diff_lcation',
allow_redirects=False, allow_redirects=False,
headers={'Content-Type': 'application/json', headers={'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'User-Agent': 'python-nimbleclient'}) 'User-Agent': 'python-moganclient'})
]) ])
def test_http_json_request_redirect_error_without_location(self, def test_http_json_request_redirect_error_without_location(self,
@@ -319,7 +319,7 @@ class TestHttpClient(base.TestBase):
allow_redirects=False, allow_redirects=False,
headers={'Content-Type': 'application/json', headers={'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'User-Agent': 'python-nimbleclient'}) 'User-Agent': 'python-moganclient'})
def test_http_json_request_redirect_get(self, mock_request): def test_http_json_request_redirect_get(self, mock_request):
# Record the 302 # Record the 302
@@ -343,12 +343,12 @@ class TestHttpClient(base.TestBase):
allow_redirects=False, allow_redirects=False,
headers={'Content-Type': 'application/json', headers={'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'User-Agent': 'python-nimbleclient'}), 'User-Agent': 'python-moganclient'}),
mock.call('GET', 'http://example.com:6688', mock.call('GET', 'http://example.com:6688',
allow_redirects=False, allow_redirects=False,
headers={'Content-Type': 'application/json', headers={'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'User-Agent': 'python-nimbleclient'}) 'User-Agent': 'python-moganclient'})
]) ])
def test_http_404_json_request(self, mock_request): def test_http_404_json_request(self, mock_request):
@@ -365,7 +365,7 @@ class TestHttpClient(base.TestBase):
allow_redirects=False, allow_redirects=False,
headers={'Content-Type': 'application/json', headers={'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'User-Agent': 'python-nimbleclient'}) 'User-Agent': 'python-moganclient'})
def test_http_300_json_request(self, mock_request): def test_http_300_json_request(self, mock_request):
mock_request.return_value = fakes.FakeHTTPResponse( mock_request.return_value = fakes.FakeHTTPResponse(
@@ -382,12 +382,12 @@ class TestHttpClient(base.TestBase):
allow_redirects=False, allow_redirects=False,
headers={'Content-Type': 'application/json', headers={'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'User-Agent': 'python-nimbleclient'}) 'User-Agent': 'python-moganclient'})
def test_fake_json_request(self, mock_request): def test_fake_json_request(self, mock_request):
headers = {'Content-Type': 'application/json', headers = {'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'User-Agent': 'python-nimbleclient'} 'User-Agent': 'python-moganclient'}
mock_request.side_effect = [socket.gaierror] mock_request.side_effect = [socket.gaierror]
client = http.HTTPClient('fake://example.com:6688') client = http.HTTPClient('fake://example.com:6688')
@@ -400,7 +400,7 @@ class TestHttpClient(base.TestBase):
def test_http_request_socket_error(self, mock_request): def test_http_request_socket_error(self, mock_request):
headers = {'Content-Type': 'application/json', headers = {'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'User-Agent': 'python-nimbleclient'} 'User-Agent': 'python-moganclient'}
mock_request.side_effect = [socket.error] mock_request.side_effect = [socket.error]
client = http.HTTPClient('http://example.com:6688') client = http.HTTPClient('http://example.com:6688')
@@ -413,7 +413,7 @@ class TestHttpClient(base.TestBase):
def test_http_request_socket_timeout(self, mock_request): def test_http_request_socket_timeout(self, mock_request):
headers = {'Content-Type': 'application/json', headers = {'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'User-Agent': 'python-nimbleclient'} 'User-Agent': 'python-moganclient'}
mock_request.side_effect = [socket.timeout] mock_request.side_effect = [socket.timeout]
client = http.HTTPClient('http://example.com:6688') client = http.HTTPClient('http://example.com:6688')
@@ -436,7 +436,7 @@ class TestHttpClient(base.TestBase):
allow_redirects=False, allow_redirects=False,
headers={'Content-Type': 'application/json', headers={'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'User-Agent': 'python-nimbleclient'}, 'User-Agent': 'python-moganclient'},
timeout=float(123)) timeout=float(123))
def test_get_system_ca_file(self, mock_request): 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") client = http.HTTPClient('https://foo', ca_file="NOWHERE")
self.assertEqual("NOWHERE", client.verify_cert) 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" gsf.return_value = "SOMEWHERE"
client = http.HTTPClient('https://foo') client = http.HTTPClient('https://foo')
self.assertEqual("SOMEWHERE", client.verify_cert) 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(('', 'GET'), self.request.call_args_list[0][0])
self.assertEqual(('ishere', 'GET'), self.request.call_args_list[1][0]) self.assertEqual(('ishere', 'GET'), self.request.call_args_list[1][0])
for call in self.request.call_args_list: for call in self.request.call_args_list:
self.assertEqual({'user_agent': 'python-nimbleclient', self.assertEqual({'user_agent': 'python-moganclient',
'raise_exc': False, 'raise_exc': False,
'redirect': True}, call[1]) 'redirect': True}, call[1])
@@ -567,7 +567,7 @@ class TestSessionClient(base.TestBase):
self.assertEqual(('http://no.where/ishere', self.assertEqual(('http://no.where/ishere',
'GET'), self.request.call_args_list[1][0]) 'GET'), self.request.call_args_list[1][0])
for call in self.request.call_args_list: for call in self.request.call_args_list:
self.assertEqual({'user_agent': 'python-nimbleclient', self.assertEqual({'user_agent': 'python-moganclient',
'raise_exc': False, 'raise_exc': False,
'redirect': True}, call[1]) 'redirect': True}, call[1])
@@ -634,7 +634,7 @@ class TestSessionClient(base.TestBase):
self.assertEqual({'endpoint_override': 'http://no.where/', self.assertEqual({'endpoint_override': 'http://no.where/',
'json': 'some_data', 'json': 'some_data',
'user_agent': 'python-nimbleclient', 'user_agent': 'python-moganclient',
'raise_exc': False}, self.request.call_args[1]) 'raise_exc': False}, self.request.call_args[1])
self.assertEqual(200, resp.status_code) self.assertEqual(200, resp.status_code)
self.assertEqual({}, body) self.assertEqual({}, body)
@@ -656,7 +656,7 @@ class TestSessionClient(base.TestBase):
self.assertEqual({'endpoint_override': 'http://no.where/', self.assertEqual({'endpoint_override': 'http://no.where/',
'json': {'files': data}, 'json': {'files': data},
'user_agent': 'python-nimbleclient', 'user_agent': 'python-moganclient',
'raise_exc': False}, self.request.call_args[1]) 'raise_exc': False}, self.request.call_args[1])
self.assertEqual(200, resp.status_code) self.assertEqual(200, resp.status_code)
self.assertEqual({}, body) self.assertEqual({}, body)

View File

@@ -15,8 +15,8 @@
import mock import mock
from nimbleclient.common import utils from moganclient.common import utils
from nimbleclient.tests.unit import base from moganclient.tests.unit import base
class TestUtils(base.TestBase): class TestUtils(base.TestBase):

View File

@@ -20,10 +20,10 @@ import mock
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
from requests import Response from requests import Response
from nimbleclient.common import base from moganclient.common import base
from nimbleclient.v1 import availability_zone from moganclient.v1 import availability_zone
from nimbleclient.v1 import flavor from moganclient.v1 import flavor
from nimbleclient.v1 import server from moganclient.v1 import server
# fake request id # fake request id

View File

@@ -17,14 +17,14 @@ import mock
from osc_lib.tests import fakes from osc_lib.tests import fakes
from nimbleclient.osc import plugin from moganclient.osc import plugin
from nimbleclient.tests.unit import base from moganclient.tests.unit import base
class TestBaremetalComputePlugin(base.TestBase): class TestBaremetalComputePlugin(base.TestBase):
@mock.patch('nimbleclient.v1.client.Client') @mock.patch('moganclient.v1.client.Client')
def test_make_client_with_session(self, nimble_client): def test_make_client_with_session(self, mogan_client):
instance = mock.Mock() instance = mock.Mock()
instance._api_version = { instance._api_version = {
plugin.API_NAME: plugin.DEFAULT_BAREMETAL_COMPUTE_API_VERSION} plugin.API_NAME: plugin.DEFAULT_BAREMETAL_COMPUTE_API_VERSION}
@@ -42,7 +42,7 @@ class TestBaremetalComputePlugin(base.TestBase):
region_name=fakes.REGION_NAME, region_name=fakes.REGION_NAME,
interface=fakes.INTERFACE, interface=fakes.INTERFACE,
) )
nimble_client.assert_called_once_with( mogan_client.assert_called_once_with(
endpoint=mock.sentinel.ep, endpoint=mock.sentinel.ep,
auth_url=fakes.AUTH_URL, auth_url=fakes.AUTH_URL,
region_name=fakes.REGION_NAME, region_name=fakes.REGION_NAME,
@@ -50,8 +50,8 @@ class TestBaremetalComputePlugin(base.TestBase):
session='fake_session', session='fake_session',
) )
@mock.patch('nimbleclient.v1.client.Client') @mock.patch('moganclient.v1.client.Client')
def test_make_client_no_session(self, nimble_client): def test_make_client_no_session(self, mogan_client):
instance = mock.Mock() instance = mock.Mock()
instance._api_version = { instance._api_version = {
plugin.API_NAME: plugin.DEFAULT_BAREMETAL_COMPUTE_API_VERSION} plugin.API_NAME: plugin.DEFAULT_BAREMETAL_COMPUTE_API_VERSION}
@@ -70,7 +70,7 @@ class TestBaremetalComputePlugin(base.TestBase):
region_name=fakes.REGION_NAME, region_name=fakes.REGION_NAME,
interface=fakes.INTERFACE, interface=fakes.INTERFACE,
) )
nimble_client.assert_called_once_with( mogan_client.assert_called_once_with(
endpoint=mock.sentinel.ep, endpoint=mock.sentinel.ep,
auth_url=fakes.AUTH_URL, auth_url=fakes.AUTH_URL,
region_name=fakes.REGION_NAME, region_name=fakes.REGION_NAME,

View File

@@ -15,9 +15,9 @@
import mock import mock
from nimbleclient.osc.v1 import availability_zone from moganclient.osc.v1 import availability_zone
from nimbleclient.tests.unit import base as test_base from moganclient.tests.unit import base as test_base
from nimbleclient.v1 import availability_zone as az_mgr from moganclient.v1 import availability_zone as az_mgr
@mock.patch.object(az_mgr.AvailabilityZoneManager, '_list') @mock.patch.object(az_mgr.AvailabilityZoneManager, '_list')

View File

@@ -18,11 +18,11 @@ import mock
from osc_lib import utils from osc_lib import utils
from nimbleclient.common import base from moganclient.common import base
from nimbleclient.osc.v1 import flavor from moganclient.osc.v1 import flavor
from nimbleclient.tests.unit import base as test_base from moganclient.tests.unit import base as test_base
from nimbleclient.tests.unit import fakes from moganclient.tests.unit import fakes
from nimbleclient.v1 import flavor as flavor_mgr from moganclient.v1 import flavor as flavor_mgr
class TestFlavor(test_base.TestBaremetalComputeV1): class TestFlavor(test_base.TestBaremetalComputeV1):

View File

@@ -21,10 +21,10 @@ from osc_lib import exceptions
from osc_lib.tests import utils as osc_test_utils from osc_lib.tests import utils as osc_test_utils
from osc_lib import utils from osc_lib import utils
from nimbleclient.osc.v1 import server from moganclient.osc.v1 import server
from nimbleclient.tests.unit import base as test_base from moganclient.tests.unit import base as test_base
from nimbleclient.tests.unit import fakes from moganclient.tests.unit import fakes
from nimbleclient.v1 import server as server_mgr from moganclient.v1 import server as server_mgr
class TestServer(test_base.TestBaremetalComputeV1): class TestServer(test_base.TestBaremetalComputeV1):

View File

@@ -13,7 +13,7 @@
# under the License. # under the License.
# #
from nimbleclient.common import base from moganclient.common import base
class AvailabilityZoneManager(base.ManagerWithFind): class AvailabilityZoneManager(base.ManagerWithFind):

View File

@@ -13,17 +13,17 @@
# under the License. # under the License.
# #
from nimbleclient.common import http from moganclient.common import http
from nimbleclient.v1 import availability_zone from moganclient.v1 import availability_zone
from nimbleclient.v1 import flavor from moganclient.v1 import flavor
from nimbleclient.v1 import server from moganclient.v1 import server
class Client(object): class Client(object):
"""Client for the Nimble v1 API.""" """Client for the Mogan v1 API."""
def __init__(self, *args, **kwargs): 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.http_client = http._construct_http_client(*args, **kwargs)
self.flavor = flavor.FlavorManager( self.flavor = flavor.FlavorManager(

View File

@@ -13,7 +13,7 @@
# under the License. # under the License.
# #
from nimbleclient.common import base from moganclient.common import base
class Flavor(base.Resource): class Flavor(base.Resource):

View File

@@ -13,7 +13,7 @@
# under the License. # under the License.
# #
from nimbleclient.common import base from moganclient.common import base
class Server(base.Resource): class Server(base.Resource):

View File

@@ -58,7 +58,7 @@ source_suffix = '.rst'
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
project = u'nimbleclient Release Notes' project = u'moganclient Release Notes'
copyright = u'2016, OpenStack Foundation' copyright = u'2016, OpenStack Foundation'
# The version info for the project you're documenting, acts as replacement for # The version info for the project you're documenting, acts as replacement for

View File

@@ -1,6 +1,6 @@
================================= ================================
python-nimbleclient Release Notes python-moganclient Release Notes
================================= ================================
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1

View File

@@ -1,6 +1,6 @@
[metadata] [metadata]
name = python-nimbleclient name = python-moganclient
summary = Python client library for OpenStack Nimble project. summary = Python client library for OpenStack Mogan project.
description-file = description-file =
README.rst README.rst
license = Apache License, Version 2.0 license = Apache License, Version 2.0
@@ -24,26 +24,26 @@ classifier =
[files] [files]
packages = packages =
nimbleclient moganclient
[entry_points] [entry_points]
openstack.cli.extension = openstack.cli.extension =
baremetal_compute = nimbleclient.osc.plugin baremetal_compute = moganclient.osc.plugin
openstack.baremetal_compute.v1 = openstack.baremetal_compute.v1 =
baremetal_flavor_create = nimbleclient.osc.v1.flavor:CreateFlavor baremetal_flavor_create = moganclient.osc.v1.flavor:CreateFlavor
baremetal_flavor_delete = nimbleclient.osc.v1.flavor:DeleteFlavor baremetal_flavor_delete = moganclient.osc.v1.flavor:DeleteFlavor
baremetal_flavor_list = nimbleclient.osc.v1.flavor:ListFlavor baremetal_flavor_list = moganclient.osc.v1.flavor:ListFlavor
baremetal_flavor_set = nimbleclient.osc.v1.flavor:SetFlavor baremetal_flavor_set = moganclient.osc.v1.flavor:SetFlavor
baremetal_flavor_show = nimbleclient.osc.v1.flavor:ShowFlavor baremetal_flavor_show = moganclient.osc.v1.flavor:ShowFlavor
baremetal_flavor_unset = nimbleclient.osc.v1.flavor:UnsetFlavor baremetal_flavor_unset = moganclient.osc.v1.flavor:UnsetFlavor
baremetal_server_create = nimbleclient.osc.v1.server:CreateServer baremetal_server_create = moganclient.osc.v1.server:CreateServer
baremetal_server_delete = nimbleclient.osc.v1.server:DeleteServer baremetal_server_delete = moganclient.osc.v1.server:DeleteServer
baremetal_server_list = nimbleclient.osc.v1.server:ListServer baremetal_server_list = moganclient.osc.v1.server:ListServer
baremetal_server_show = nimbleclient.osc.v1.server:ShowServer baremetal_server_show = moganclient.osc.v1.server:ShowServer
baremetal_server_power = nimbleclient.osc.v1.server:SetServerPowerState baremetal_server_power = moganclient.osc.v1.server:SetServerPowerState
baremetal_server_update = nimbleclient.osc.v1.server:UpdateServer baremetal_server_update = moganclient.osc.v1.server:UpdateServer
baremetal_availability_zone_list = nimbleclient.osc.v1.availability_zone:ListAvailabilityZone baremetal_availability_zone_list = moganclient.osc.v1.availability_zone:ListAvailabilityZone
[build_sphinx] [build_sphinx]
@@ -55,18 +55,18 @@ all_files = 1
upload-dir = doc/build/html upload-dir = doc/build/html
[compile_catalog] [compile_catalog]
directory = nimbleclient/locale directory = moganclient/locale
domain = nimbleclient domain = moganclient
[update_catalog] [update_catalog]
domain = nimbleclient domain = moganclient
output_dir = nimbleclient/locale output_dir = moganclient/locale
input_file = nimbleclient/locale/nimbleclient.pot input_file = moganclient/locale/moganclient.pot
[extract_messages] [extract_messages]
keywords = _ gettext ngettext l_ lazy_gettext keywords = _ gettext ngettext l_ lazy_gettext
mapping_file = babel.cfg mapping_file = babel.cfg
output_file = nimbleclient/locale/nimbleclient.pot output_file = moganclient/locale/moganclient.pot
[build_releasenotes] [build_releasenotes]
all_files = 1 all_files = 1

View File

@@ -28,7 +28,7 @@ commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:debug] [testenv:debug]
commands = oslo_debug_helper -t nimbleclient/tests {posargs} commands = oslo_debug_helper -t moganclient/tests {posargs}
[flake8] [flake8]
# E123, E125 skipped as they are invalid PEP-8. # E123, E125 skipped as they are invalid PEP-8.