Rename Marconi to Zaqar

This patch renames every package, file, match of Marconi in the codebase
to Zaqar *except* for the .gitreview file, which will have to be updated
*after* I8e587af588d9be0b5ebbab4b0f729b106a2ae537 lands.

Implements blueprint: project-rename

Change-Id: I0c82be81f74d022ab609eea8f40ac2c0635374b1
This commit is contained in:
Flavio Percoco 2014-08-04 12:51:45 +02:00
parent 057dad13a3
commit 11c3310d11
68 changed files with 181 additions and 180 deletions

View File

@ -1,5 +1,5 @@
Marconi Style Commandments
==========================
Zaqar Style Commandments
========================
- Step 1: Read http://www.python.org/dev/peps/pep-0008/
- Step 2: Read http://www.python.org/dev/peps/pep-0008/ again
@ -93,7 +93,7 @@ Template::
\n
{{third-party lib imports in human alphabetical order}}
\n
{{marconi imports in human alphabetical order}}
{{zaqar imports in human alphabetical order}}
\n
\n
{{begin your code}}
@ -109,9 +109,9 @@ Example::
import eventlet
import marconi.common
from marconi import test
import marconi.transport
import zaqar.common
from zaqar import test
import zaqar.transport
More Import Examples
@ -119,11 +119,11 @@ More Import Examples
**INCORRECT** ::
import marconi.transport.wsgi as wsgi
import zaqar.transport.wsgi as wsgi
**CORRECT** ::
from marconi.transport import wsgi
from zaqar.transport import wsgi
Docstrings
----------

View File

@ -1,15 +1,15 @@
*********************
Python Marconi Client
*********************
*******************
Python Zaqar Client
*******************
:version: 0.1.0
:Wiki: `Marconi Wiki`_
:Launchpad: `Marconi Launchpad`_
:Wiki: `Zaqar Wiki`_
:Launchpad: `Zaqar Launchpad`_
:Review: `Code Review`_
:Design: `Client Wiki`_
:IRC: #openstack-marconi @ freenode
:IRC: #openstack-zaqar @ freenode
Welcome to the `Marconi`_ Python Client project!
Welcome to the `Zaqar`_ Python Client project!
**Table of Contents**
@ -24,17 +24,17 @@ Installation
The latest stable release can be installed from PyPI::
pip install --upgrade python-marconiclient
pip install --upgrade python-zaqarclient
For the adventurous, you may also install the latest code directly from GitHub::
pip install git+https://github.com/openstack/python-marconiclient.git
pip install git+https://github.com/openstack/python-zaqarclient.git
=================
What's in the box
=================
By installing python-marconiclient you get programmatic access to the Marconi v1.0 API library. Plus, it installs a plugin to python-openstackclient that allows you to perform simple queue operations.
By installing python-zaqarclient you get programmatic access to the Zaqar v1.0 API library. Plus, it installs a plugin to python-openstackclient that allows you to perform simple queue operations.
==========
How to use
@ -46,13 +46,13 @@ Python client
Details about design, features, usage and workflow can be found in the `Python Client Wiki`_.
.. _Python Client Wiki: https://wiki.openstack.org/wiki/Marconi/PythonClient
.. _Python Client Wiki: https://wiki.openstack.org/wiki/Zaqar/PythonClient
----------------------
Command line interface
----------------------
Marconi bases its client implementation in the `OpenStack Client`_. It can be installed and configured by following the instructions in `Getting Started`_ and `Configuration`_ in the OpenStack Client readme respectively.
Zaqar bases its client implementation in the `OpenStack Client`_. It can be installed and configured by following the instructions in `Getting Started`_ and `Configuration`_ in the OpenStack Client readme respectively.
The CLI currently allows creation, removal and listing of queues. Some examples are:
@ -68,12 +68,12 @@ The CLI currently allows creation, removal and listing of queues. Some examples
Contributing
============
Be sure to reference the `HACKING`_ file for details on coding style. You may also wish to read through Marconi's `Contributor Guide`_ before contributing your first patch.
Be sure to reference the `HACKING`_ file for details on coding style. You may also wish to read through Zaqar's `Contributor Guide`_ before contributing your first patch.
.. _Marconi: https://github.com/openstack/marconi
.. _HACKING: https://github.com/openstack/python-marconiclient/tree/master/HACKING.rst
.. _Marconi Wiki: https://wiki.openstack.org/wiki/Marconi
.. _Contributor Guide: https://wiki.openstack.org/wiki/Marconi#Contributor_Guide
.. _Marconi Launchpad: https://launchpad.net/marconi
.. _Code Review: https://review.openstack.org/#/q/status:open+project:openstack/python-marconiclient,n,z
.. _Client Wiki: https://wiki.openstack.org/wiki/Python_Marconi_Client
.. _Zaqar: https://github.com/openstack/zaqar
.. _HACKING: https://github.com/openstack/python-zaqarclient/tree/master/HACKING.rst
.. _Zaqar Wiki: https://wiki.openstack.org/wiki/Zaqar
.. _Contributor Guide: https://wiki.openstack.org/wiki/Zaqar#Contributor_Guide
.. _Zaqar Launchpad: https://launchpad.net/zaqar
.. _Code Review: https://review.openstack.org/#/q/status:open+project:openstack/python-zaqarclient,n,z
.. _Client Wiki: https://wiki.openstack.org/wiki/Python_Zaqar_Client

