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 commit add a new CLI
``nova volume-update [--[no-]delete-on-termination]
<server> <src_volume> <dest_volume>`` to update
'delete_on_termination' for an attached volume, that the user can
decide whether to delete attached volumes when destroying the server.
Depends-On: https://review.opendev.org/#/c/711194/
Change-Id: I1fc64fb6e6611c92c6b72265e1bf4b32e9c45f0a
Blueprint: destroy-instance-with-datavolume
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>
Support add 'delete_on_termination' field to the voume attach API to
support configuring whether to delete the data volume when the server
is destroyed.
* Updating the ``nova volume-attachments`` command to show the
``delete_on_termination`` value if 2.79 or greater is used.
* The '--delete-on-termination' option is added to the `nova volume-attach`
CLI.
Depends-On: https://review.opendev.org/#/c/673133/
Part of blueprint support-delete-on-termination-in-server-attach-volume
Change-Id: I8dcf2fd21a2fd99ca4e05bd953fbbe026be3a619
The argument to the function should be the volume ID,
not the attachment ID.So the argument name of the
function here is easy to misunderstand.
Change-Id: Ie093b6acebe8b9e8dbdfed89856666db25bcf756
The help for the `volume-update` command says:
update_server_volume(server_id, attachment_id, new_volume_id)
Update the volume identified by the attachment ID, that is
attached to the given server ID
Parameters:
server_id – The ID of the server
attachment_id – The ID of the attachment
new_volume_id – The ID of the new volume to attach
Return type:
Volume
But in reality the command takes an original volume and a
destination volume. The update help is also not very clear
regarding what the command actually does and the fact that
it's primarily a libvirt data migration from src volume to
destination volume.
This patch modifies the help to show the correct arguments
and also adds some more info regarding what the command
is doing.
Change-Id: Ia267285f85854976545c2a72c3729c1bfcb2c991
Closes-Bug: #1690397
Currently we store api_version in two places: client and
HTTPClient/SessionClient instances.
It would be nice to store it in one place, so it would be easier
to change api_version without recreating novaclient object.
Change-Id: I36369a126c20de5922141e8725834ca93d6b0a1a
23f13437dd deprecated the
purely volume or volume-snapshot related CLIs and python
API bindings during Kilo. python-cinderclient should be
used for the python API bindings now, and python-openstackclient
should be used for the CLI for those operations.
The alternate_service_type context manager is also removed
since it was only used for proxying through to the volume API
endpoint.
Since the proxy for creating volumes is removed, we have to
add python-cinderclient for testing the volume attachment
CLIs/APIs that are left intact.
Change-Id: I09a6501603667350f49b1b1fa130353a6d5272a2
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/volume_snapshots.py
* novaclient/v2/volumes.py
* novaclient/v2/volume_types.py
Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: I4de8c5cf685a5970acc92f8a58a1db26a8d9ffc7
Implements: blueprint return-request-id-to-caller
This deprecates all of the volume CLIs/APIs that go directly to the
cinder API via the volume service type.
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 2016.1 'M' release.
DocImpact: The volume, volume-type and volume-snapshot CRUD CLIs/APIs are
deprecated and will be removed after the Nova 2016.1 release.
Use python-cinderclient or openstackclient for CLIs instead.
Use python-cinderclient or python-openstacksdk for APIs instead.
Related-Bug: #1454369
Change-Id: I4e92f924739de9b664e08117984bfb60359f2212
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
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