Commit Graph

10 Commits

Author SHA1 Message Date
Takashi Natsume 7ef2c28bf3 Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I4d45ae17f6f84f945f5dd049a929216ce6b6b58e
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2020-04-26 10:12:09 +00:00
Matt Riedemann 41f66d15aa Remove deprecated image commands/API bindings
We deprecated the image proxy commands and APIs in Newton
due to the 2.36 microversion. We said after Ocata 15.0.0 we
would remove these, which we can do now in Pike.

Note that the list() method on the ImageManager has to be
moved to the GlanceManager since we still need to list images
for the --image-with option on the boot command. The _match_image
method in the shell has to be updated for a glance v2 response
where custom metadata properties are flat in the image body.

This needs to be released with a major version bump.

Change-Id: I2d9fd0243d42538bd1417a42357c17b09368d2a5
2017-02-22 15:56:28 -05:00
Pavel Kholkin 75052a7afc [proxy-api] microversion 2.39 deprecates image-metadata proxy API
Almost all proxy APIs were deprecated in microversion 2.36.
But the sub-resource image-metadata of image was forgotten to deprecate.
This patch deprecates the image-metdata API from 2.39.

Image commands were already deprecated since 2.36 in
I450917f7fcbfe0a3ea7921c82af9863e80cb40a1

Implements blueprint deprecate-image-meta-proxy-api

Change-Id: Idd4cd1d1fec13f9e5f89dc419b57e094c9ad4b3b
2016-12-16 21:06:28 +03:00
Matt Riedemann 20b721e1ad Cap image API deprecated methods at 2.35
The image proxy API GET/DELETE methods are deprecated
at microversion 2.36 and will return a 404 after that.

This adds the wraps decorator to those python API methods
so set the cap at 2.35 so rather than get a 404 you'll
get a more uesful VersionNotFoundForAPIMethod.

Note that set_meta and delete_meta are not decorated
because we missed deprecating the image-metadata proxy API
with the 2.36 microversion. That will be fixed in Ocata.

Related to blueprint deprecate-api-proxies

Change-Id: Ie65efadb5c65e8a624ffd0315a634accd49f1c30
2016-08-19 16:25:07 -04:00
Matt Riedemann a602e59806 Deprecate image list/show/delete/update CLIs/APIs
This deprecates all of the image CLIs/python API bindings that use
the Nova os-images API which is a proxy to the Glance v1 API.

This will emit a warning each time a deprecated CLI/API is used and also
updates the help docs for the deprecated CLIs and docstrings for APIs.

The plan is to do a release once this is merged so people start seeing
it and then we'll actually remove the deprecated CLIs/APIs in the first
python-novaclient release after the Nova server 15.0.0 'O' release.

Depends-On: Iff5fb3180855de7adb3399f6be16bedc8543b4ec

Change-Id: I3f60cc7f4c6e27861c4a84b925d573f35f1a1848
2016-04-12 11:57:57 -04:00
Takashi NATSUME f194a5abad Add return-request-id-to-caller function(2/5)
Add return-request-id-to-caller function to
resources and resource managers in the following files.
The methods in the resource class and resource manager return
a wrapper class that has 'request_ids' property.
The caller can get request ids of the callee via the property.

* novaclient/v2/agents.py
* novaclient/v2/aggregates.py
* novaclient/v2/availability_zones.py
* novaclient/v2/certs.py
* novaclient/v2/cloudpipe.py
* novaclient/v2/fixed_ips.py
* novaclient/v2/flavor_access.py
* novaclient/v2/flavors.py
* novaclient/v2/floating_ip_dns.py
* novaclient/v2/floating_ip_pools.py
* novaclient/v2/floating_ips_bulk.py
* novaclient/v2/floating_ips.py
* novaclient/v2/fping.py
* novaclient/v2/hosts.py
* novaclient/v2/hypervisors.py
* novaclient/v2/images.py

Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: Ic624d532f1a468dd45105bbb5aa6d8a730984338
Implements: blueprint return-request-id-to-caller
2016-01-27 02:45:22 +00:00
Pete Savage bde241b947 Added marker functionality to flavours and images
Markers to support pagination was missing from flavours
and from images.

Change-Id: I27de83f18a4850b63020ac60e010839a13e916fb
2015-06-26 11:05:10 +01:00
Kevin L. Mitchell 0a327ce375 Eliminate test comprehensions
The novaclient tests are rife with examples of using a list comprehension
to perform a series of asserts, when a simple for loop would be more
appropriate and more idiomatic; part of the problem is the propensity
for people to cut and paste.  Eliminating the existing examples should
remove the temptation for developers to use this non-idiom to perform
tests.

Change-Id: I2cc8979e720740eae81692a60e30a3d95dce2a2c
2015-05-21 19:12:35 -05:00
Pavel Kholkin 9f4d64a1bf Cleanup in test_images and image_fakes
Unused code was removed in fixture_data/images.py
for unknown image requests that relate to
v2/images.py and test_images for them.

Change-Id: I7e31a572116b1e5cf0df9f431f8e53470d27d066
2015-03-02 19:07:46 +03:00
Andrey Kurilin 0a60aae852 Rename v1_1 to v2
Module novaclient.v1_1 is used as implementation of V1.1, V2 and V3.
Since future development(microversioning) will be done across V2,
implementation should be done in appropriate module(to prevent misleading).

Despite the fact that implementation for all versions are equal, discover
method for contrib path worked only for v1.1. This patch fixes this bug and
modifies shell tests to check all versions.

Change-Id: Ib6798f4dfe177586302141f522dc593560ce6a5b
2015-02-04 17:40:46 +02:00