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>
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
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
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
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
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
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
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
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