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

View File

@ -1,15 +1,15 @@
********************* *******************
Python Marconi Client Python Zaqar Client
********************* *******************
:version: 0.1.0 :version: 0.1.0
:Wiki: `Marconi Wiki`_ :Wiki: `Zaqar Wiki`_
:Launchpad: `Marconi Launchpad`_ :Launchpad: `Zaqar Launchpad`_
:Review: `Code Review`_ :Review: `Code Review`_
:Design: `Client Wiki`_ :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** **Table of Contents**
@ -24,17 +24,17 @@ Installation
The latest stable release can be installed from PyPI:: 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:: 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 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 How to use
@ -46,13 +46,13 @@ Python client
Details about design, features, usage and workflow can be found in the `Python Client Wiki`_. 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 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: 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 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 .. _Zaqar: https://github.com/openstack/zaqar
.. _HACKING: https://github.com/openstack/python-marconiclient/tree/master/HACKING.rst .. _HACKING: https://github.com/openstack/python-zaqarclient/tree/master/HACKING.rst
.. _Marconi Wiki: https://wiki.openstack.org/wiki/Marconi .. _Zaqar Wiki: https://wiki.openstack.org/wiki/Zaqar
.. _Contributor Guide: https://wiki.openstack.org/wiki/Marconi#Contributor_Guide .. _Contributor Guide: https://wiki.openstack.org/wiki/Zaqar#Contributor_Guide
.. _Marconi Launchpad: https://launchpad.net/marconi .. _Zaqar Launchpad: https://launchpad.net/zaqar
.. _Code Review: https://review.openstack.org/#/q/status:open+project:openstack/python-marconiclient,n,z .. _Code Review: https://review.openstack.org/#/q/status:open+project:openstack/python-zaqarclient,n,z
.. _Client Wiki: https://wiki.openstack.org/wiki/Python_Marconi_Client .. _Client Wiki: https://wiki.openstack.org/wiki/Python_Zaqar_Client

View File

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

View File

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

View File

@ -14,9 +14,10 @@
# NOTE(flaper87): Client should be moved to # NOTE(flaper87): Client should be moved to
# an upper package. It's version agnostic. # 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://localhost:8888'
URL = 'http://zaqar-fpercoco.rhcloud.com'
def create_post_delete(queue_name, messages): def create_post_delete(queue_name, messages):

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -30,9 +30,9 @@ class AuthBackend(object):
Auth backends will have to manipulate the Auth backends will have to manipulate the
request and prepare it to send the auth information 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 :params request: Request Spec instance
that can be manipulated by the backend that can be manipulated by the backend
if the authentication succeeds. if the authentication succeeds.

View File

@ -15,7 +15,7 @@
from keystoneclient.v2_0 import client as ksclient 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 # NOTE(flaper87): Some of the code below

View File

