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>
This is compatible with Python 3-only syntax.
Change-Id: I462f4242b9a5f8d8cd6b0cb3d328dfd9d93ba200
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Mostly a find-replace job. Let's do this now so we don't have to carry
it for the next decade.
Change-Id: I7bef9fb7c6895f746cee1aca6522786f38b9857c
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This adds the nova boot command and python API binding
support for creating a server with block device mappings
defined using a specific volume type.
Depends-On: https://review.openstack.org/606398/
Depends-On: https://review.openstack.org/#/c/610349/
Part of blueprint boot-instance-specific-storage-backend
Change-Id: I484ee065119b5783db212ea64efa60e87c40338c
This reverts commit eff607ccef.
There was no apparent need for the change being reverted since
user can list all servers by specifying --limit=1 when running
the nova list command.
The change introduced a problem whereby the first pass to
list instances from the server would get up to
[api]/max_limit (default 1000) results and then call again
with a marker. If the last instance in the list (the marker)
is corrupted in the instance_mappings table in the API DB
by not having an associated cell mapping, listing instances
will always fail with a MarkerNotFound error even though
the CLI user is not passing a marker nor specifying
--limit=-1. The corrupted instance mapping record resulting
in the MarkerNotFound error is something else that should
be fixed on the server side (and likely result in a 500) but
the change in behavior of the CLI makes it always fail
if you hit this even if you're not passing a marker.
Change-Id: Ibb43f500a74733b85bd3242592d36985bfb45856
Closes-Bug: #1773945
Output of `nova list` command contained only `max_limit` entries even
when there were more. The list needs to be obtained in multiple
requests and the paging loop was terminated prematurely.
Change-Id: I4194e6d5e34ecc0ac704851c08bb895e223aa850
Closes-Bug: 1743532
In line with other clients testing we've found that having the
requests-mock fixture at self.requests can be misleading for new people
as it looks like you're calling requests itself.
Also make use of some of the new features of requests-mock like query
parsing, json handling, method names.
Change-Id: Id61b88c53478d49f91c3f880ed5b90d638051ba0
The novaclient tests are broken with the master (unreleased) branch of
requests. This is because most of the mocking that novaclient does with
requests in insufficient.
Requests-mock is for exactly this purpose and is already widely used in
novaclient so replace using mock with requests-mock where appropriate.
Closes-Bug: #1630157
Change-Id: Ie91daeb5f0c241eb83b77c04ac1b12e431d6671c
Add return-request-id-to-caller function to
'Server' resource and 'ServerManager'.
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/servers.py
Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: I8c2d3abcebba7823f42e2f27356e73bc6d7ade42
Implements: blueprint return-request-id-to-caller
There is a lot of H404/405 violations in novaclient, and it is better
to fix those to have a better doc string for class/methods.
This patch fixes these violations for files under novaclient/tests/
folder.
As there are lot of violations and cannot be fixed in single patches,
So separating those in multiple patches for easy review.
Partial-Bug: #1521899
Change-Id: I6e712ece14c745013bfba0bee9d77e7875dd2263
In order to pave the way for functional testing, move existing unit
tests into a directory labeled unit. A subsequent patch will add a
directory for functional tests.
Change-Id: I0adb8b9f14451acb382c725d31f5387b4b6d82bb