The way subscriptions are listed by Client.subscriptions method is not very good. Besides doing nice work, this method modifies subscription list response body from Zaqar by adding redundant 'queue_name' key to each subscription dictionary in the response body, while there is already 'source' key containing queue name. Because of that it's possible to write a unit test, where queue list response body from Zaqar does not represent real response that could come from Zaqar. As example see zaqarclient.tests.queues.subscriptions.QueuesV2SubscriptionUnitTest. test_subscription_list. This test is missing 'source' keys in response body. This patch makes subscription listing code stop modifying responses from Zaqar. As expected, the example unit test fails after that. This patch fixes the test also and checks more subscription object's fields. Also this patch improves subscription listing functional test to check all fields of subscription object that was deserialized from Zaqar response, i.e. checks zaqarclient.queues.v2.subscription.create_object method. It is also needed, because before this patch, subscription's queue name field wasn't checked by any of the tests, making a recent bug like https://bugs.launchpad.net/python-zaqarclient/+bug/1538367 possible. Change-Id: Iae5bffb296efd655a34584c7f2162adbe6d029e2 Closes-Bug: 1538366
Python Zaqar Client
- version
-
0.1.0
- Wiki
- Launchpad
- Review
- Design
- IRC
-
#openstack-zaqar @ freenode
Welcome to the Zaqar Python Client project!
Table of Contents
Installation
The latest stable release can be installed from PyPI:
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-zaqarclient.git
What's in the box
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
Python client
Details about design, features, usage and workflow can be found in the Python Client Wiki.
Command line interface
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:
$ openstack queue list --limit 3
$ openstack queue create myqueue
$ openstack queue delete myqueue
Contributing
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.