@ -12,14 +12,14 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
__all__ = ['MarconiError', 'DriverLoadFailure', 'InvalidOperation'] __all__ = ['ZaqarError', 'DriverLoadFailure', 'InvalidOperation']
class MarconiError(Exception): class ZaqarError(Exception):
"""Base class for errors.""" """Base class for errors."""
class DriverLoadFailure(MarconiError): class DriverLoadFailure(ZaqarError):
"""Raised if a transport driver can't be loaded.""" """Raised if a transport driver can't be loaded."""
def __init__(self, driver, ex): def __init__(self, driver, ex):
@ -29,5 +29,5 @@ class DriverLoadFailure(MarconiError):
self.ex = ex self.ex = ex
class InvalidOperation(MarconiError): class InvalidOperation(ZaqarError):
"""Raised when attempted a non existent operation.""" """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_VERSION_OPTION = 'os_queues_api_version'
API_NAME = "queuing" API_NAME = "queuing"
API_VERSIONS = { 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 # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from marconiclient import errors from zaqarclient import errors
from marconiclient.queues.v1 import client as cv1 from zaqarclient.queues.v1 import client as cv1
_CLIENTS = {1: cv1.Client} _CLIENTS = {1: cv1.Client}
@ -23,4 +23,4 @@ def Client(url=None, version=None, conf=None):
try: try:
return _CLIENTS[version](url, version, conf) return _CLIENTS[version](url, version, conf)
except KeyError: 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 # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from marconiclient.transport import api from zaqarclient.transport import api
class V1(api.Api): class V1(api.Api):

View File

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

View File

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

View File

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

View File

@ -12,13 +12,13 @@
# implied. # implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
"""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): 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. Attributes are only downloaded once - at creation time.
""" """
def __init__(self, queue, href, ttl, age, body): def __init__(self, queue, href, ttl, age, body):
@ -30,7 +30,7 @@ class Message(object):
# NOTE(flaper87): Is this really # NOTE(flaper87): Is this really
# necessary? Should this be returned # necessary? Should this be returned
# by Marconi? # by Zaqar?
# The url has two forms depending on if it has been claimed. # The url has two forms depending on if it has been claimed.
# /v1/queues/worker-jobs/messages/5c6939a8?claim_id=63c9a592 # /v1/queues/worker-jobs/messages/5c6939a8?claim_id=63c9a592
# or # or

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -17,7 +17,7 @@ import six
from six.moves.urllib import parse from six.moves.urllib import parse
from stevedore import driver 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): 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 :type version: int
:returns: A `Transport` instance. :returns: A `Transport` instance.
:rtype: `marconiclient.transport.Transport` :rtype: `zaqarclient.transport.Transport`
""" """
entry_point = '{0}.v{1}'.format(transport, version) entry_point = '{0}.v{1}'.format(transport, version)
try: try:
namespace = 'marconiclient.transport' namespace = 'zaqarclient.transport'
mgr = driver.DriverManager(namespace, mgr = driver.DriverManager(namespace,
entry_point, entry_point,
invoke_on_load=True, 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 :param url_or_request: a transport URL
:type url_or_request: `six.string_types` or :type url_or_request: `six.string_types` or
`marconiclient.transport.request.Request` `zaqarclient.transport.request.Request`
:param version: Version of the target transport. :param version: Version of the target transport.
:type version: int :type version: int
:returns: A `Transport` instance. :returns: A `Transport` instance.
:rtype: `marconiclient.transport.Transport` :rtype: `zaqarclient.transport.Transport`
""" """
url = url_or_request url = url_or_request

View File

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

View File

@ -29,5 +29,5 @@ class Transport(object):
"""Returns the response. """Returns the response.
:returns: The final 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 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` raised as `ResourceNotFound`
""" """
from marconiclient import errors from zaqarclient import errors
__all__ = ['TransportError', 'ResourceNotFound', 'MalformedRequest', __all__ = ['TransportError', 'ResourceNotFound', 'MalformedRequest',
'UnauthorizedError', 'ForbiddenError', 'ServiceUnavailableError', 'UnauthorizedError', 'ForbiddenError', 'ServiceUnavailableError',
'InternalServerError'] 'InternalServerError']
class TransportError(errors.MarconiError): class TransportError(errors.ZaqarError):
"""Base class for all transport errors.""" """Base class for all transport errors."""

View File

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

View File

@ -17,8 +17,8 @@
import json import json
from stevedore import driver from stevedore import driver
from marconiclient import auth from zaqarclient import auth
from marconiclient import errors from zaqarclient import errors
def prepare_request(auth_opts=None, data=None, **kwargs): 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): 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 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. the respective transport to turn this into a layer-specific request.
@ -94,7 +94,7 @@ class Request(object):
def api(self): def api(self):
if not self._api and self._api_mod: if not self._api and self._api_mod:
try: try:
namespace = 'marconiclient.api' namespace = 'zaqarclient.api'
mgr = driver.DriverManager(namespace, mgr = driver.DriverManager(namespace,
self._api_mod, self._api_mod,
invoke_on_load=True) invoke_on_load=True)

View File

@ -17,14 +17,14 @@ import json
class Response(object): 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 will return this to the higher level API which will then build
an object out of it. an object out of it.
:param request: The request sent to the server. :param request: The request sent to the server.
:type: `marconiclient.transport.request.Request` :type: `zaqarclient.transport.request.Request`
:param content: Response's content :param content: Response's content
:type: `six.string_types` :type: `six.string_types`
:param headers: Optional headers returned in the response. :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 # we're installed on a system, we're not in a Git-managed source tree, so
# pbr doesn't really buy us anything. # pbr doesn't really buy us anything.
version_string = pkg_resources.get_provider( version_string = pkg_resources.get_provider(
pkg_resources.Requirement.parse('python-marconiclient')).version pkg_resources.Requirement.parse('python-zaqarclient')).version
except pkg_resources.DistributionNotFound: except pkg_resources.DistributionNotFound:
# No PKG-INFO? We're probably running from a checkout, then. Let pbr do # No PKG-INFO? We're probably running from a checkout, then. Let pbr do
# its thing to figure out a version number. # its thing to figure out a version number.
import pbr.version import pbr.version
version_string = str(pbr.version.VersionInfo('python-marconiclient')) version_string = str(pbr.version.VersionInfo('python-zaqarclient'))