Skip to content

Commit c5f29d6

Browse files
committed
FUP: Add volume-update CLI pre V285 tests
This commit mainly to fix some comments from [1]. [1]https://review.opendev.org/#/c/712651/19/novaclient/tests/unit/v2/test_shell.py@4001 Blueprint: destroy-instance-with-datavolume Change-Id: Id809f22d0da2cdedf33a2c0df202f3953fd01673
1 parent 4d6c70d commit c5f29d6

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

doc/source/cli/nova.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3966,11 +3966,13 @@ new volume.
39663966

39673967
``--delete-on-termination``
39683968
Specify that the volume should be deleted when the server is destroyed.
3969+
It is mutually exclusive with '--no-delete-on-termination'.
39693970
(Supported by API versions '2.85' - '2.latest')
39703971

39713972
``--no-delete-on-termination``
39723973
Specify that the attached volume should not be deleted when
3973-
the server is destroyed. (Supported by API versions '2.85' - '2.latest')
3974+
the server is destroyed. It is mutually exclusive with '--delete-on-termination'.
3975+
(Supported by API versions '2.85' - '2.latest')
39743976

39753977
.. _nova_bash-completion:
39763978

novaclient/tests/unit/v2/test_shell.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4006,6 +4006,18 @@ def test_volume_update_swap_v285(self):
40064006
self.assert_called('PUT', '/servers/1234/os-volume_attachments/Work',
40074007
{'volumeAttachment': {'volumeId': 'Work'}})
40084008

4009+
def test_volume_update_delete_on_termination_pre_v285(self):
4010+
self.assertRaises(
4011+
SystemExit, self.run_command,
4012+
'volume-update sample-server --delete-on-termination Work Work',
4013+
api_version='2.84')
4014+
4015+
def test_volume_update_no_delete_on_termination_pre_v285(self):
4016+
self.assertRaises(
4017+
SystemExit, self.run_command,
4018+
'volume-update sample-server --no-delete-on-termination Work Work',
4019+
api_version='2.84')
4020+
40094021
def test_volume_update_v285(self):
40104022
self.run_command('volume-update sample-server --delete-on-termination '
40114023
'Work Work', api_version='2.85')

0 commit comments

Comments
 (0)