python-openstackclient 7.4.0__py3-none-any.whl → 8.0.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/common/availability_zone.py +3 -6
- openstackclient/common/clientmanager.py +2 -1
- openstackclient/common/envvars.py +57 -0
- openstackclient/common/extension.py +3 -11
- openstackclient/common/limits.py +1 -1
- openstackclient/common/project_cleanup.py +3 -2
- openstackclient/common/quota.py +54 -28
- openstackclient/compute/client.py +2 -5
- openstackclient/compute/v2/agent.py +5 -5
- openstackclient/compute/v2/aggregate.py +17 -15
- openstackclient/compute/v2/console.py +3 -4
- openstackclient/compute/v2/flavor.py +14 -18
- openstackclient/compute/v2/host.py +3 -3
- openstackclient/compute/v2/hypervisor.py +10 -4
- openstackclient/compute/v2/hypervisor_stats.py +1 -1
- openstackclient/compute/v2/keypair.py +8 -10
- openstackclient/compute/v2/server.py +70 -112
- openstackclient/compute/v2/server_backup.py +1 -1
- openstackclient/compute/v2/server_event.py +7 -16
- openstackclient/compute/v2/server_group.py +6 -6
- openstackclient/compute/v2/server_image.py +1 -1
- openstackclient/compute/v2/server_migration.py +6 -6
- openstackclient/compute/v2/server_volume.py +4 -4
- openstackclient/compute/v2/service.py +9 -13
- openstackclient/compute/v2/usage.py +4 -6
- openstackclient/identity/client.py +2 -4
- openstackclient/identity/common.py +16 -17
- openstackclient/identity/v2_0/ec2creds.py +4 -3
- openstackclient/identity/v2_0/endpoint.py +12 -10
- openstackclient/identity/v2_0/project.py +6 -6
- openstackclient/identity/v2_0/role.py +1 -1
- openstackclient/identity/v2_0/service.py +7 -7
- openstackclient/identity/v2_0/user.py +6 -21
- openstackclient/identity/v3/access_rule.py +2 -5
- openstackclient/identity/v3/consumer.py +4 -3
- openstackclient/identity/v3/credential.py +6 -7
- openstackclient/identity/v3/domain.py +1 -1
- openstackclient/identity/v3/ec2creds.py +4 -3
- openstackclient/identity/v3/endpoint.py +104 -88
- openstackclient/identity/v3/endpoint_group.py +1 -1
- openstackclient/identity/v3/group.py +3 -4
- openstackclient/identity/v3/identity_provider.py +1 -2
- openstackclient/identity/v3/limit.py +4 -9
- openstackclient/identity/v3/mapping.py +4 -3
- openstackclient/identity/v3/policy.py +5 -8
- openstackclient/identity/v3/project.py +6 -6
- openstackclient/identity/v3/region.py +2 -5
- openstackclient/identity/v3/registered_limit.py +4 -8
- openstackclient/identity/v3/role.py +15 -16
- openstackclient/identity/v3/service.py +8 -8
- openstackclient/identity/v3/service_provider.py +3 -6
- openstackclient/identity/v3/tag.py +2 -2
- openstackclient/identity/v3/token.py +1 -2
- openstackclient/identity/v3/trust.py +74 -25
- openstackclient/identity/v3/user.py +9 -6
- openstackclient/image/client.py +2 -5
- openstackclient/image/v1/image.py +11 -15
- openstackclient/image/v2/cache.py +2 -4
- openstackclient/image/v2/image.py +30 -37
- openstackclient/image/v2/metadef_namespaces.py +4 -3
- openstackclient/image/v2/metadef_resource_type_association.py +1 -2
- openstackclient/image/v2/metadef_resource_types.py +1 -2
- openstackclient/locale/tr_TR/LC_MESSAGES/openstackclient.po +9 -1370
- openstackclient/network/client.py +4 -10
- openstackclient/network/common.py +16 -12
- openstackclient/network/utils.py +3 -3
- openstackclient/network/v2/address_group.py +5 -9
- openstackclient/network/v2/address_scope.py +2 -3
- openstackclient/network/v2/default_security_group_rule.py +1 -2
- openstackclient/network/v2/floating_ip.py +14 -21
- openstackclient/network/v2/floating_ip_port_forwarding.py +7 -7
- openstackclient/network/v2/ip_availability.py +1 -2
- openstackclient/network/v2/l3_conntrack_helper.py +8 -12
- openstackclient/network/v2/local_ip.py +24 -26
- openstackclient/network/v2/local_ip_association.py +4 -5
- openstackclient/network/v2/ndp_proxy.py +9 -10
- openstackclient/network/v2/network.py +12 -16
- openstackclient/network/v2/network_agent.py +29 -37
- openstackclient/network/v2/network_auto_allocated_topology.py +4 -5
- openstackclient/network/v2/network_flavor.py +1 -1
- openstackclient/network/v2/network_flavor_profile.py +5 -5
- openstackclient/network/v2/network_meter.py +3 -3
- openstackclient/network/v2/network_meter_rule.py +5 -8
- openstackclient/network/v2/network_qos_policy.py +4 -4
- openstackclient/network/v2/network_qos_rule.py +4 -5
- openstackclient/network/v2/network_rbac.py +4 -4
- openstackclient/network/v2/network_segment.py +6 -7
- openstackclient/network/v2/network_segment_range.py +16 -20
- openstackclient/network/v2/network_trunk.py +24 -16
- openstackclient/network/v2/port.py +28 -29
- openstackclient/network/v2/router.py +52 -41
- openstackclient/network/v2/security_group.py +8 -15
- openstackclient/network/v2/security_group_rule.py +9 -10
- openstackclient/network/v2/subnet.py +31 -30
- openstackclient/network/v2/subnet_pool.py +4 -4
- openstackclient/object/client.py +2 -3
- openstackclient/object/v1/container.py +2 -3
- openstackclient/object/v1/object.py +2 -9
- openstackclient/shell.py +22 -5
- openstackclient/tests/functional/base.py +2 -2
- openstackclient/tests/functional/common/test_quota.py +3 -1
- openstackclient/tests/functional/compute/v2/common.py +12 -6
- openstackclient/tests/functional/compute/v2/test_server.py +2 -3
- openstackclient/tests/functional/compute/v2/test_server_event.py +1 -1
- openstackclient/tests/functional/identity/v2/test_user.py +1 -1
- openstackclient/tests/functional/identity/v3/common.py +3 -8
- openstackclient/tests/functional/identity/v3/test_application_credential.py +10 -10
- openstackclient/tests/functional/identity/v3/test_endpoint.py +3 -3
- openstackclient/tests/functional/identity/v3/test_group.py +3 -3
- openstackclient/tests/functional/identity/v3/test_idp.py +3 -7
- openstackclient/tests/functional/identity/v3/test_limit.py +4 -4
- openstackclient/tests/functional/identity/v3/test_project.py +5 -14
- openstackclient/tests/functional/identity/v3/test_region.py +1 -3
- openstackclient/tests/functional/identity/v3/test_registered_limit.py +3 -3
- openstackclient/tests/functional/identity/v3/test_role.py +1 -1
- openstackclient/tests/functional/identity/v3/test_role_assignment.py +13 -31
- openstackclient/tests/functional/identity/v3/test_service_provider.py +3 -7
- openstackclient/tests/functional/identity/v3/test_user.py +8 -8
- openstackclient/tests/functional/network/v2/common.py +7 -3
- openstackclient/tests/functional/network/v2/test_address_group.py +4 -0
- openstackclient/tests/functional/network/v2/test_l3_conntrack_helper.py +15 -11
- openstackclient/tests/functional/network/v2/test_local_ip.py +4 -0
- openstackclient/tests/functional/network/v2/test_network_meter_rule.py +2 -2
- openstackclient/tests/functional/network/v2/test_network_ndp_proxy.py +2 -3
- openstackclient/tests/functional/network/v2/test_network_rbac.py +2 -2
- openstackclient/tests/functional/network/v2/test_network_trunk.py +1 -1
- openstackclient/tests/functional/network/v2/test_port.py +17 -7
- openstackclient/tests/functional/network/v2/test_router.py +42 -0
- openstackclient/tests/functional/network/v2/test_subnet_pool.py +4 -0
- openstackclient/tests/unit/api/test_compute_v2.py +67 -87
- openstackclient/tests/unit/common/test_availability_zone.py +6 -14
- openstackclient/tests/unit/common/test_command.py +1 -1
- openstackclient/tests/unit/common/test_extension.py +5 -7
- openstackclient/tests/unit/common/test_limits.py +1 -1
- openstackclient/tests/unit/common/test_project_cleanup.py +5 -6
- openstackclient/tests/unit/common/test_quota.py +51 -28
- openstackclient/tests/unit/compute/v2/fakes.py +4 -10
- openstackclient/tests/unit/compute/v2/test_agent.py +16 -16
- openstackclient/tests/unit/compute/v2/test_aggregate.py +56 -60
- openstackclient/tests/unit/compute/v2/test_console.py +16 -16
- openstackclient/tests/unit/compute/v2/test_flavor.py +71 -71
- openstackclient/tests/unit/compute/v2/test_host.py +8 -8
- openstackclient/tests/unit/compute/v2/test_hypervisor.py +22 -30
- openstackclient/tests/unit/compute/v2/test_hypervisor_stats.py +2 -2
- openstackclient/tests/unit/compute/v2/test_keypair.py +24 -24
- openstackclient/tests/unit/compute/v2/test_server.py +524 -560
- openstackclient/tests/unit/compute/v2/test_server_backup.py +5 -7
- openstackclient/tests/unit/compute/v2/test_server_event.py +16 -18
- openstackclient/tests/unit/compute/v2/test_server_group.py +25 -31
- openstackclient/tests/unit/compute/v2/test_server_image.py +6 -8
- openstackclient/tests/unit/compute/v2/test_server_migration.py +37 -37
- openstackclient/tests/unit/compute/v2/test_server_volume.py +12 -12
- openstackclient/tests/unit/compute/v2/test_service.py +39 -45
- openstackclient/tests/unit/compute/v2/test_usage.py +5 -5
- openstackclient/tests/unit/identity/v2_0/fakes.py +1 -1
- openstackclient/tests/unit/identity/v3/test_access_rule.py +1 -3
- openstackclient/tests/unit/identity/v3/test_application_credential.py +1 -1
- openstackclient/tests/unit/identity/v3/test_endpoint.py +167 -172
- openstackclient/tests/unit/identity/v3/test_mappings.py +2 -2
- openstackclient/tests/unit/identity/v3/test_trust.py +5 -2
- openstackclient/tests/unit/identity/v3/test_user.py +16 -0
- openstackclient/tests/unit/image/v1/fakes.py +2 -2
- openstackclient/tests/unit/image/v2/test_image.py +39 -1
- openstackclient/tests/unit/integ/cli/test_shell.py +1 -2
- openstackclient/tests/unit/network/test_common.py +2 -2
- openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +8 -14
- openstackclient/tests/unit/network/v2/test_floating_ip_network.py +49 -35
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +1 -1
- openstackclient/tests/unit/network/v2/test_network_compute.py +11 -11
- openstackclient/tests/unit/network/v2/test_network_trunk.py +2 -2
- openstackclient/tests/unit/network/v2/test_port.py +4 -5
- openstackclient/tests/unit/network/v2/test_router.py +63 -0
- openstackclient/tests/unit/network/v2/test_security_group_compute.py +11 -19
- openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +14 -14
- openstackclient/tests/unit/object/v1/test_object_all.py +4 -3
- openstackclient/tests/unit/test_shell.py +16 -13
- openstackclient/tests/unit/volume/v2/test_volume.py +1 -1
- openstackclient/tests/unit/volume/v2/test_volume_transfer_request.py +1 -1
- openstackclient/tests/unit/volume/v3/fakes.py +2 -8
- openstackclient/tests/unit/volume/v3/test_volume.py +1 -1
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +3 -3
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +1 -2
- openstackclient/tests/unit/volume/v3/test_volume_transfer_request.py +1 -1
- openstackclient/volume/client.py +1 -3
- openstackclient/volume/v2/consistency_group.py +4 -8
- openstackclient/volume/v2/consistency_group_snapshot.py +1 -2
- openstackclient/volume/v2/qos_specs.py +1 -2
- openstackclient/volume/v2/volume.py +8 -16
- openstackclient/volume/v2/volume_backup.py +6 -7
- openstackclient/volume/v2/volume_snapshot.py +8 -9
- openstackclient/volume/v2/volume_transfer_request.py +0 -3
- openstackclient/volume/v2/volume_type.py +10 -21
- openstackclient/volume/v3/block_storage_cluster.py +3 -3
- openstackclient/volume/v3/block_storage_manage.py +1 -3
- openstackclient/volume/v3/volume.py +18 -19
- openstackclient/volume/v3/volume_attachment.py +3 -2
- openstackclient/volume/v3/volume_backup.py +7 -8
- openstackclient/volume/v3/volume_group.py +2 -1
- openstackclient/volume/v3/volume_group_snapshot.py +2 -1
- openstackclient/volume/v3/volume_snapshot.py +4 -3
- openstackclient/volume/v3/volume_type.py +10 -21
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.0.0.dist-info}/AUTHORS +3 -0
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.0.0.dist-info}/METADATA +7 -13
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.0.0.dist-info}/RECORD +209 -232
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.0.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.0.0.dist-info}/entry_points.txt +0 -41
- python_openstackclient-8.0.0.dist-info/pbr.json +1 -0
- openstackclient/tests/functional/volume/v1/__init__.py +0 -0
- openstackclient/tests/functional/volume/v1/common.py +0 -35
- openstackclient/tests/functional/volume/v1/test_qos.py +0 -100
- openstackclient/tests/functional/volume/v1/test_service.py +0 -76
- openstackclient/tests/functional/volume/v1/test_snapshot.py +0 -232
- openstackclient/tests/functional/volume/v1/test_transfer_request.py +0 -111
- openstackclient/tests/functional/volume/v1/test_volume.py +0 -228
- openstackclient/tests/functional/volume/v1/test_volume_type.py +0 -213
- openstackclient/tests/unit/volume/v1/__init__.py +0 -0
- openstackclient/tests/unit/volume/v1/fakes.py +0 -615
- openstackclient/tests/unit/volume/v1/test_qos_specs.py +0 -471
- openstackclient/tests/unit/volume/v1/test_service.py +0 -295
- openstackclient/tests/unit/volume/v1/test_transfer_request.py +0 -380
- openstackclient/tests/unit/volume/v1/test_type.py +0 -633
- openstackclient/tests/unit/volume/v1/test_volume.py +0 -1447
- openstackclient/tests/unit/volume/v1/test_volume_backup.py +0 -435
- openstackclient/volume/v1/__init__.py +0 -0
- openstackclient/volume/v1/qos_specs.py +0 -377
- openstackclient/volume/v1/service.py +0 -136
- openstackclient/volume/v1/volume.py +0 -734
- openstackclient/volume/v1/volume_backup.py +0 -302
- openstackclient/volume/v1/volume_snapshot.py +0 -433
- openstackclient/volume/v1/volume_transfer_request.py +0 -200
- openstackclient/volume/v1/volume_type.py +0 -520
- python_openstackclient-7.4.0.dist-info/pbr.json +0 -1
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.0.0.dist-info}/LICENSE +0 -0
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.0.0.dist-info}/top_level.txt +0 -0
|
@@ -86,7 +86,7 @@ class TestFlavorCreate(TestFlavor):
|
|
|
86
86
|
|
|
87
87
|
# Return a project
|
|
88
88
|
self.projects_mock.get.return_value = self.project
|
|
89
|
-
self.
|
|
89
|
+
self.compute_client.create_flavor.return_value = self.flavor
|
|
90
90
|
self.cmd = flavor.CreateFlavor(self.app, None)
|
|
91
91
|
|
|
92
92
|
def test_flavor_create_default_options(self):
|
|
@@ -109,7 +109,7 @@ class TestFlavorCreate(TestFlavor):
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
columns, data = self.cmd.take_action(parsed_args)
|
|
112
|
-
self.
|
|
112
|
+
self.compute_client.create_flavor.assert_called_once_with(
|
|
113
113
|
**default_args
|
|
114
114
|
)
|
|
115
115
|
|
|
@@ -180,17 +180,17 @@ class TestFlavorCreate(TestFlavor):
|
|
|
180
180
|
# convert expected data tuple to list to be able to modify it
|
|
181
181
|
cmp_data = list(self.data)
|
|
182
182
|
cmp_data[7] = format_columns.DictColumn(props)
|
|
183
|
-
self.
|
|
184
|
-
self.
|
|
183
|
+
self.compute_client.create_flavor.return_value = create_flavor
|
|
184
|
+
self.compute_client.create_flavor_extra_specs.return_value = (
|
|
185
185
|
expected_flavor
|
|
186
186
|
)
|
|
187
187
|
|
|
188
188
|
columns, data = self.cmd.take_action(parsed_args)
|
|
189
|
-
self.
|
|
190
|
-
self.
|
|
189
|
+
self.compute_client.create_flavor.assert_called_once_with(**args)
|
|
190
|
+
self.compute_client.create_flavor_extra_specs.assert_called_once_with(
|
|
191
191
|
create_flavor, props
|
|
192
192
|
)
|
|
193
|
-
self.
|
|
193
|
+
self.compute_client.get_flavor_access.assert_not_called()
|
|
194
194
|
|
|
195
195
|
self.assertEqual(self.columns, columns)
|
|
196
196
|
self.assertCountEqual(tuple(cmp_data), data)
|
|
@@ -265,19 +265,19 @@ class TestFlavorCreate(TestFlavor):
|
|
|
265
265
|
# convert expected data tuple to list to be able to modify it
|
|
266
266
|
cmp_data = list(self.data_private)
|
|
267
267
|
cmp_data[7] = format_columns.DictColumn(props)
|
|
268
|
-
self.
|
|
269
|
-
self.
|
|
268
|
+
self.compute_client.create_flavor.return_value = create_flavor
|
|
269
|
+
self.compute_client.create_flavor_extra_specs.return_value = (
|
|
270
270
|
expected_flavor
|
|
271
271
|
)
|
|
272
272
|
|
|
273
273
|
columns, data = self.cmd.take_action(parsed_args)
|
|
274
274
|
|
|
275
|
-
self.
|
|
276
|
-
self.
|
|
275
|
+
self.compute_client.create_flavor.assert_called_once_with(**args)
|
|
276
|
+
self.compute_client.flavor_add_tenant_access.assert_called_with(
|
|
277
277
|
self.flavor.id,
|
|
278
278
|
self.project.id,
|
|
279
279
|
)
|
|
280
|
-
self.
|
|
280
|
+
self.compute_client.create_flavor_extra_specs.assert_called_with(
|
|
281
281
|
create_flavor, props
|
|
282
282
|
)
|
|
283
283
|
self.assertEqual(self.columns, columns)
|
|
@@ -362,7 +362,7 @@ class TestFlavorCreate(TestFlavor):
|
|
|
362
362
|
'description': 'fake description',
|
|
363
363
|
}
|
|
364
364
|
|
|
365
|
-
self.
|
|
365
|
+
self.compute_client.create_flavor.assert_called_once_with(**args)
|
|
366
366
|
|
|
367
367
|
self.assertEqual(self.columns, columns)
|
|
368
368
|
self.assertCountEqual(self.data_private, data)
|
|
@@ -400,7 +400,7 @@ class TestFlavorDelete(TestFlavor):
|
|
|
400
400
|
def setUp(self):
|
|
401
401
|
super().setUp()
|
|
402
402
|
|
|
403
|
-
self.
|
|
403
|
+
self.compute_client.delete_flavor.return_value = None
|
|
404
404
|
|
|
405
405
|
self.cmd = flavor.DeleteFlavor(self.app, None)
|
|
406
406
|
|
|
@@ -411,14 +411,14 @@ class TestFlavorDelete(TestFlavor):
|
|
|
411
411
|
]
|
|
412
412
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
413
413
|
|
|
414
|
-
self.
|
|
414
|
+
self.compute_client.find_flavor.return_value = self.flavors[0]
|
|
415
415
|
|
|
416
416
|
result = self.cmd.take_action(parsed_args)
|
|
417
417
|
|
|
418
|
-
self.
|
|
418
|
+
self.compute_client.find_flavor.assert_called_with(
|
|
419
419
|
self.flavors[0].id, ignore_missing=False
|
|
420
420
|
)
|
|
421
|
-
self.
|
|
421
|
+
self.compute_client.delete_flavor.assert_called_with(
|
|
422
422
|
self.flavors[0].id
|
|
423
423
|
)
|
|
424
424
|
self.assertIsNone(result)
|
|
@@ -433,7 +433,7 @@ class TestFlavorDelete(TestFlavor):
|
|
|
433
433
|
|
|
434
434
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
435
435
|
|
|
436
|
-
self.
|
|
436
|
+
self.compute_client.find_flavor.side_effect = self.flavors
|
|
437
437
|
|
|
438
438
|
result = self.cmd.take_action(parsed_args)
|
|
439
439
|
|
|
@@ -441,8 +441,8 @@ class TestFlavorDelete(TestFlavor):
|
|
|
441
441
|
mock.call(i.id, ignore_missing=False) for i in self.flavors
|
|
442
442
|
]
|
|
443
443
|
delete_calls = [mock.call(i.id) for i in self.flavors]
|
|
444
|
-
self.
|
|
445
|
-
self.
|
|
444
|
+
self.compute_client.find_flavor.assert_has_calls(find_calls)
|
|
445
|
+
self.compute_client.delete_flavor.assert_has_calls(delete_calls)
|
|
446
446
|
self.assertIsNone(result)
|
|
447
447
|
|
|
448
448
|
def test_multi_flavors_delete_with_exception(self):
|
|
@@ -453,7 +453,7 @@ class TestFlavorDelete(TestFlavor):
|
|
|
453
453
|
verifylist = [('flavor', [self.flavors[0].id, 'unexist_flavor'])]
|
|
454
454
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
455
455
|
|
|
456
|
-
self.
|
|
456
|
+
self.compute_client.find_flavor.side_effect = [
|
|
457
457
|
self.flavors[0],
|
|
458
458
|
sdk_exceptions.ResourceNotFound,
|
|
459
459
|
]
|
|
@@ -469,8 +469,8 @@ class TestFlavorDelete(TestFlavor):
|
|
|
469
469
|
mock.call('unexist_flavor', ignore_missing=False),
|
|
470
470
|
]
|
|
471
471
|
delete_calls = [mock.call(self.flavors[0].id)]
|
|
472
|
-
self.
|
|
473
|
-
self.
|
|
472
|
+
self.compute_client.find_flavor.assert_has_calls(find_calls)
|
|
473
|
+
self.compute_client.delete_flavor.assert_has_calls(delete_calls)
|
|
474
474
|
|
|
475
475
|
|
|
476
476
|
class TestFlavorList(TestFlavor):
|
|
@@ -516,7 +516,7 @@ class TestFlavorList(TestFlavor):
|
|
|
516
516
|
[],
|
|
517
517
|
]
|
|
518
518
|
|
|
519
|
-
self.
|
|
519
|
+
self.compute_client.flavors = self.api_mock
|
|
520
520
|
|
|
521
521
|
# Get the command object to test
|
|
522
522
|
self.cmd = flavor.ListFlavor(self.app, None)
|
|
@@ -541,8 +541,8 @@ class TestFlavorList(TestFlavor):
|
|
|
541
541
|
'is_public': True,
|
|
542
542
|
}
|
|
543
543
|
|
|
544
|
-
self.
|
|
545
|
-
self.
|
|
544
|
+
self.compute_client.flavors.assert_called_with(**kwargs)
|
|
545
|
+
self.compute_client.fetch_flavor_extra_specs.assert_not_called()
|
|
546
546
|
|
|
547
547
|
self.assertEqual(self.columns, columns)
|
|
548
548
|
self.assertEqual(self.data, tuple(data))
|
|
@@ -567,8 +567,8 @@ class TestFlavorList(TestFlavor):
|
|
|
567
567
|
'is_public': None,
|
|
568
568
|
}
|
|
569
569
|
|
|
570
|
-
self.
|
|
571
|
-
self.
|
|
570
|
+
self.compute_client.flavors.assert_called_with(**kwargs)
|
|
571
|
+
self.compute_client.fetch_flavor_extra_specs.assert_not_called()
|
|
572
572
|
|
|
573
573
|
self.assertEqual(self.columns, columns)
|
|
574
574
|
self.assertEqual(self.data, tuple(data))
|
|
@@ -593,8 +593,8 @@ class TestFlavorList(TestFlavor):
|
|
|
593
593
|
'is_public': False,
|
|
594
594
|
}
|
|
595
595
|
|
|
596
|
-
self.
|
|
597
|
-
self.
|
|
596
|
+
self.compute_client.flavors.assert_called_with(**kwargs)
|
|
597
|
+
self.compute_client.fetch_flavor_extra_specs.assert_not_called()
|
|
598
598
|
|
|
599
599
|
self.assertEqual(self.columns, columns)
|
|
600
600
|
self.assertEqual(self.data, tuple(data))
|
|
@@ -619,8 +619,8 @@ class TestFlavorList(TestFlavor):
|
|
|
619
619
|
'is_public': True,
|
|
620
620
|
}
|
|
621
621
|
|
|
622
|
-
self.
|
|
623
|
-
self.
|
|
622
|
+
self.compute_client.flavors.assert_called_with(**kwargs)
|
|
623
|
+
self.compute_client.fetch_flavor_extra_specs.assert_not_called()
|
|
624
624
|
|
|
625
625
|
self.assertEqual(self.columns, columns)
|
|
626
626
|
self.assertEqual(self.data, tuple(data))
|
|
@@ -645,8 +645,8 @@ class TestFlavorList(TestFlavor):
|
|
|
645
645
|
'is_public': True,
|
|
646
646
|
}
|
|
647
647
|
|
|
648
|
-
self.
|
|
649
|
-
self.
|
|
648
|
+
self.compute_client.flavors.assert_called_with(**kwargs)
|
|
649
|
+
self.compute_client.fetch_flavor_extra_specs.assert_not_called()
|
|
650
650
|
|
|
651
651
|
self.assertEqual(self.columns_long, columns)
|
|
652
652
|
self.assertCountEqual(self.data_long, tuple(data))
|
|
@@ -678,8 +678,8 @@ class TestFlavorList(TestFlavor):
|
|
|
678
678
|
[],
|
|
679
679
|
]
|
|
680
680
|
|
|
681
|
-
self.
|
|
682
|
-
self.
|
|
681
|
+
self.compute_client.flavors = self.api_mock
|
|
682
|
+
self.compute_client.fetch_flavor_extra_specs = mock.Mock(
|
|
683
683
|
return_value=None
|
|
684
684
|
)
|
|
685
685
|
|
|
@@ -702,8 +702,8 @@ class TestFlavorList(TestFlavor):
|
|
|
702
702
|
'is_public': True,
|
|
703
703
|
}
|
|
704
704
|
|
|
705
|
-
self.
|
|
706
|
-
self.
|
|
705
|
+
self.compute_client.flavors.assert_called_with(**kwargs)
|
|
706
|
+
self.compute_client.fetch_flavor_extra_specs.assert_called_once_with(
|
|
707
707
|
flavor
|
|
708
708
|
)
|
|
709
709
|
|
|
@@ -736,15 +736,15 @@ class TestFlavorList(TestFlavor):
|
|
|
736
736
|
'min_ram': 2048,
|
|
737
737
|
}
|
|
738
738
|
|
|
739
|
-
self.
|
|
740
|
-
self.
|
|
739
|
+
self.compute_client.flavors.assert_called_with(**kwargs)
|
|
740
|
+
self.compute_client.fetch_flavor_extra_specs.assert_not_called()
|
|
741
741
|
|
|
742
742
|
self.assertEqual(self.columns, columns)
|
|
743
743
|
self.assertEqual(tuple(self.data), tuple(data))
|
|
744
744
|
|
|
745
745
|
|
|
746
746
|
class TestFlavorSet(TestFlavor):
|
|
747
|
-
# Return value of self.
|
|
747
|
+
# Return value of self.compute_client.find_flavor().
|
|
748
748
|
flavor = compute_fakes.create_one_flavor(
|
|
749
749
|
attrs={'os-flavor-access:is_public': False}
|
|
750
750
|
)
|
|
@@ -753,7 +753,7 @@ class TestFlavorSet(TestFlavor):
|
|
|
753
753
|
def setUp(self):
|
|
754
754
|
super().setUp()
|
|
755
755
|
|
|
756
|
-
self.
|
|
756
|
+
self.compute_client.find_flavor.return_value = self.flavor
|
|
757
757
|
# Return a project
|
|
758
758
|
self.projects_mock.get.return_value = self.project
|
|
759
759
|
self.cmd = flavor.SetFlavor(self.app, None)
|
|
@@ -767,10 +767,10 @@ class TestFlavorSet(TestFlavor):
|
|
|
767
767
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
768
768
|
|
|
769
769
|
result = self.cmd.take_action(parsed_args)
|
|
770
|
-
self.
|
|
770
|
+
self.compute_client.find_flavor.assert_called_with(
|
|
771
771
|
parsed_args.flavor, get_extra_specs=True, ignore_missing=False
|
|
772
772
|
)
|
|
773
|
-
self.
|
|
773
|
+
self.compute_client.create_flavor_extra_specs.assert_called_with(
|
|
774
774
|
self.flavor.id, {'FOO': '"B A R"'}
|
|
775
775
|
)
|
|
776
776
|
self.assertIsNone(result)
|
|
@@ -781,10 +781,10 @@ class TestFlavorSet(TestFlavor):
|
|
|
781
781
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
782
782
|
|
|
783
783
|
result = self.cmd.take_action(parsed_args)
|
|
784
|
-
self.
|
|
784
|
+
self.compute_client.find_flavor.assert_called_with(
|
|
785
785
|
parsed_args.flavor, get_extra_specs=True, ignore_missing=False
|
|
786
786
|
)
|
|
787
|
-
self.
|
|
787
|
+
self.compute_client.delete_flavor_extra_specs_property.assert_called_with(
|
|
788
788
|
self.flavor.id, 'property'
|
|
789
789
|
)
|
|
790
790
|
self.assertIsNone(result)
|
|
@@ -803,14 +803,14 @@ class TestFlavorSet(TestFlavor):
|
|
|
803
803
|
|
|
804
804
|
result = self.cmd.take_action(parsed_args)
|
|
805
805
|
|
|
806
|
-
self.
|
|
806
|
+
self.compute_client.find_flavor.assert_called_with(
|
|
807
807
|
parsed_args.flavor, get_extra_specs=True, ignore_missing=False
|
|
808
808
|
)
|
|
809
|
-
self.
|
|
809
|
+
self.compute_client.flavor_add_tenant_access.assert_called_with(
|
|
810
810
|
self.flavor.id,
|
|
811
811
|
self.project.id,
|
|
812
812
|
)
|
|
813
|
-
self.
|
|
813
|
+
self.compute_client.create_flavor_extra_specs.assert_not_called()
|
|
814
814
|
self.assertIsNone(result)
|
|
815
815
|
|
|
816
816
|
def test_flavor_set_no_project(self):
|
|
@@ -847,7 +847,7 @@ class TestFlavorSet(TestFlavor):
|
|
|
847
847
|
)
|
|
848
848
|
|
|
849
849
|
def test_flavor_set_with_unexist_flavor(self):
|
|
850
|
-
self.
|
|
850
|
+
self.compute_client.find_flavor.side_effect = [
|
|
851
851
|
sdk_exceptions.ResourceNotFound()
|
|
852
852
|
]
|
|
853
853
|
|
|
@@ -876,10 +876,10 @@ class TestFlavorSet(TestFlavor):
|
|
|
876
876
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
877
877
|
result = self.cmd.take_action(parsed_args)
|
|
878
878
|
|
|
879
|
-
self.
|
|
879
|
+
self.compute_client.find_flavor.assert_called_with(
|
|
880
880
|
parsed_args.flavor, get_extra_specs=True, ignore_missing=False
|
|
881
881
|
)
|
|
882
|
-
self.
|
|
882
|
+
self.compute_client.flavor_add_tenant_access.assert_not_called()
|
|
883
883
|
self.assertIsNone(result)
|
|
884
884
|
|
|
885
885
|
def test_flavor_set_description(self):
|
|
@@ -897,7 +897,7 @@ class TestFlavorSet(TestFlavor):
|
|
|
897
897
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
898
898
|
|
|
899
899
|
result = self.cmd.take_action(parsed_args)
|
|
900
|
-
self.
|
|
900
|
+
self.compute_client.update_flavor.assert_called_with(
|
|
901
901
|
flavor=self.flavor.id, description='description'
|
|
902
902
|
)
|
|
903
903
|
self.assertIsNone(result)
|
|
@@ -935,7 +935,7 @@ class TestFlavorSet(TestFlavor):
|
|
|
935
935
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
936
936
|
|
|
937
937
|
result = self.cmd.take_action(parsed_args)
|
|
938
|
-
self.
|
|
938
|
+
self.compute_client.update_flavor.assert_called_with(
|
|
939
939
|
flavor=self.flavor.id, description='description'
|
|
940
940
|
)
|
|
941
941
|
self.assertIsNone(result)
|
|
@@ -960,7 +960,7 @@ class TestFlavorSet(TestFlavor):
|
|
|
960
960
|
|
|
961
961
|
|
|
962
962
|
class TestFlavorShow(TestFlavor):
|
|
963
|
-
# Return value of self.
|
|
963
|
+
# Return value of self.compute_client.find_flavor().
|
|
964
964
|
flavor_access = compute_fakes.create_one_flavor_access()
|
|
965
965
|
flavor = compute_fakes.create_one_flavor()
|
|
966
966
|
|
|
@@ -1000,8 +1000,8 @@ class TestFlavorShow(TestFlavor):
|
|
|
1000
1000
|
super().setUp()
|
|
1001
1001
|
|
|
1002
1002
|
# Return value of _find_resource()
|
|
1003
|
-
self.
|
|
1004
|
-
self.
|
|
1003
|
+
self.compute_client.find_flavor.return_value = self.flavor
|
|
1004
|
+
self.compute_client.get_flavor_access.return_value = [
|
|
1005
1005
|
self.flavor_access
|
|
1006
1006
|
]
|
|
1007
1007
|
self.cmd = flavor.ShowFlavor(self.app, None)
|
|
@@ -1040,7 +1040,7 @@ class TestFlavorShow(TestFlavor):
|
|
|
1040
1040
|
'os-flavor-access:is_public': False,
|
|
1041
1041
|
}
|
|
1042
1042
|
)
|
|
1043
|
-
self.
|
|
1043
|
+
self.compute_client.find_flavor.return_value = private_flavor
|
|
1044
1044
|
|
|
1045
1045
|
arglist = [
|
|
1046
1046
|
private_flavor.name,
|
|
@@ -1069,7 +1069,7 @@ class TestFlavorShow(TestFlavor):
|
|
|
1069
1069
|
|
|
1070
1070
|
columns, data = self.cmd.take_action(parsed_args)
|
|
1071
1071
|
|
|
1072
|
-
self.
|
|
1072
|
+
self.compute_client.get_flavor_access.assert_called_with(
|
|
1073
1073
|
flavor=private_flavor.id
|
|
1074
1074
|
)
|
|
1075
1075
|
self.assertEqual(self.columns, columns)
|
|
@@ -1077,7 +1077,7 @@ class TestFlavorShow(TestFlavor):
|
|
|
1077
1077
|
|
|
1078
1078
|
|
|
1079
1079
|
class TestFlavorUnset(TestFlavor):
|
|
1080
|
-
# Return value of self.
|
|
1080
|
+
# Return value of self.compute_client.find_flavor().
|
|
1081
1081
|
flavor = compute_fakes.create_one_flavor(
|
|
1082
1082
|
attrs={'os-flavor-access:is_public': False}
|
|
1083
1083
|
)
|
|
@@ -1086,13 +1086,13 @@ class TestFlavorUnset(TestFlavor):
|
|
|
1086
1086
|
def setUp(self):
|
|
1087
1087
|
super().setUp()
|
|
1088
1088
|
|
|
1089
|
-
self.
|
|
1089
|
+
self.compute_client.find_flavor.return_value = self.flavor
|
|
1090
1090
|
# Return a project
|
|
1091
1091
|
self.projects_mock.get.return_value = self.project
|
|
1092
1092
|
self.cmd = flavor.UnsetFlavor(self.app, None)
|
|
1093
1093
|
|
|
1094
1094
|
self.mock_shortcut = (
|
|
1095
|
-
self.
|
|
1095
|
+
self.compute_client.delete_flavor_extra_specs_property
|
|
1096
1096
|
)
|
|
1097
1097
|
|
|
1098
1098
|
def test_flavor_unset_property(self):
|
|
@@ -1104,11 +1104,11 @@ class TestFlavorUnset(TestFlavor):
|
|
|
1104
1104
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
1105
1105
|
|
|
1106
1106
|
result = self.cmd.take_action(parsed_args)
|
|
1107
|
-
self.
|
|
1107
|
+
self.compute_client.find_flavor.assert_called_with(
|
|
1108
1108
|
parsed_args.flavor, get_extra_specs=True, ignore_missing=False
|
|
1109
1109
|
)
|
|
1110
1110
|
self.mock_shortcut.assert_called_with(self.flavor.id, 'property')
|
|
1111
|
-
self.
|
|
1111
|
+
self.compute_client.flavor_remove_tenant_access.assert_not_called()
|
|
1112
1112
|
self.assertIsNone(result)
|
|
1113
1113
|
|
|
1114
1114
|
def test_flavor_unset_properties(self):
|
|
@@ -1126,7 +1126,7 @@ class TestFlavorUnset(TestFlavor):
|
|
|
1126
1126
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
1127
1127
|
|
|
1128
1128
|
self.cmd.take_action(parsed_args)
|
|
1129
|
-
self.
|
|
1129
|
+
self.compute_client.find_flavor.assert_called_with(
|
|
1130
1130
|
parsed_args.flavor, get_extra_specs=True, ignore_missing=False
|
|
1131
1131
|
)
|
|
1132
1132
|
calls = [
|
|
@@ -1141,7 +1141,7 @@ class TestFlavorUnset(TestFlavor):
|
|
|
1141
1141
|
AssertionError, self.mock_shortcut.assert_has_calls, calls
|
|
1142
1142
|
)
|
|
1143
1143
|
|
|
1144
|
-
self.
|
|
1144
|
+
self.compute_client.flavor_remove_tenant_access.assert_not_called()
|
|
1145
1145
|
|
|
1146
1146
|
def test_flavor_unset_project(self):
|
|
1147
1147
|
arglist = [
|
|
@@ -1158,14 +1158,14 @@ class TestFlavorUnset(TestFlavor):
|
|
|
1158
1158
|
result = self.cmd.take_action(parsed_args)
|
|
1159
1159
|
self.assertIsNone(result)
|
|
1160
1160
|
|
|
1161
|
-
self.
|
|
1161
|
+
self.compute_client.find_flavor.assert_called_with(
|
|
1162
1162
|
parsed_args.flavor, get_extra_specs=True, ignore_missing=False
|
|
1163
1163
|
)
|
|
1164
|
-
self.
|
|
1164
|
+
self.compute_client.flavor_remove_tenant_access.assert_called_with(
|
|
1165
1165
|
self.flavor.id,
|
|
1166
1166
|
self.project.id,
|
|
1167
1167
|
)
|
|
1168
|
-
self.
|
|
1168
|
+
self.compute_client.delete_flavor_extra_specs_property.assert_not_called()
|
|
1169
1169
|
self.assertIsNone(result)
|
|
1170
1170
|
|
|
1171
1171
|
def test_flavor_unset_no_project(self):
|
|
@@ -1202,7 +1202,7 @@ class TestFlavorUnset(TestFlavor):
|
|
|
1202
1202
|
)
|
|
1203
1203
|
|
|
1204
1204
|
def test_flavor_unset_with_unexist_flavor(self):
|
|
1205
|
-
self.
|
|
1205
|
+
self.compute_client.find_flavor.side_effect = [
|
|
1206
1206
|
sdk_exceptions.ResourceNotFound
|
|
1207
1207
|
]
|
|
1208
1208
|
|
|
@@ -1232,4 +1232,4 @@ class TestFlavorUnset(TestFlavor):
|
|
|
1232
1232
|
result = self.cmd.take_action(parsed_args)
|
|
1233
1233
|
self.assertIsNone(result)
|
|
1234
1234
|
|
|
1235
|
-
self.
|
|
1235
|
+
self.compute_client.flavor_remove_tenant_access.assert_not_called()
|
|
@@ -72,7 +72,7 @@ class TestHostList(compute_fakes.TestComputev2):
|
|
|
72
72
|
)
|
|
73
73
|
]
|
|
74
74
|
|
|
75
|
-
self.
|
|
75
|
+
self.compute_client.get.return_value = fakes.FakeResponse(
|
|
76
76
|
data={'hosts': [self._host]}
|
|
77
77
|
)
|
|
78
78
|
self.cmd = host.ListHost(self.app, None)
|
|
@@ -85,7 +85,7 @@ class TestHostList(compute_fakes.TestComputev2):
|
|
|
85
85
|
|
|
86
86
|
columns, data = self.cmd.take_action(parsed_args)
|
|
87
87
|
|
|
88
|
-
self.
|
|
88
|
+
self.compute_client.get.assert_called_with(
|
|
89
89
|
'/os-hosts', microversion='2.1'
|
|
90
90
|
)
|
|
91
91
|
self.assertEqual(self.columns, columns)
|
|
@@ -104,7 +104,7 @@ class TestHostList(compute_fakes.TestComputev2):
|
|
|
104
104
|
|
|
105
105
|
columns, data = self.cmd.take_action(parsed_args)
|
|
106
106
|
|
|
107
|
-
self.
|
|
107
|
+
self.compute_client.get.assert_called_with(
|
|
108
108
|
'/os-hosts', microversion='2.1'
|
|
109
109
|
)
|
|
110
110
|
self.assertEqual(self.columns, columns)
|
|
@@ -116,7 +116,7 @@ class TestHostSet(compute_fakes.TestComputev2):
|
|
|
116
116
|
super().setUp()
|
|
117
117
|
|
|
118
118
|
self._host = _generate_fake_host()
|
|
119
|
-
self.
|
|
119
|
+
self.compute_client.put.return_value = fakes.FakeResponse()
|
|
120
120
|
|
|
121
121
|
self.cmd = host.SetHost(self.app, None)
|
|
122
122
|
|
|
@@ -132,7 +132,7 @@ class TestHostSet(compute_fakes.TestComputev2):
|
|
|
132
132
|
|
|
133
133
|
result = self.cmd.take_action(parsed_args)
|
|
134
134
|
self.assertIsNone(result)
|
|
135
|
-
self.
|
|
135
|
+
self.compute_client.put.assert_not_called()
|
|
136
136
|
|
|
137
137
|
def test_host_set(self):
|
|
138
138
|
arglist = [
|
|
@@ -150,7 +150,7 @@ class TestHostSet(compute_fakes.TestComputev2):
|
|
|
150
150
|
|
|
151
151
|
result = self.cmd.take_action(parsed_args)
|
|
152
152
|
self.assertIsNone(result)
|
|
153
|
-
self.
|
|
153
|
+
self.compute_client.put.assert_called_with(
|
|
154
154
|
f'/os-hosts/{self._host["host"]}',
|
|
155
155
|
json={
|
|
156
156
|
'maintenance_mode': 'disable',
|
|
@@ -183,7 +183,7 @@ class TestHostShow(compute_fakes.TestComputev2):
|
|
|
183
183
|
)
|
|
184
184
|
]
|
|
185
185
|
|
|
186
|
-
self.
|
|
186
|
+
self.compute_client.get.return_value = fakes.FakeResponse(
|
|
187
187
|
data={
|
|
188
188
|
'host': [
|
|
189
189
|
{
|
|
@@ -226,7 +226,7 @@ class TestHostShow(compute_fakes.TestComputev2):
|
|
|
226
226
|
|
|
227
227
|
columns, data = self.cmd.take_action(parsed_args)
|
|
228
228
|
|
|
229
|
-
self.
|
|
229
|
+
self.compute_client.get.assert_called_with(
|
|
230
230
|
'/os-hosts/' + self._host['host_name'], microversion='2.1'
|
|
231
231
|
)
|
|
232
232
|
self.assertEqual(self.columns, columns)
|