python-openstackclient 8.0.0__py3-none-any.whl → 8.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openstackclient/compute/client.py +5 -0
- openstackclient/compute/v2/console.py +7 -0
- openstackclient/compute/v2/console_connection.py +48 -0
- openstackclient/compute/v2/keypair.py +10 -3
- openstackclient/compute/v2/server.py +75 -10
- openstackclient/compute/v2/server_event.py +1 -1
- openstackclient/identity/common.py +79 -0
- openstackclient/identity/v3/application_credential.py +2 -2
- openstackclient/identity/v3/domain.py +62 -43
- openstackclient/identity/v3/group.py +113 -68
- openstackclient/identity/v3/project.py +17 -0
- openstackclient/identity/v3/user.py +38 -5
- openstackclient/image/client.py +5 -0
- openstackclient/image/v2/image.py +11 -11
- openstackclient/network/client.py +0 -6
- openstackclient/network/v2/floating_ip.py +58 -29
- openstackclient/network/v2/network_qos_rule.py +3 -11
- openstackclient/network/v2/router.py +1 -1
- openstackclient/network/v2/security_group.py +5 -4
- openstackclient/network/v2/security_group_rule.py +1 -1
- openstackclient/shell.py +1 -1
- openstackclient/tests/functional/base.py +5 -1
- openstackclient/tests/functional/compute/v2/test_keypair.py +41 -5
- openstackclient/tests/unit/compute/v2/fakes.py +81 -305
- openstackclient/tests/unit/compute/v2/test_console.py +18 -1
- openstackclient/tests/unit/compute/v2/test_console_connection.py +72 -0
- openstackclient/tests/unit/compute/v2/test_flavor.py +1 -1
- openstackclient/tests/unit/compute/v2/test_keypair.py +12 -5
- openstackclient/tests/unit/compute/v2/test_server.py +169 -46
- openstackclient/tests/unit/compute/v2/test_server_backup.py +32 -71
- openstackclient/tests/unit/compute/v2/test_server_event.py +2 -2
- openstackclient/tests/unit/compute/v2/test_server_image.py +33 -72
- openstackclient/tests/unit/compute/v2/test_server_migration.py +4 -4
- openstackclient/tests/unit/identity/v3/test_application_credential.py +47 -25
- openstackclient/tests/unit/identity/v3/test_domain.py +115 -105
- openstackclient/tests/unit/identity/v3/test_group.py +353 -202
- openstackclient/tests/unit/identity/v3/test_project.py +16 -0
- openstackclient/tests/unit/identity/v3/test_user.py +86 -6
- openstackclient/tests/unit/image/v1/test_image.py +8 -9
- openstackclient/tests/unit/image/v2/test_image.py +49 -49
- openstackclient/tests/unit/network/v2/fakes.py +405 -485
- openstackclient/tests/unit/network/v2/test_floating_ip_network.py +13 -19
- openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py +2 -2
- openstackclient/tests/unit/network/v2/test_ndp_proxy.py +1 -3
- openstackclient/tests/unit/network/v2/test_network.py +4 -4
- openstackclient/tests/unit/network/v2/test_network_agent.py +15 -29
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +16 -19
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +79 -152
- openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py +4 -6
- openstackclient/tests/unit/network/v2/test_network_rbac.py +2 -2
- openstackclient/tests/unit/network/v2/test_port.py +17 -17
- openstackclient/tests/unit/network/v2/test_router.py +73 -57
- openstackclient/tests/unit/network/v2/test_security_group_network.py +25 -27
- openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +1 -3
- openstackclient/tests/unit/network/v2/test_security_group_rule_network.py +33 -39
- openstackclient/tests/unit/volume/v2/fakes.py +1 -2
- openstackclient/tests/unit/volume/v2/test_service.py +57 -91
- openstackclient/tests/unit/volume/v2/test_volume.py +108 -105
- openstackclient/tests/unit/volume/v2/test_volume_backup.py +141 -148
- openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +293 -283
- openstackclient/tests/unit/volume/v3/test_block_storage_log_level.py +61 -71
- openstackclient/tests/unit/volume/v3/test_service.py +221 -141
- openstackclient/tests/unit/volume/v3/test_volume.py +130 -119
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +1 -1
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +198 -203
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +682 -47
- openstackclient/volume/v2/service.py +41 -38
- openstackclient/volume/v2/volume.py +63 -37
- openstackclient/volume/v2/volume_backup.py +9 -3
- openstackclient/volume/v2/volume_snapshot.py +121 -84
- openstackclient/volume/v3/block_storage_log_level.py +22 -28
- openstackclient/volume/v3/service.py +105 -14
- openstackclient/volume/v3/volume.py +200 -39
- openstackclient/volume/v3/volume_backup.py +24 -19
- openstackclient/volume/v3/volume_snapshot.py +485 -10
- {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/AUTHORS +8 -0
- python_openstackclient-8.1.0.dist-info/METADATA +264 -0
- {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/RECORD +83 -81
- {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/entry_points.txt +7 -6
- python_openstackclient-8.1.0.dist-info/pbr.json +1 -0
- python_openstackclient-8.0.0.dist-info/METADATA +0 -166
- python_openstackclient-8.0.0.dist-info/pbr.json +0 -1
- {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/LICENSE +0 -0
- {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/WHEEL +0 -0
- {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/top_level.txt +0 -0
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
|
|
14
14
|
from unittest import mock
|
|
15
15
|
|
|
16
|
+
from openstack.block_storage.v2 import volume as _volume
|
|
17
|
+
from openstack import exceptions as sdk_exceptions
|
|
18
|
+
from openstack.test import fakes as sdk_fakes
|
|
16
19
|
from osc_lib.cli import format_columns
|
|
17
20
|
from osc_lib import exceptions
|
|
18
21
|
from osc_lib import utils
|
|
@@ -46,12 +49,6 @@ class TestVolume(volume_fakes.TestVolume):
|
|
|
46
49
|
self.consistencygroups_mock = self.volume_client.consistencygroups
|
|
47
50
|
self.consistencygroups_mock.reset_mock()
|
|
48
51
|
|
|
49
|
-
def setup_volumes_mock(self, count):
|
|
50
|
-
volumes = volume_fakes.create_volumes(count=count)
|
|
51
|
-
|
|
52
|
-
self.volumes_mock.get = volume_fakes.get_volumes(volumes, 0)
|
|
53
|
-
return volumes
|
|
54
|
-
|
|
55
52
|
|
|
56
53
|
class TestVolumeCreate(TestVolume):
|
|
57
54
|
project = identity_fakes.FakeProject.create_one_project()
|
|
@@ -188,7 +185,7 @@ class TestVolumeCreate(TestVolume):
|
|
|
188
185
|
self.new_volume.name,
|
|
189
186
|
]
|
|
190
187
|
verifylist = [
|
|
191
|
-
('
|
|
188
|
+
('properties', {'Alpha': 'a', 'Beta': 'b'}),
|
|
192
189
|
('size', self.new_volume.size),
|
|
193
190
|
('name', self.new_volume.name),
|
|
194
191
|
]
|
|
@@ -382,9 +379,7 @@ class TestVolumeCreate(TestVolume):
|
|
|
382
379
|
]
|
|
383
380
|
verifylist = [
|
|
384
381
|
('bootable', True),
|
|
385
|
-
('non_bootable', False),
|
|
386
382
|
('read_only', True),
|
|
387
|
-
('read_write', False),
|
|
388
383
|
('size', self.new_volume.size),
|
|
389
384
|
('name', self.new_volume.name),
|
|
390
385
|
]
|
|
@@ -427,9 +422,7 @@ class TestVolumeCreate(TestVolume):
|
|
|
427
422
|
]
|
|
428
423
|
verifylist = [
|
|
429
424
|
('bootable', False),
|
|
430
|
-
('non_bootable', True),
|
|
431
425
|
('read_only', False),
|
|
432
|
-
('read_write', True),
|
|
433
426
|
('size', self.new_volume.size),
|
|
434
427
|
('name', self.new_volume.name),
|
|
435
428
|
]
|
|
@@ -481,9 +474,7 @@ class TestVolumeCreate(TestVolume):
|
|
|
481
474
|
]
|
|
482
475
|
verifylist = [
|
|
483
476
|
('bootable', True),
|
|
484
|
-
('non_bootable', False),
|
|
485
477
|
('read_only', True),
|
|
486
|
-
('read_write', False),
|
|
487
478
|
('size', self.new_volume.size),
|
|
488
479
|
('name', self.new_volume.name),
|
|
489
480
|
]
|
|
@@ -532,9 +523,7 @@ class TestVolumeCreate(TestVolume):
|
|
|
532
523
|
]
|
|
533
524
|
verifylist = [
|
|
534
525
|
('bootable', False),
|
|
535
|
-
('non_bootable', True),
|
|
536
526
|
('read_only', True),
|
|
537
|
-
('read_write', False),
|
|
538
527
|
('size', self.new_volume.size),
|
|
539
528
|
('name', self.new_volume.name),
|
|
540
529
|
]
|
|
@@ -670,37 +659,37 @@ class TestVolumeCreate(TestVolume):
|
|
|
670
659
|
self.assertCountEqual(self.datalist, data)
|
|
671
660
|
|
|
672
661
|
|
|
673
|
-
class TestVolumeDelete(TestVolume):
|
|
662
|
+
class TestVolumeDelete(volume_fakes.TestVolume):
|
|
674
663
|
def setUp(self):
|
|
675
664
|
super().setUp()
|
|
676
665
|
|
|
677
|
-
self.
|
|
666
|
+
self.volumes = list(sdk_fakes.generate_fake_resources(_volume.Volume))
|
|
667
|
+
self.volume_sdk_client.find_volume.side_effect = self.volumes
|
|
668
|
+
self.volume_sdk_client.delete_volume.return_value = None
|
|
678
669
|
|
|
679
|
-
# Get the command object to mock
|
|
680
670
|
self.cmd = volume.DeleteVolume(self.app, None)
|
|
681
671
|
|
|
682
672
|
def test_volume_delete_one_volume(self):
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
arglist = [volumes[0].id]
|
|
673
|
+
arglist = [self.volumes[0].id]
|
|
686
674
|
verifylist = [
|
|
687
675
|
("force", False),
|
|
688
676
|
("purge", False),
|
|
689
|
-
("volumes", [volumes[0].id]),
|
|
677
|
+
("volumes", [self.volumes[0].id]),
|
|
690
678
|
]
|
|
691
679
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
692
680
|
|
|
693
681
|
result = self.cmd.take_action(parsed_args)
|
|
682
|
+
self.assertIsNone(result)
|
|
694
683
|
|
|
695
|
-
self.
|
|
696
|
-
volumes[0].id,
|
|
684
|
+
self.volume_sdk_client.find_volume.assert_called_once_with(
|
|
685
|
+
self.volumes[0].id, ignore_missing=False
|
|
686
|
+
)
|
|
687
|
+
self.volume_sdk_client.delete_volume.assert_called_once_with(
|
|
688
|
+
self.volumes[0].id, cascade=False, force=False
|
|
697
689
|
)
|
|
698
|
-
self.assertIsNone(result)
|
|
699
690
|
|
|
700
691
|
def test_volume_delete_multi_volumes(self):
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
arglist = [v.id for v in volumes]
|
|
692
|
+
arglist = [v.id for v in self.volumes]
|
|
704
693
|
verifylist = [
|
|
705
694
|
('force', False),
|
|
706
695
|
('purge', False),
|
|
@@ -709,83 +698,95 @@ class TestVolumeDelete(TestVolume):
|
|
|
709
698
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
710
699
|
|
|
711
700
|
result = self.cmd.take_action(parsed_args)
|
|
712
|
-
|
|
713
|
-
calls = [mock.call(v.id, cascade=False) for v in volumes]
|
|
714
|
-
self.volumes_mock.delete.assert_has_calls(calls)
|
|
715
701
|
self.assertIsNone(result)
|
|
716
702
|
|
|
703
|
+
self.volume_sdk_client.find_volume.assert_has_calls(
|
|
704
|
+
[mock.call(v.id, ignore_missing=False) for v in self.volumes]
|
|
705
|
+
)
|
|
706
|
+
self.volume_sdk_client.delete_volume.assert_has_calls(
|
|
707
|
+
[mock.call(v.id, cascade=False, force=False) for v in self.volumes]
|
|
708
|
+
)
|
|
709
|
+
|
|
717
710
|
def test_volume_delete_multi_volumes_with_exception(self):
|
|
718
|
-
|
|
711
|
+
self.volume_sdk_client.find_volume.side_effect = [
|
|
712
|
+
self.volumes[0],
|
|
713
|
+
sdk_exceptions.NotFoundException(),
|
|
714
|
+
]
|
|
719
715
|
|
|
720
716
|
arglist = [
|
|
721
|
-
volumes[0].id,
|
|
717
|
+
self.volumes[0].id,
|
|
722
718
|
'unexist_volume',
|
|
723
719
|
]
|
|
724
720
|
verifylist = [
|
|
725
721
|
('force', False),
|
|
726
722
|
('purge', False),
|
|
727
|
-
('volumes',
|
|
723
|
+
('volumes', [self.volumes[0].id, 'unexist_volume']),
|
|
728
724
|
]
|
|
729
725
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
730
726
|
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
self.fail('CommandError should be raised.')
|
|
738
|
-
except exceptions.CommandError as e:
|
|
739
|
-
self.assertEqual('1 of 2 volumes failed to delete.', str(e))
|
|
740
|
-
|
|
741
|
-
find_mock.assert_any_call(self.volumes_mock, volumes[0].id)
|
|
742
|
-
find_mock.assert_any_call(self.volumes_mock, 'unexist_volume')
|
|
743
|
-
|
|
744
|
-
self.assertEqual(2, find_mock.call_count)
|
|
745
|
-
self.volumes_mock.delete.assert_called_once_with(
|
|
746
|
-
volumes[0].id, cascade=False
|
|
747
|
-
)
|
|
727
|
+
exc = self.assertRaises(
|
|
728
|
+
exceptions.CommandError,
|
|
729
|
+
self.cmd.take_action,
|
|
730
|
+
parsed_args,
|
|
731
|
+
)
|
|
732
|
+
self.assertEqual('1 of 2 volumes failed to delete.', str(exc))
|
|
748
733
|
|
|
749
|
-
|
|
750
|
-
|
|
734
|
+
self.volume_sdk_client.find_volume.assert_has_calls(
|
|
735
|
+
[
|
|
736
|
+
mock.call(self.volumes[0].id, ignore_missing=False),
|
|
737
|
+
mock.call('unexist_volume', ignore_missing=False),
|
|
738
|
+
]
|
|
739
|
+
)
|
|
740
|
+
self.volume_sdk_client.delete_volume.assert_has_calls(
|
|
741
|
+
[
|
|
742
|
+
mock.call(self.volumes[0].id, cascade=False, force=False),
|
|
743
|
+
]
|
|
744
|
+
)
|
|
751
745
|
|
|
746
|
+
def test_volume_delete_with_purge(self):
|
|
752
747
|
arglist = [
|
|
753
748
|
'--purge',
|
|
754
|
-
volumes[0].id,
|
|
749
|
+
self.volumes[0].id,
|
|
755
750
|
]
|
|
756
751
|
verifylist = [
|
|
757
752
|
('force', False),
|
|
758
753
|
('purge', True),
|
|
759
|
-
('volumes', [volumes[0].id]),
|
|
754
|
+
('volumes', [self.volumes[0].id]),
|
|
760
755
|
]
|
|
761
756
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
762
757
|
|
|
763
758
|
result = self.cmd.take_action(parsed_args)
|
|
759
|
+
self.assertIsNone(result)
|
|
764
760
|
|
|
765
|
-
self.
|
|
766
|
-
volumes[0].id,
|
|
761
|
+
self.volume_sdk_client.find_volume.assert_called_once_with(
|
|
762
|
+
self.volumes[0].id, ignore_missing=False
|
|
763
|
+
)
|
|
764
|
+
self.volume_sdk_client.delete_volume.assert_called_once_with(
|
|
765
|
+
self.volumes[0].id, cascade=True, force=False
|
|
767
766
|
)
|
|
768
|
-
self.assertIsNone(result)
|
|
769
767
|
|
|
770
768
|
def test_volume_delete_with_force(self):
|
|
771
|
-
volumes = self.setup_volumes_mock(count=1)
|
|
772
|
-
|
|
773
769
|
arglist = [
|
|
774
770
|
'--force',
|
|
775
|
-
volumes[0].id,
|
|
771
|
+
self.volumes[0].id,
|
|
776
772
|
]
|
|
777
773
|
verifylist = [
|
|
778
774
|
('force', True),
|
|
779
775
|
('purge', False),
|
|
780
|
-
('volumes', [volumes[0].id]),
|
|
776
|
+
('volumes', [self.volumes[0].id]),
|
|
781
777
|
]
|
|
782
778
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
783
779
|
|
|
784
780
|
result = self.cmd.take_action(parsed_args)
|
|
785
|
-
|
|
786
|
-
self.volumes_mock.force_delete.assert_called_once_with(volumes[0].id)
|
|
787
781
|
self.assertIsNone(result)
|
|
788
782
|
|
|
783
|
+
self.volume_sdk_client.find_volume.assert_called_once_with(
|
|
784
|
+
self.volumes[0].id, ignore_missing=False
|
|
785
|
+
)
|
|
786
|
+
self.volume_sdk_client.delete_volume.assert_called_once_with(
|
|
787
|
+
self.volumes[0].id, cascade=False, force=True
|
|
788
|
+
)
|
|
789
|
+
|
|
789
790
|
|
|
790
791
|
class TestVolumeList(TestVolume):
|
|
791
792
|
project = identity_fakes.FakeProject.create_one_project()
|
|
@@ -1407,16 +1408,16 @@ class TestVolumeSet(TestVolume):
|
|
|
1407
1408
|
self.new_volume.id,
|
|
1408
1409
|
]
|
|
1409
1410
|
verifylist = [
|
|
1410
|
-
('
|
|
1411
|
+
('properties', {'a': 'b', 'c': 'd'}),
|
|
1411
1412
|
('volume', self.new_volume.id),
|
|
1412
|
-
('bootable',
|
|
1413
|
-
('
|
|
1413
|
+
('bootable', None),
|
|
1414
|
+
('read_only', None),
|
|
1414
1415
|
]
|
|
1415
1416
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
1416
1417
|
|
|
1417
1418
|
self.cmd.take_action(parsed_args)
|
|
1418
1419
|
self.volumes_mock.set_metadata.assert_called_with(
|
|
1419
|
-
self.new_volume.id, parsed_args.
|
|
1420
|
+
self.new_volume.id, parsed_args.properties
|
|
1420
1421
|
)
|
|
1421
1422
|
|
|
1422
1423
|
def test_volume_set_image_property(self):
|
|
@@ -1428,10 +1429,10 @@ class TestVolumeSet(TestVolume):
|
|
|
1428
1429
|
self.new_volume.id,
|
|
1429
1430
|
]
|
|
1430
1431
|
verifylist = [
|
|
1431
|
-
('
|
|
1432
|
+
('image_properties', {'Alpha': 'a', 'Beta': 'b'}),
|
|
1432
1433
|
('volume', self.new_volume.id),
|
|
1433
|
-
('bootable',
|
|
1434
|
-
('
|
|
1434
|
+
('bootable', None),
|
|
1435
|
+
('read_only', None),
|
|
1435
1436
|
]
|
|
1436
1437
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
1437
1438
|
|
|
@@ -1439,14 +1440,13 @@ class TestVolumeSet(TestVolume):
|
|
|
1439
1440
|
# returns nothing
|
|
1440
1441
|
self.cmd.take_action(parsed_args)
|
|
1441
1442
|
self.volumes_mock.set_image_metadata.assert_called_with(
|
|
1442
|
-
self.new_volume.id, parsed_args.
|
|
1443
|
+
self.new_volume.id, parsed_args.image_properties
|
|
1443
1444
|
)
|
|
1444
1445
|
|
|
1445
1446
|
def test_volume_set_state(self):
|
|
1446
1447
|
arglist = ['--state', 'error', self.new_volume.id]
|
|
1447
1448
|
verifylist = [
|
|
1448
|
-
('read_only',
|
|
1449
|
-
('read_write', False),
|
|
1449
|
+
('read_only', None),
|
|
1450
1450
|
('state', 'error'),
|
|
1451
1451
|
('volume', self.new_volume.id),
|
|
1452
1452
|
]
|
|
@@ -1511,36 +1511,40 @@ class TestVolumeSet(TestVolume):
|
|
|
1511
1511
|
|
|
1512
1512
|
def test_volume_set_bootable(self):
|
|
1513
1513
|
arglist = [
|
|
1514
|
-
|
|
1515
|
-
|
|
1514
|
+
'--bootable',
|
|
1515
|
+
self.new_volume.id,
|
|
1516
1516
|
]
|
|
1517
1517
|
verifylist = [
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
],
|
|
1523
|
-
[
|
|
1524
|
-
('bootable', False),
|
|
1525
|
-
('non_bootable', True),
|
|
1526
|
-
('volume', self.new_volume.id),
|
|
1527
|
-
],
|
|
1528
|
-
]
|
|
1529
|
-
for index in range(len(arglist)):
|
|
1530
|
-
parsed_args = self.check_parser(
|
|
1531
|
-
self.cmd, arglist[index], verifylist[index]
|
|
1532
|
-
)
|
|
1518
|
+
('bootable', True),
|
|
1519
|
+
('volume', self.new_volume.id),
|
|
1520
|
+
]
|
|
1521
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
1533
1522
|
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1523
|
+
self.cmd.take_action(parsed_args)
|
|
1524
|
+
self.volumes_mock.set_bootable.assert_called_with(
|
|
1525
|
+
self.new_volume.id, verifylist[0][1]
|
|
1526
|
+
)
|
|
1527
|
+
|
|
1528
|
+
def test_volume_set_non_bootable(self):
|
|
1529
|
+
arglist = [
|
|
1530
|
+
'--non-bootable',
|
|
1531
|
+
self.new_volume.id,
|
|
1532
|
+
]
|
|
1533
|
+
verifylist = [
|
|
1534
|
+
('bootable', False),
|
|
1535
|
+
('volume', self.new_volume.id),
|
|
1536
|
+
]
|
|
1537
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
1538
|
+
|
|
1539
|
+
self.cmd.take_action(parsed_args)
|
|
1540
|
+
self.volumes_mock.set_bootable.assert_called_with(
|
|
1541
|
+
self.new_volume.id, verifylist[0][1]
|
|
1542
|
+
)
|
|
1538
1543
|
|
|
1539
|
-
def
|
|
1544
|
+
def test_volume_set_read_only(self):
|
|
1540
1545
|
arglist = ['--read-only', self.new_volume.id]
|
|
1541
1546
|
verifylist = [
|
|
1542
1547
|
('read_only', True),
|
|
1543
|
-
('read_write', False),
|
|
1544
1548
|
('volume', self.new_volume.id),
|
|
1545
1549
|
]
|
|
1546
1550
|
|
|
@@ -1556,7 +1560,6 @@ class TestVolumeSet(TestVolume):
|
|
|
1556
1560
|
arglist = ['--read-write', self.new_volume.id]
|
|
1557
1561
|
verifylist = [
|
|
1558
1562
|
('read_only', False),
|
|
1559
|
-
('read_write', True),
|
|
1560
1563
|
('volume', self.new_volume.id),
|
|
1561
1564
|
]
|
|
1562
1565
|
|
|
@@ -1686,7 +1689,7 @@ class TestVolumeUnset(TestVolume):
|
|
|
1686
1689
|
self.new_volume.id,
|
|
1687
1690
|
]
|
|
1688
1691
|
verifylist = [
|
|
1689
|
-
('
|
|
1692
|
+
('image_properties', {'Alpha': 'a', 'Beta': 'b'}),
|
|
1690
1693
|
('volume', self.new_volume.id),
|
|
1691
1694
|
]
|
|
1692
1695
|
parsed_args = self.check_parser(self.cmd_set, arglist, verifylist)
|
|
@@ -1702,7 +1705,7 @@ class TestVolumeUnset(TestVolume):
|
|
|
1702
1705
|
self.new_volume.id,
|
|
1703
1706
|
]
|
|
1704
1707
|
verifylist_unset = [
|
|
1705
|
-
('
|
|
1708
|
+
('image_properties', ['Alpha']),
|
|
1706
1709
|
('volume', self.new_volume.id),
|
|
1707
1710
|
]
|
|
1708
1711
|
parsed_args_unset = self.check_parser(
|
|
@@ -1714,7 +1717,7 @@ class TestVolumeUnset(TestVolume):
|
|
|
1714
1717
|
self.cmd_unset.take_action(parsed_args_unset)
|
|
1715
1718
|
|
|
1716
1719
|
self.volumes_mock.delete_image_metadata.assert_called_with(
|
|
1717
|
-
self.new_volume.id, parsed_args_unset.
|
|
1720
|
+
self.new_volume.id, parsed_args_unset.image_properties
|
|
1718
1721
|
)
|
|
1719
1722
|
|
|
1720
1723
|
def test_volume_unset_image_property_fail(self):
|
|
@@ -1729,8 +1732,8 @@ class TestVolumeUnset(TestVolume):
|
|
|
1729
1732
|
self.new_volume.id,
|
|
1730
1733
|
]
|
|
1731
1734
|
verifylist = [
|
|
1732
|
-
('
|
|
1733
|
-
('
|
|
1735
|
+
('image_properties', ['Alpha']),
|
|
1736
|
+
('properties', ['Beta']),
|
|
1734
1737
|
('volume', self.new_volume.id),
|
|
1735
1738
|
]
|
|
1736
1739
|
parsed_args = self.check_parser(self.cmd_unset, arglist, verifylist)
|
|
@@ -1743,10 +1746,10 @@ class TestVolumeUnset(TestVolume):
|
|
|
1743
1746
|
'One or more of the unset operations failed', str(e)
|
|
1744
1747
|
)
|
|
1745
1748
|
self.volumes_mock.delete_image_metadata.assert_called_with(
|
|
1746
|
-
self.new_volume.id, parsed_args.
|
|
1749
|
+
self.new_volume.id, parsed_args.image_properties
|
|
1747
1750
|
)
|
|
1748
1751
|
self.volumes_mock.delete_metadata.assert_called_with(
|
|
1749
|
-
self.new_volume.id, parsed_args.
|
|
1752
|
+
self.new_volume.id, parsed_args.properties
|
|
1750
1753
|
)
|
|
1751
1754
|
|
|
1752
1755
|
|