View File

@ -15,7 +15,7 @@
import time
from marconiclient.queues.v1 import client
from zaqarclient.queues.v1 import client
URL = 'http://localhost:8888'

View File

@ -13,14 +13,14 @@
# License for the specific language governing permissions and limitations
# under the License.
from marconiclient.queues.v1 import client
from zaqarclient.queues.v1 import client
URL = 'http://localhost:8888'
def create_post_delete(queue_name, messages):
"""Creates a queue, posts messages to it and finally deletes it with
keystone auth strategy enabled on Marconi server side.
keystone auth strategy enabled on Zaqar server side.
:params queue_name: The name of the queue
:type queue_name: `six.text_type`
@ -29,8 +29,8 @@ def create_post_delete(queue_name, messages):
"""
conf = {'auth_opts':
{'backend': 'keystone',
'options': {'os_username': 'marconi',
'os_password': 'marconi',
'options': {'os_username': 'zaqar',
'os_password': 'zaqar',
'os_project_id': 'ccad479c402f43a2994f6e372ab3f8fe',
'os_project_name': '',
'os_auth_url': 'http://127.0.0.1:5000/v2.0/',

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from marconiclient.queues import client
from zaqarclient.queues import client
URL = 'http://localhost:8888'

View File

@ -14,9 +14,10 @@
# NOTE(flaper87): Client should be moved to
# an upper package. It's version agnostic.
from marconiclient.queues.v1 import client
from zaqarclient.queues.v1 import client
URL = 'http://localhost:8888'
URL = 'http://zaqar-fpercoco.rhcloud.com'
def create_post_delete(queue_name, messages):

View File

@ -2,4 +2,4 @@
module=importutils
# Base module
base=marconiclient
base=zaqarclient

View File

@ -1,7 +1,7 @@
[metadata]
name = python-marconiclient
name = python-zaqarclient
version = 0.0.2
summary = Client Library for OpenStack Marconi Queueing API
summary = Client Library for OpenStack Zaqar Queueing API
description-file =
README.rst
author = OpenStack Foundation
@ -31,23 +31,23 @@ setup-hooks =
[files]
packages =
marconiclient
zaqarclient
[entry_points]
marconiclient.transport =
http.v1 = marconiclient.transport.http:HttpTransport
https.v1 = marconiclient.transport.http:HttpTransport
zaqarclient.transport =
http.v1 = zaqarclient.transport.http:HttpTransport
https.v1 = zaqarclient.transport.http:HttpTransport
marconiclient.api =
queues.v1 = marconiclient.queues.v1.api:V1
zaqarclient.api =
queues.v1 = zaqarclient.queues.v1.api:V1
openstack.queuing.v1 =
queue_list = marconiclient.queues.v1.cli:ListQueues
queue_create = marconiclient.queues.v1.cli:CreateQueues
queue_delete = marconiclient.queues.v1.cli:DeleteQueues
queue_list = zaqarclient.queues.v1.cli:ListQueues
queue_create = zaqarclient.queues.v1.cli:CreateQueues
queue_delete = zaqarclient.queues.v1.cli:DeleteQueues
openstack.cli.extension =
queuing = marconiclient.queues.cli
queuing = zaqarclient.queues.cli
[nosetests]
where=tests

View File

@ -14,8 +14,8 @@
# limitations under the License.
from marconiclient.tests.queues import claims
from marconiclient.transport import http
from zaqarclient.tests.queues import claims
from zaqarclient.transport import http
class QueuesV1ClaimHttpFunctionalTest(claims.QueuesV1ClaimFunctionalTest):

View File

@ -14,8 +14,8 @@
# limitations under the License.
from marconiclient.tests.queues import queues
from marconiclient.transport import http
from zaqarclient.tests.queues import queues
from zaqarclient.transport import http
class QueuesV1QueueHttpFunctionalTest(queues.QueuesV1QueueFunctionalTest):

View File

@ -14,8 +14,8 @@
# limitations under the License.
from marconiclient.tests.queues import shard
from marconiclient.transport import http
from zaqarclient.tests.queues import shard
from zaqarclient.transport import http
class QueuesV1ShardHttpFunctionalTest(shard.QueuesV1ShardFunctionalTest):

View File

@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from marconiclient import auth
from marconiclient.tests import base
from zaqarclient import auth
from zaqarclient.tests import base
class TestBaseAuth(base.TestBase):

View File

@ -21,9 +21,9 @@ try:
except ImportError:
ksclient = None
from marconiclient import auth
from marconiclient.tests import base
from marconiclient.transport import request
from zaqarclient import auth
from zaqarclient.tests import base
from zaqarclient.transport import request
class _FakeKeystoneClient(object):

View File

@ -17,8 +17,8 @@ import json
import mock
from marconiclient.common import http
from marconiclient.tests import base
from zaqarclient.common import http
from zaqarclient.tests import base
class TestCommonHttp(base.TestBase):

View File

@ -13,9 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from marconiclient import errors
from marconiclient.queues import client
from marconiclient.tests import base
from zaqarclient import errors
from zaqarclient.queues import client
from zaqarclient.tests import base
class TestClient(base.TestBase):
@ -28,7 +28,7 @@ class TestClient(base.TestBase):
client._CLIENTS[version]))
def test_version_failure(self):
self.assertRaises(errors.MarconiError,
self.assertRaises(errors.ZaqarError,
client.Client,
'http://example.org',
-1, {})

View File

@ -14,8 +14,8 @@
# limitations under the License.
from marconiclient.tests.queues import claims
from marconiclient.transport import http
from zaqarclient.tests.queues import claims
from zaqarclient.transport import http
class QueuesV1ClaimsHttpUnitTest(claims.QueueV1ClaimUnitTest):

View File

@ -15,10 +15,10 @@
import mock
from marconiclient.queues import client
from marconiclient.queues.v1 import core
from marconiclient.tests import base
from marconiclient.transport import response
from zaqarclient.queues import client
from zaqarclient.queues.v1 import core
from zaqarclient.tests import base
from zaqarclient.transport import response
VERSION = 1

View File

@ -16,12 +16,12 @@
import json
import mock
from marconiclient.queues.v1 import core
from marconiclient.tests import base
from marconiclient.tests.transport import dummy
from marconiclient.transport import errors
from marconiclient.transport import request
from marconiclient.transport import response
from zaqarclient.queues.v1 import core
from zaqarclient.tests import base
from zaqarclient.tests.transport import dummy
from zaqarclient.transport import errors
from zaqarclient.transport import request
from zaqarclient.transport import response
class TestV1Core(base.TestBase):

View File

@ -16,12 +16,12 @@
import json
import mock
from marconiclient.queues.v1 import iterator as iterate
from marconiclient.queues.v1 import message
from marconiclient.tests.queues import base
from marconiclient.tests.queues import messages as test_message
from marconiclient.transport import http
from marconiclient.transport import response
from zaqarclient.queues.v1 import iterator as iterate
from zaqarclient.queues.v1 import message
from zaqarclient.tests.queues import base
from zaqarclient.tests.queues import messages as test_message
from zaqarclient.transport import http
from zaqarclient.transport import response
class TestMessageIterator(base.QueuesTestBase):

View File

@ -14,8 +14,8 @@
# limitations under the License.
from marconiclient.tests.queues import queues
from marconiclient.transport import http
from zaqarclient.tests.queues import queues
from zaqarclient.transport import http
class QueuesV1QueueHttpUnitTest(queues.QueuesV1QueueUnitTest):

View File

@ -14,8 +14,8 @@
# limitations under the License.
from marconiclient.tests.queues import shard
from marconiclient.transport import http
from zaqarclient.tests.queues import shard
from zaqarclient.transport import http
class QueuesV1ShardHttpUnitTest(shard.QueuesV1ShardUnitTest):

View File

@ -13,9 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from marconiclient import errors
from marconiclient.tests import base
from marconiclient.tests.transport import api as tapi
from zaqarclient import errors
from zaqarclient.tests import base
from zaqarclient.tests.transport import api as tapi
class TestApi(base.TestBase):

View File

@ -16,10 +16,10 @@
import mock
import requests as prequest
from marconiclient.tests import base
from marconiclient.tests.transport import api
from marconiclient.transport import http
from marconiclient.transport import request
from zaqarclient.tests import base
from zaqarclient.tests.transport import api
from zaqarclient.transport import http
from zaqarclient.transport import request
class TestHttpTransport(base.TestBase):
@ -91,7 +91,7 @@ class TestHttpTransport(base.TestBase):
with mock.patch.object(self.transport.client, 'request',
autospec=True) as request_method:
exception_iterator = self.transport.http_to_marconi.items()
exception_iterator = self.transport.http_to_zaqar.items()
for response_code, exception in exception_iterator:

View File

@ -16,8 +16,8 @@
import json
from marconiclient.tests import base
from marconiclient.transport import request
from zaqarclient.tests import base
from zaqarclient.transport import request
HREF = '/v1/queue/'

View File

@ -14,8 +14,8 @@
# limitations under the License.
from marconiclient.auth import base
from marconiclient.auth import keystone
from zaqarclient.auth import base
from zaqarclient.auth import keystone
_BACKENDS = {
'noauth': base.NoAuth,

View File

@ -30,9 +30,9 @@ class AuthBackend(object):
Auth backends will have to manipulate the
request and prepare it to send the auth information
back to Marconi's instance.
back to Zaqar's instance.
:params api_version: Marconi's API version.
:params api_version: Zaqar's API version.
:params request: Request Spec instance
that can be manipulated by the backend
if the authentication succeeds.

View File

@ -15,7 +15,7 @@
from keystoneclient.v2_0 import client as ksclient
from marconiclient.auth import base
from zaqarclient.auth import base
# NOTE(flaper87): Some of the code below

View File

@ -12,14 +12,14 @@
# License for the specific language governing permissions and limitations
# under the License.
__all__ = ['MarconiError', 'DriverLoadFailure', 'InvalidOperation']
__all__ = ['ZaqarError', 'DriverLoadFailure', 'InvalidOperation']
class MarconiError(Exception):
class ZaqarError(Exception):
"""Base class for errors."""
class DriverLoadFailure(MarconiError):
class DriverLoadFailure(ZaqarError):
"""Raised if a transport driver can't be loaded."""
def __init__(self, driver, ex):
@ -29,5 +29,5 @@ class DriverLoadFailure(MarconiError):
self.ex = ex
class InvalidOperation(MarconiError):
class InvalidOperation(ZaqarError):
"""Raised when attempted a non existent operation."""

View File

@ -23,7 +23,7 @@ DEFAULT_QUEUES_API_VERSION = '1'
API_VERSION_OPTION = 'os_queues_api_version'
API_NAME = "queuing"
API_VERSIONS = {
"1": "marconiclient.queues.v1.client.Client",
"1": "zaqarclient.queues.v1.client.Client",
}

View File

@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from marconiclient import errors
from marconiclient.queues.v1 import client as cv1
from zaqarclient import errors
from zaqarclient.queues.v1 import client as cv1
_CLIENTS = {1: cv1.Client}
@ -23,4 +23,4 @@ def Client(url=None, version=None, conf=None):
try:
return _CLIENTS[version](url, version, conf)
except KeyError:
raise errors.MarconiError('Unknown client version')
raise errors.ZaqarError('Unknown client version')

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from marconiclient.transport import api
from zaqarclient.transport import api
class V1(api.Api):

View File

@ -13,9 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from marconiclient.queues.v1 import core
from marconiclient.queues.v1 import iterator as iterate
from marconiclient.queues.v1 import message
from zaqarclient.queues.v1 import core
from zaqarclient.queues.v1 import iterator as iterate
from zaqarclient.queues.v1 import message
class Claim(object):

View File

@ -15,18 +15,18 @@
import uuid
from marconiclient.queues.v1 import core
from marconiclient.queues.v1 import iterator
from marconiclient.queues.v1 import queues
from marconiclient.queues.v1 import shard
from marconiclient import transport
from marconiclient.transport import request
from zaqarclient.queues.v1 import core
from zaqarclient.queues.v1 import iterator
from zaqarclient.queues.v1 import queues
from zaqarclient.queues.v1 import shard
from zaqarclient import transport
from zaqarclient.transport import request
class Client(object):
"""Client base class
:param url: Marconi's instance base url.
:param url: Zaqar's instance base url.
:type url: `six.text_type`
:param version: API Version pointing to.
:type version: `int`
@ -131,6 +131,6 @@ class Client(object):
return shard.Shard(self, ref, **kwargs)
def health(self):
"""Gets the health status of Marconi server."""
"""Gets the health status of Zaqar server."""
req, trans = self._request_and_transport()
return core.health(trans, req)

View File

@ -29,7 +29,7 @@ Functions present in this module assume that:
import json
import marconiclient.transport.errors as errors
import zaqarclient.transport.errors as errors
def _common_queue_ops(operation, transport, request, name, callback=None):

View File

@ -12,13 +12,13 @@
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Implements a message controller that understands Marconi messages."""
"""Implements a message controller that understands Zaqar messages."""
from marconiclient.queues.v1 import core
from zaqarclient.queues.v1 import core
class Message(object):
"""A handler for Marconi server Message resources.
"""A handler for Zaqar server Message resources.
Attributes are only downloaded once - at creation time.
"""
def __init__(self, queue, href, ttl, age, body):
@ -30,7 +30,7 @@ class Message(object):
# NOTE(flaper87): Is this really
# necessary? Should this be returned
# by Marconi?
# by Zaqar?
# The url has two forms depending on if it has been claimed.
# /v1/queues/worker-jobs/messages/5c6939a8?claim_id=63c9a592
# or

View File

@ -13,10 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from marconiclient.queues.v1 import claim as claim_api
from marconiclient.queues.v1 import core
from marconiclient.queues.v1 import iterator
from marconiclient.queues.v1 import message
from zaqarclient.queues.v1 import claim as claim_api
from zaqarclient.queues.v1 import core
from zaqarclient.queues.v1 import iterator
from zaqarclient.queues.v1 import message
class Queue(object):

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from marconiclient.queues.v1 import core
from zaqarclient.queues.v1 import core
class Shard(object):

View File

@ -18,7 +18,7 @@ import os
import fixtures
import testtools
_RUN_FUNCTIONAL = os.environ.get('MARCONICLIENT_TEST_FUNCTIONAL', False)
_RUN_FUNCTIONAL = os.environ.get('ZAQARCLIENT_TEST_FUNCTIONAL', False)
class TestBase(testtools.TestCase):
@ -30,7 +30,7 @@ class TestBase(testtools.TestCase):
super(TestBase, self).setUp()
self.conf = {}
self.useFixture(fixtures.FakeLogger('marconi'))
self.useFixture(fixtures.FakeLogger('zaqar'))
# NOTE(kgriffs): Don't monkey-patch stdout since it breaks
# debugging with pdb.

View File

@ -12,7 +12,7 @@
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Easy creation of mock Marconi message replies."""
"""Easy creation of mock Zaqar message replies."""
def message(href='/v1/queues/dgq/messages/w78sdwsqdsib',

View File

@ -15,9 +15,9 @@
import mock
from marconiclient.queues import client
from marconiclient.tests import base
from marconiclient.tests.transport import dummy
from zaqarclient.queues import client
from zaqarclient.tests import base
from zaqarclient.tests.transport import dummy
class QueuesTestBase(base.TestBase):

View File

@ -16,10 +16,10 @@
import json
import mock
from marconiclient.queues.v1 import claim
from marconiclient.tests.queues import base
from marconiclient.transport import errors
from marconiclient.transport import response
from zaqarclient.queues.v1 import claim
from zaqarclient.tests.queues import base
from zaqarclient.transport import errors
from zaqarclient.transport import response
class QueueV1ClaimUnitTest(base.QueuesTestBase):

View File

@ -16,8 +16,8 @@
import json
import mock
from marconiclient.tests.queues import base
from marconiclient.transport import response
from zaqarclient.tests.queues import base
from zaqarclient.transport import response
class QueuesV1MessageUnitTest(base.QueuesTestBase):

View File

@ -16,10 +16,10 @@
import json
import mock
from marconiclient.queues.v1 import iterator
from marconiclient.queues.v1 import message
from marconiclient.tests.queues import base
from marconiclient.transport import response
from zaqarclient.queues.v1 import iterator
from zaqarclient.queues.v1 import message
from zaqarclient.tests.queues import base
from zaqarclient.transport import response
class QueuesV1QueueUnitTest(base.QueuesTestBase):

View File

@ -15,8 +15,8 @@
import mock
from marconiclient.tests.queues import base
from marconiclient.transport import response
from zaqarclient.tests.queues import base
from zaqarclient.transport import response
class QueuesV1ShardUnitTest(base.QueuesTestBase):

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from marconiclient.transport import api
from zaqarclient.transport import api
class FakeApi(api.Api):

View File

@ -14,7 +14,7 @@
# limitations under the License.
from marconiclient.transport import base
from zaqarclient.transport import base
class DummyTransport(base.Transport):

View File

@ -17,7 +17,7 @@ import six
from six.moves.urllib import parse
from stevedore import driver
from marconiclient import errors as _errors
from zaqarclient import errors as _errors
def get_transport(transport='http', version=1, options=None):
@ -31,13 +31,13 @@ def get_transport(transport='http', version=1, options=None):
:type version: int
:returns: A `Transport` instance.
:rtype: `marconiclient.transport.Transport`
:rtype: `zaqarclient.transport.Transport`
"""
entry_point = '{0}.v{1}'.format(transport, version)
try:
namespace = 'marconiclient.transport'
namespace = 'zaqarclient.transport'
mgr = driver.DriverManager(namespace,
entry_point,
invoke_on_load=True,
@ -57,12 +57,12 @@ def get_transport_for(url_or_request, version=1, options=None):
:param url_or_request: a transport URL
:type url_or_request: `six.string_types` or
`marconiclient.transport.request.Request`
`zaqarclient.transport.request.Request`
:param version: Version of the target transport.
:type version: int
:returns: A `Transport` instance.
:rtype: `marconiclient.transport.Transport`
:rtype: `zaqarclient.transport.Transport`
"""
url = url_or_request

View File

@ -16,7 +16,7 @@
import jsonschema
from jsonschema import validators
from marconiclient import errors
from zaqarclient import errors
class Api(object):

View File

@ -29,5 +29,5 @@ class Transport(object):
"""Returns the response.
:returns: The final response
:rtype: `marconiclient.transport.response.Response`
:rtype: `zaqarclient.transport.response.Response`
"""

View File

@ -16,18 +16,18 @@
"""
Errors below must be used to translate transport specific
errors to Marconi errors. For example, HTTP 404s should be
errors to Zaqar errors. For example, HTTP 404s should be
raised as `ResourceNotFound`
"""
from marconiclient import errors
from zaqarclient import errors
__all__ = ['TransportError', 'ResourceNotFound', 'MalformedRequest',
'UnauthorizedError', 'ForbiddenError', 'ServiceUnavailableError',
'InternalServerError']
class TransportError(errors.MarconiError):
class TransportError(errors.ZaqarError):
"""Base class for all transport errors."""

View File

@ -15,19 +15,19 @@
import json
from marconiclient.common import http
from marconiclient.transport import base
from zaqarclient.common import http
from zaqarclient.transport import base
# NOTE(flaper87): Something is completely borked
# with some imports. Using `from ... import errors`
# will end up importing `marconiclient.errors` instead
# will end up importing `zaqarclient.errors` instead
# of transports
import marconiclient.transport.errors as errors
from marconiclient.transport import response
import zaqarclient.transport.errors as errors
from zaqarclient.transport import response
class HttpTransport(base.Transport):
http_to_marconi = {
http_to_zaqar = {
400: errors.MalformedRequest,
401: errors.UnauthorizedError,
403: errors.ForbiddenError,
@ -67,7 +67,7 @@ class HttpTransport(base.Transport):
if '{{{0}}}'.format(param) in ref:
value = request.params.pop(param)
# NOTE(flaper87): Marconi API parses
# NOTE(flaper87): Zaqar API parses
# sequences encoded as '1,2,3,4'. Let's
# encode lists, tuples and sets before
# sending them to the server.
@ -95,7 +95,7 @@ class HttpTransport(base.Transport):
headers=headers,
data=request.content)
if resp.status_code in self.http_to_marconi:
if resp.status_code in self.http_to_zaqar:
try:
msg = json.loads(resp.text)['description']
except Exception:
@ -103,7 +103,7 @@ class HttpTransport(base.Transport):
# but don't stop raising the corresponding
# exception
msg = ''
raise self.http_to_marconi[resp.status_code](msg)
raise self.http_to_zaqar[resp.status_code](msg)
# NOTE(flaper87): This reads the whole content
# and will consume any attempt of streaming.

View File

@ -17,8 +17,8 @@
import json
from stevedore import driver
from marconiclient import auth
from marconiclient import errors
from zaqarclient import auth
from zaqarclient import errors
def prepare_request(auth_opts=None, data=None, **kwargs):
@ -53,7 +53,7 @@ def prepare_request(auth_opts=None, data=None, **kwargs):
class Request(object):
"""General data for a Marconi request
"""General data for a Zaqar request
The idea is to be declarative i.e. specify *what* is desired. It's up to
the respective transport to turn this into a layer-specific request.
@ -94,7 +94,7 @@ class Request(object):
def api(self):
if not self._api and self._api_mod:
try:
namespace = 'marconiclient.api'
namespace = 'zaqarclient.api'
mgr = driver.DriverManager(namespace,
self._api_mod,
invoke_on_load=True)

View File

@ -17,14 +17,14 @@ import json
class Response(object):
"""Common response class for Marconiclient.
"""Common response class for Zaqarclient.
All `marconiclient.transport.base.Transport` implementations
All `zaqarclient.transport.base.Transport` implementations
will return this to the higher level API which will then build
an object out of it.
:param request: The request sent to the server.
:type: `marconiclient.transport.request.Request`
:type: `zaqarclient.transport.request.Request`
:param content: Response's content
:type: `six.string_types`
:param headers: Optional headers returned in the response.

View File

@ -21,9 +21,9 @@ try:
# we're installed on a system, we're not in a Git-managed source tree, so
# pbr doesn't really buy us anything.
version_string = pkg_resources.get_provider(
pkg_resources.Requirement.parse('python-marconiclient')).version
pkg_resources.Requirement.parse('python-zaqarclient')).version
except pkg_resources.DistributionNotFound:
# No PKG-INFO? We're probably running from a checkout, then. Let pbr do
# its thing to figure out a version number.
import pbr.version
version_string = str(pbr.version.VersionInfo('python-marconiclient'))
version_string = str(pbr.version.VersionInfo('python-zaqarclient'))