The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.
Change-Id: I95e8d9564cda2e6a06a3f40b0de6991acb07dd4c
We store the CA in request.cert, but it's not compatible with a cert. To
pass the CA to requests, we need to set the verify argument.
Change-Id: Id0f39e3253b1486db8ae2da3d7dc6c0fdb41062a
According to PEP 396, the version of client library
should be set in xxxclient.__version__, that help
python-openstackclient command "module list" to get
the right plugin module versions.
Change-Id: Iea53e561ab197f4ef1b4855422c748417d808fab
Partial-Bug: #1662058
The line of "coding: utf-8" is added by some editors automatically.
It is useless, can be removed.
Change-Id: I50ded5ec5140cfbcfdaa1a09ac816e6c88969000
Directory openstack/common has been out of date,so we can delete it,
and we should also delete this directory in flake8 exclude list.
Change-Id: I98af8dd332807343730b81a7f2c8422b63e6c38d
Currently, Zaqar client doesn't support passing in Keystone
session for authentation. This patch add that support, so
that user can create Zaqar client like:
z = zaqarclient.Client(session=session)
Change-Id: Idbd81678714534116d3f3cf8a395a704b1f61542
As per OpenStack licensing guide lines [1]:
[H104] Files with no code shouldn't contain any license header nor
comments, and must be left completely empty.
[1] http://docs.openstack.org/developer/hacking/#openstack-licensing
Change-Id: I2df3d796aabbd2d283520b207bee3a80e663ecb4
Currently, Zaqarclient doesn't support SSL and insecure very well.
This patch fix it.
Implement blueprint: support-ssl-insecure
Change-Id: I2247fbbabc3afb7b5dccc2b48cd4e96864013a7e
Some of tests use different method of
assertTrue(isinstance(A, B)) or assertEqual(type(A), B).
The correct way is to use assertIsInstance(A, B) provided
by testtools
Change-Id: Ic741b987fa184b9e9efb22750b8d8245c6c62676
This patch adds a new WebsocketTransport class that will help
consolidate common websocket client code that is useful
for connecting to and subscribing to Zaqar queues via
websockets.
We are already using a similar client within TripleO and
it makes sense to have it live in zaqarclient where it
can be shared and used by multiple projects.
Change-Id: Ia2a8deb599252d8308e44d595eb2bf443999aaad
osc-lib is a package of common support modules for writing
OSC plugins. All common functions, classes such as exceptions,
utils, logs and so on have been moved from openstackclient to
osc-lib.
So use osc-lib instead of openstackclient.
Change-Id: Ic158ee6d74f73b4629f9f35f6f29e5a4e99b5258
Now if we pass a float value of api version such as "v1.0" or
"v2.0", client will raise a DriverLoadFailure error. Because
that client can't match a sutiable API entry.
So we should ensure that that some value like "v1.0" could
work as "v1".
Change-Id: I9631a083fd96a535153b6029b95a1d3c8d9966a2
Closes-bug: #1572616
Now Zaqar supports /ping and /health API, but they're missing
in zaqar client. This patch will fix it.
Change-Id: I34b454c486a7b4c693a540890eee48f162a07605
This patch adds the support for subscription create, which includes
the CLI support and the lib support. Besides, to make the functional
test work for subscription create, this patch also adds the lib
support for subscription get, delete, update and list to make things
easier.
Change-Id: Ie3ac27b731f41ea6023976aab3c1afbc283d659d
This's a regression issue introduced by
I4f2f2f240404b2619ba0ee75a99fecd0ad10040e
Though we support lazy creation for queue, but it doesn't make
sense there's no result after creating the queue explicitly from cli.
So this patch introduces a new parameter named force_create to make
sure make sure the queue create is called each time when it's called
from command line interface.
Closes-Bug: #1517812
Change-Id: I72477f39da27bfa3e2bec3b876152a494b318744
Zaqarclient v2 currently has missing features such as 'claims',
'flavors', and 'pools' that are needed in order to start implementing
a subscription management. I added support to claims as a priorital
step.
Co-Authored-By: MD NADEEM<md.nadeem@nectechnologies.in>
Change-Id: Id16e2f6a390e8387cce4545b9a03181ba03da3ce
Zaqar server threw UnauthorizedError when client
try to execute any cli command.
This patch fixes the issue and changes the default
authorization backend from noauth to keystone.
Change-Id: I88c2f5aa914b5fb40b6dc16a256d3e385d9aaa23
Closes-Bug: #1491738
Zaqarclient v2 currently has missing features that involve the
management of subscriptions, but in order to these to work it is
necessary to add other features such as 'queues', 'messages',
'claims', 'pools' and 'flavors'. I added 'queues' and 'messages' as a
priorital step before start working with the other features and with
subscriptions as well.
Change-Id: Iea082cbf9e1d0e4a745bc10e41e1206af6132fad
Some tests used incorrect order assertEqual(observed, expected).
The correct order expected by testtools is
assertEqual(expected, observed).
This patch fix the issue in some test file of zaqarclient.
The review is generated part-wise to ease review process.
Partial-Bug: #1259292
Change-Id: I3f51e3a400d1c408e6c65b9ed503efd414b3d5ed
Some tests used incorrect order assertEqual(observed, expected).
The correct order expected by testtools is
assertEqual(expected, observed).
This patch fix the issue in the module /tests/unit/queues/v1 of zaqarclient.
Partial-Bug: #1259292
Change-Id: Ia5969d904012647f29b5047e37cad9ce3a77a489
Allow for authenticating when running zaqarclient's functional tests so
that they can also be used in the gate and keystone mechanism can be
tested functionally
Change-Id: I0f1fd4374125d4b489f3804b79a672b39c714421
The `group` key was missing in the pool's functional tests. This commit
adds it, otherwise these tests will fail.
Change-Id: I02c0ed870a04e1280ae4e4213e6751fc8e04caeb
The current claims code doesn't work on v1.1 and v2 because on claims
creation it expects a list rather than a document. This patch fixes this
issue in a backwards compatible way.
Change-Id: I64e824227f148297aba4c27bbd2053d5bab483c5
Closes-bug: #1489863
This change introduces new requirements and fixes new checks by
the `hacking` module.
Change-Id: I3b98d5038c516b3115d7247fa0f4ea1189b33dff
Co-Authored-By: Victoria Martinez de la Cruz <victoria@redhat.com>
This fixes various behaviors of the client talking to the v1.1 API, and
enables functional tests for queues.
Change-Id: Icd30e32a17247790dfd57d6420d67f9140020db6
Closes-Bug: #1446677
Closes-Bug: #1446679
Pool instances can be created by just passing the name. They both
check at construction time whether the resource exist in the server or
not. If the resource doesn't exist, it'll attempt to create one.
Zaqarclient does not call anymore the 'pool_create' directly. It calls
'pool_get' first, which ensures the resource exists. if not, a 'pool'
will be created.
Change-Id: I8f18b5031c80cfd5744ba3b0b7058654934f44b4
Partial-Bug: #1396063
API returns a 204 for the health check with no body content.
The function should have returned True if http result was a 204,
or else a False.
I solved the problem by making the function return false in case of an
error.
Change-Id: I02771f5aa61db4ed83da952245744cb3a6163a26
Closes-bug: #1288986
https://review.openstack.org/#/c/108795/ adds the requirement
to encapsulate messages in JSON objects in API v1.1
This change adds that control to the Zaqar client maintaining
backwards compatibility with v1
Change-Id: I1723b843320ebcf2722fb4f6fcaaa6e1c63248e9
Since v1.1, the `X_PROJECT-ID` became a required header. This patch adds
a way to specify the project id regardless of the backend. In order to
pass the project id, it's necessary to pass the `os_project_id` option
in the `auth_opts` dictionary. For example:
auth_opts = {'options': {'os_project_id': 'yadayada'}}
Partially-Implements blueprint: api-v1.1
Change-Id: If72b758e634dc1e6bc1e1cc0c63361e8a43861bb
This patch adds support for flavors to the client library. Flavors are
an admin endpoint, which means pool's rules apply to them.
Since flavors were added since 1.1, this patch also adds a version
decorator that will help making sure features are accessible just if the
api_version the client has been instantiated with matches the version
the feature was added into.
Note that the core module does not use the version decorator. There are
2 reasons for this:
1. Users accessing the core module should know what they're doing
2. If the transport loads the spec for the API version it was
instantiated with. If that spec does not contain a specific action,
the whole operation will fail before hitting the wire.
Partially-Implements blueprint: api-v1.1
Change-Id: I92dbe417655a9eeefb030481a81a67840a63dd0e
The server's shard feature has been renamed to pool. This patch reflects
that change in the client library. The patch keeps old `shard*` methods
and functions for backwards compatibility and it also raises a
deprecation warning whenever they are used. These functions will be
removed right after k-1
Change-Id: I842bfbcf075845750bc4fff345086636cc775371
Closes-bug: #1348196
This patch implements pop in the client library. Pop is a new operation
that has been implemented in v1.1. It allows a client to remove N
messages from the top of queue. Although pop is a query parameter in the
server, it has been implemented as if it were an action.
Partially-Implements blueprint: api-v1.1
Change-Id: I29b771a6167185033821139bd795311f1a25a5e1
Bulk message delete was missing in the client. This patch implements
that feature for both v1 and v1.1.
Change-Id: Ief73fe5f67ae71d396c6122048c26020ea9592bb
This patch adds basic support for the API version 1.1. It basically
re-uses the specs and implementations from v1 since the API hasn't
really changed much.
Future patches will add support for the new methods and other changes.
Partially-Implements blueprint: api-v1.1
Change-Id: I40d02d6c2d3b932725f35204708d79785f59116b
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 patch aims to additional exception checking
on receiving other erroneous status codes apart from
400 and 404.
Change-Id: I184c2c0627c457d9c49a84e9e8313a0c88617ec1
Current `_Iterator` streams data from the server by default. This
behavior, although useful, shouldn't be considered a sane default. A
good example is when using `limit` on listing operations. If the default
is to stream, the limit will be ignored because the server client will
get everything from the server until there's anything left to consume.
This behavior can also be harmful if not used carefully.
This patch adds a `stream` method to the iterator and makes using this
behavior an explicit operation. The user has to opt-in for data
streaming.
Change-Id: Ib1af24960dff97cb956990d4caf88705f2f7a0d5