python-openstackclient 7.3.1__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 +8 -9
- 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 +42 -31
- openstackclient/network/v2/router.py +55 -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_credential.py +4 -4
- 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 +33 -5
- openstackclient/tests/unit/network/v2/test_router.py +120 -7
- 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.3.1.dist-info → python_openstackclient-8.0.0.dist-info}/AUTHORS +4 -0
- {python_openstackclient-7.3.1.dist-info → python_openstackclient-8.0.0.dist-info}/METADATA +7 -13
- {python_openstackclient-7.3.1.dist-info → python_openstackclient-8.0.0.dist-info}/RECORD +210 -233
- {python_openstackclient-7.3.1.dist-info → python_openstackclient-8.0.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-7.3.1.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.3.1.dist-info/pbr.json +0 -1
- {python_openstackclient-7.3.1.dist-info → python_openstackclient-8.0.0.dist-info}/LICENSE +0 -0
- {python_openstackclient-7.3.1.dist-info → python_openstackclient-8.0.0.dist-info}/top_level.txt +0 -0
|
@@ -31,8 +31,8 @@ class TestServerVolumeList(compute_fakes.TestComputev2):
|
|
|
31
31
|
)
|
|
32
32
|
)
|
|
33
33
|
|
|
34
|
-
self.
|
|
35
|
-
self.
|
|
34
|
+
self.compute_client.find_server.return_value = self.server
|
|
35
|
+
self.compute_client.volume_attachments.return_value = (
|
|
36
36
|
self.volume_attachments
|
|
37
37
|
)
|
|
38
38
|
|
|
@@ -68,7 +68,7 @@ class TestServerVolumeList(compute_fakes.TestComputev2):
|
|
|
68
68
|
),
|
|
69
69
|
tuple(data),
|
|
70
70
|
)
|
|
71
|
-
self.
|
|
71
|
+
self.compute_client.volume_attachments.assert_called_once_with(
|
|
72
72
|
self.server,
|
|
73
73
|
)
|
|
74
74
|
|
|
@@ -114,7 +114,7 @@ class TestServerVolumeList(compute_fakes.TestComputev2):
|
|
|
114
114
|
),
|
|
115
115
|
tuple(data),
|
|
116
116
|
)
|
|
117
|
-
self.
|
|
117
|
+
self.compute_client.volume_attachments.assert_called_once_with(
|
|
118
118
|
self.server,
|
|
119
119
|
)
|
|
120
120
|
|
|
@@ -163,7 +163,7 @@ class TestServerVolumeList(compute_fakes.TestComputev2):
|
|
|
163
163
|
),
|
|
164
164
|
tuple(data),
|
|
165
165
|
)
|
|
166
|
-
self.
|
|
166
|
+
self.compute_client.volume_attachments.assert_called_once_with(
|
|
167
167
|
self.server,
|
|
168
168
|
)
|
|
169
169
|
|
|
@@ -215,7 +215,7 @@ class TestServerVolumeList(compute_fakes.TestComputev2):
|
|
|
215
215
|
),
|
|
216
216
|
tuple(data),
|
|
217
217
|
)
|
|
218
|
-
self.
|
|
218
|
+
self.compute_client.volume_attachments.assert_called_once_with(
|
|
219
219
|
self.server,
|
|
220
220
|
)
|
|
221
221
|
|
|
@@ -225,7 +225,7 @@ class TestServerVolumeUpdate(compute_fakes.TestComputev2):
|
|
|
225
225
|
super().setUp()
|
|
226
226
|
|
|
227
227
|
self.server = sdk_fakes.generate_fake_resource(_server.Server)
|
|
228
|
-
self.
|
|
228
|
+
self.compute_client.find_server.return_value = self.server
|
|
229
229
|
|
|
230
230
|
self.volume = sdk_fakes.generate_fake_resource(_volume.Volume)
|
|
231
231
|
self.volume_sdk_client.find_volume.return_value = self.volume
|
|
@@ -248,7 +248,7 @@ class TestServerVolumeUpdate(compute_fakes.TestComputev2):
|
|
|
248
248
|
result = self.cmd.take_action(parsed_args)
|
|
249
249
|
|
|
250
250
|
# This is a no-op
|
|
251
|
-
self.
|
|
251
|
+
self.compute_client.update_volume_attachment.assert_not_called()
|
|
252
252
|
self.assertIsNone(result)
|
|
253
253
|
|
|
254
254
|
def test_server_volume_update_with_delete_on_termination(self):
|
|
@@ -268,7 +268,7 @@ class TestServerVolumeUpdate(compute_fakes.TestComputev2):
|
|
|
268
268
|
|
|
269
269
|
result = self.cmd.take_action(parsed_args)
|
|
270
270
|
|
|
271
|
-
self.
|
|
271
|
+
self.compute_client.update_volume_attachment.assert_called_once_with(
|
|
272
272
|
self.server,
|
|
273
273
|
self.volume,
|
|
274
274
|
delete_on_termination=True,
|
|
@@ -292,7 +292,7 @@ class TestServerVolumeUpdate(compute_fakes.TestComputev2):
|
|
|
292
292
|
|
|
293
293
|
result = self.cmd.take_action(parsed_args)
|
|
294
294
|
|
|
295
|
-
self.
|
|
295
|
+
self.compute_client.update_volume_attachment.assert_called_once_with(
|
|
296
296
|
self.server, self.volume, delete_on_termination=False
|
|
297
297
|
)
|
|
298
298
|
self.assertIsNone(result)
|
|
@@ -317,7 +317,7 @@ class TestServerVolumeUpdate(compute_fakes.TestComputev2):
|
|
|
317
317
|
self.cmd.take_action,
|
|
318
318
|
parsed_args,
|
|
319
319
|
)
|
|
320
|
-
self.
|
|
320
|
+
self.compute_client.update_volume_attachment.assert_not_called()
|
|
321
321
|
|
|
322
322
|
def test_server_volume_update_with_preserve_on_termination_pre_v285(self):
|
|
323
323
|
self.set_compute_api_version('2.84')
|
|
@@ -339,4 +339,4 @@ class TestServerVolumeUpdate(compute_fakes.TestComputev2):
|
|
|
339
339
|
self.cmd.take_action,
|
|
340
340
|
parsed_args,
|
|
341
341
|
)
|
|
342
|
-
self.
|
|
342
|
+
self.compute_client.update_volume_attachment.assert_not_called()
|
|
@@ -30,7 +30,7 @@ class TestServiceDelete(compute_fakes.TestComputev2):
|
|
|
30
30
|
sdk_fakes.generate_fake_resources(_service.Service, count=2)
|
|
31
31
|
)
|
|
32
32
|
|
|
33
|
-
self.
|
|
33
|
+
self.compute_client.delete_service.return_value = None
|
|
34
34
|
|
|
35
35
|
# Get the command object to test
|
|
36
36
|
self.cmd = service.DeleteService(self.app, None)
|
|
@@ -46,7 +46,7 @@ class TestServiceDelete(compute_fakes.TestComputev2):
|
|
|
46
46
|
|
|
47
47
|
result = self.cmd.take_action(parsed_args)
|
|
48
48
|
|
|
49
|
-
self.
|
|
49
|
+
self.compute_client.delete_service.assert_called_with(
|
|
50
50
|
self.services[0].binary, ignore_missing=False
|
|
51
51
|
)
|
|
52
52
|
self.assertIsNone(result)
|
|
@@ -65,7 +65,7 @@ class TestServiceDelete(compute_fakes.TestComputev2):
|
|
|
65
65
|
calls = []
|
|
66
66
|
for s in self.services:
|
|
67
67
|
calls.append(mock.call(s.binary, ignore_missing=False))
|
|
68
|
-
self.
|
|
68
|
+
self.compute_client.delete_service.assert_has_calls(calls)
|
|
69
69
|
self.assertIsNone(result)
|
|
70
70
|
|
|
71
71
|
def test_multi_services_delete_with_exception(self):
|
|
@@ -77,7 +77,7 @@ class TestServiceDelete(compute_fakes.TestComputev2):
|
|
|
77
77
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
78
78
|
|
|
79
79
|
delete_mock_result = [None, exceptions.CommandError]
|
|
80
|
-
self.
|
|
80
|
+
self.compute_client.delete_service = mock.Mock(
|
|
81
81
|
side_effect=delete_mock_result
|
|
82
82
|
)
|
|
83
83
|
|
|
@@ -89,10 +89,10 @@ class TestServiceDelete(compute_fakes.TestComputev2):
|
|
|
89
89
|
'1 of 2 compute services failed to delete.', str(e)
|
|
90
90
|
)
|
|
91
91
|
|
|
92
|
-
self.
|
|
92
|
+
self.compute_client.delete_service.assert_any_call(
|
|
93
93
|
self.services[0].binary, ignore_missing=False
|
|
94
94
|
)
|
|
95
|
-
self.
|
|
95
|
+
self.compute_client.delete_service.assert_any_call(
|
|
96
96
|
'unexist_service', ignore_missing=False
|
|
97
97
|
)
|
|
98
98
|
|
|
@@ -103,7 +103,7 @@ class TestServiceList(compute_fakes.TestComputev2):
|
|
|
103
103
|
|
|
104
104
|
self.service = sdk_fakes.generate_fake_resource(_service.Service)
|
|
105
105
|
|
|
106
|
-
self.
|
|
106
|
+
self.compute_client.services.return_value = [self.service]
|
|
107
107
|
|
|
108
108
|
# Get the command object to test
|
|
109
109
|
self.cmd = service.ListService(self.app, None)
|
|
@@ -126,7 +126,7 @@ class TestServiceList(compute_fakes.TestComputev2):
|
|
|
126
126
|
# containing the data to be listed.
|
|
127
127
|
columns, data = self.cmd.take_action(parsed_args)
|
|
128
128
|
|
|
129
|
-
self.
|
|
129
|
+
self.compute_client.services.assert_called_with(
|
|
130
130
|
host=self.service.host,
|
|
131
131
|
binary=self.service.binary,
|
|
132
132
|
)
|
|
@@ -175,7 +175,7 @@ class TestServiceList(compute_fakes.TestComputev2):
|
|
|
175
175
|
# containing the data to be listed.
|
|
176
176
|
columns, data = self.cmd.take_action(parsed_args)
|
|
177
177
|
|
|
178
|
-
self.
|
|
178
|
+
self.compute_client.services.assert_called_with(
|
|
179
179
|
host=self.service.host,
|
|
180
180
|
binary=self.service.binary,
|
|
181
181
|
)
|
|
@@ -228,7 +228,7 @@ class TestServiceList(compute_fakes.TestComputev2):
|
|
|
228
228
|
# containing the data to be listed.
|
|
229
229
|
columns, data = self.cmd.take_action(parsed_args)
|
|
230
230
|
|
|
231
|
-
self.
|
|
231
|
+
self.compute_client.services.assert_called_with(
|
|
232
232
|
host=self.service.host,
|
|
233
233
|
binary=self.service.binary,
|
|
234
234
|
)
|
|
@@ -269,8 +269,8 @@ class TestServiceSet(compute_fakes.TestComputev2):
|
|
|
269
269
|
|
|
270
270
|
self.service = sdk_fakes.generate_fake_resource(_service.Service)
|
|
271
271
|
|
|
272
|
-
self.
|
|
273
|
-
self.
|
|
272
|
+
self.compute_client.enable_service.return_value = self.service
|
|
273
|
+
self.compute_client.disable_service.return_value = self.service
|
|
274
274
|
|
|
275
275
|
self.cmd = service.SetService(self.app, None)
|
|
276
276
|
|
|
@@ -286,8 +286,8 @@ class TestServiceSet(compute_fakes.TestComputev2):
|
|
|
286
286
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
287
287
|
result = self.cmd.take_action(parsed_args)
|
|
288
288
|
|
|
289
|
-
self.
|
|
290
|
-
self.
|
|
289
|
+
self.compute_client.enable_service.assert_not_called()
|
|
290
|
+
self.compute_client.disable_service.assert_not_called()
|
|
291
291
|
self.assertIsNone(result)
|
|
292
292
|
|
|
293
293
|
def test_service_set_enable(self):
|
|
@@ -305,7 +305,7 @@ class TestServiceSet(compute_fakes.TestComputev2):
|
|
|
305
305
|
|
|
306
306
|
result = self.cmd.take_action(parsed_args)
|
|
307
307
|
|
|
308
|
-
self.
|
|
308
|
+
self.compute_client.enable_service.assert_called_with(
|
|
309
309
|
None, self.service.host, self.service.binary
|
|
310
310
|
)
|
|
311
311
|
self.assertIsNone(result)
|
|
@@ -325,7 +325,7 @@ class TestServiceSet(compute_fakes.TestComputev2):
|
|
|
325
325
|
|
|
326
326
|
result = self.cmd.take_action(parsed_args)
|
|
327
327
|
|
|
328
|
-
self.
|
|
328
|
+
self.compute_client.disable_service.assert_called_with(
|
|
329
329
|
None, self.service.host, self.service.binary, None
|
|
330
330
|
)
|
|
331
331
|
self.assertIsNone(result)
|
|
@@ -349,7 +349,7 @@ class TestServiceSet(compute_fakes.TestComputev2):
|
|
|
349
349
|
|
|
350
350
|
result = self.cmd.take_action(parsed_args)
|
|
351
351
|
|
|
352
|
-
self.
|
|
352
|
+
self.compute_client.disable_service.assert_called_with(
|
|
353
353
|
None, self.service.host, self.service.binary, reason
|
|
354
354
|
)
|
|
355
355
|
self.assertIsNone(result)
|
|
@@ -419,11 +419,11 @@ class TestServiceSet(compute_fakes.TestComputev2):
|
|
|
419
419
|
]
|
|
420
420
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
421
421
|
result = self.cmd.take_action(parsed_args)
|
|
422
|
-
self.
|
|
422
|
+
self.compute_client.update_service_forced_down.assert_called_once_with(
|
|
423
423
|
None, self.service.host, self.service.binary, False
|
|
424
424
|
)
|
|
425
|
-
self.assertNotCalled(self.
|
|
426
|
-
self.assertNotCalled(self.
|
|
425
|
+
self.assertNotCalled(self.compute_client.enable_service)
|
|
426
|
+
self.assertNotCalled(self.compute_client.disable_service)
|
|
427
427
|
self.assertIsNone(result)
|
|
428
428
|
|
|
429
429
|
def test_service_set_state_down(self):
|
|
@@ -441,11 +441,11 @@ class TestServiceSet(compute_fakes.TestComputev2):
|
|
|
441
441
|
]
|
|
442
442
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
443
443
|
result = self.cmd.take_action(parsed_args)
|
|
444
|
-
self.
|
|
444
|
+
self.compute_client.update_service_forced_down.assert_called_once_with(
|
|
445
445
|
None, self.service.host, self.service.binary, True
|
|
446
446
|
)
|
|
447
|
-
self.assertNotCalled(self.
|
|
448
|
-
self.assertNotCalled(self.
|
|
447
|
+
self.assertNotCalled(self.compute_client.enable_service)
|
|
448
|
+
self.assertNotCalled(self.compute_client.disable_service)
|
|
449
449
|
self.assertIsNone(result)
|
|
450
450
|
|
|
451
451
|
def test_service_set_enable_and_state_down(self):
|
|
@@ -465,10 +465,10 @@ class TestServiceSet(compute_fakes.TestComputev2):
|
|
|
465
465
|
]
|
|
466
466
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
467
467
|
result = self.cmd.take_action(parsed_args)
|
|
468
|
-
self.
|
|
468
|
+
self.compute_client.enable_service.assert_called_once_with(
|
|
469
469
|
None, self.service.host, self.service.binary
|
|
470
470
|
)
|
|
471
|
-
self.
|
|
471
|
+
self.compute_client.update_service_forced_down.assert_called_once_with(
|
|
472
472
|
None, self.service.host, self.service.binary, True
|
|
473
473
|
)
|
|
474
474
|
self.assertIsNone(result)
|
|
@@ -491,12 +491,12 @@ class TestServiceSet(compute_fakes.TestComputev2):
|
|
|
491
491
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
492
492
|
|
|
493
493
|
with mock.patch.object(
|
|
494
|
-
self.
|
|
494
|
+
self.compute_client, 'enable_service', side_effect=Exception()
|
|
495
495
|
):
|
|
496
496
|
self.assertRaises(
|
|
497
497
|
exceptions.CommandError, self.cmd.take_action, parsed_args
|
|
498
498
|
)
|
|
499
|
-
self.
|
|
499
|
+
self.compute_client.update_service_forced_down.assert_called_once_with(
|
|
500
500
|
None, self.service.host, self.service.binary, True
|
|
501
501
|
)
|
|
502
502
|
|
|
@@ -519,14 +519,12 @@ class TestServiceSet(compute_fakes.TestComputev2):
|
|
|
519
519
|
]
|
|
520
520
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
521
521
|
service_id = '339478d0-0b95-4a94-be63-d5be05dfeb1c'
|
|
522
|
-
self.
|
|
523
|
-
mock.Mock(id=service_id)
|
|
524
|
-
]
|
|
522
|
+
self.compute_client.services.return_value = [mock.Mock(id=service_id)]
|
|
525
523
|
result = self.cmd.take_action(parsed_args)
|
|
526
|
-
self.
|
|
524
|
+
self.compute_client.disable_service.assert_called_once_with(
|
|
527
525
|
service_id, self.service.host, self.service.binary, None
|
|
528
526
|
)
|
|
529
|
-
self.
|
|
527
|
+
self.compute_client.update_service_forced_down.assert_called_once_with(
|
|
530
528
|
service_id, self.service.host, self.service.binary, True
|
|
531
529
|
)
|
|
532
530
|
self.assertIsNone(result)
|
|
@@ -552,11 +550,9 @@ class TestServiceSet(compute_fakes.TestComputev2):
|
|
|
552
550
|
]
|
|
553
551
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
554
552
|
service_id = '339478d0-0b95-4a94-be63-d5be05dfeb1c'
|
|
555
|
-
self.
|
|
556
|
-
mock.Mock(id=service_id)
|
|
557
|
-
]
|
|
553
|
+
self.compute_client.services.return_value = [mock.Mock(id=service_id)]
|
|
558
554
|
result = self.cmd.take_action(parsed_args)
|
|
559
|
-
self.
|
|
555
|
+
self.compute_client.disable_service.assert_called_once_with(
|
|
560
556
|
service_id, self.service.host, self.service.binary, reason
|
|
561
557
|
)
|
|
562
558
|
self.assertIsNone(result)
|
|
@@ -580,25 +576,23 @@ class TestServiceSet(compute_fakes.TestComputev2):
|
|
|
580
576
|
]
|
|
581
577
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
582
578
|
service_id = '339478d0-0b95-4a94-be63-d5be05dfeb1c'
|
|
583
|
-
self.
|
|
584
|
-
mock.Mock(id=service_id)
|
|
585
|
-
]
|
|
579
|
+
self.compute_client.services.return_value = [mock.Mock(id=service_id)]
|
|
586
580
|
result = self.cmd.take_action(parsed_args)
|
|
587
|
-
self.
|
|
581
|
+
self.compute_client.enable_service.assert_called_once_with(
|
|
588
582
|
service_id, self.service.host, self.service.binary
|
|
589
583
|
)
|
|
590
|
-
self.
|
|
584
|
+
self.compute_client.update_service_forced_down.assert_called_once_with(
|
|
591
585
|
service_id, self.service.host, self.service.binary, False
|
|
592
586
|
)
|
|
593
587
|
self.assertIsNone(result)
|
|
594
588
|
|
|
595
589
|
def test_service_set_find_service_by_host_and_binary_no_results(self):
|
|
596
590
|
# Tests that no compute services are found by host and binary.
|
|
597
|
-
self.
|
|
591
|
+
self.compute_client.services.return_value = []
|
|
598
592
|
ex = self.assertRaises(
|
|
599
593
|
exceptions.CommandError,
|
|
600
594
|
self.cmd._find_service_by_host_and_binary,
|
|
601
|
-
self.
|
|
595
|
+
self.compute_client,
|
|
602
596
|
'fake-host',
|
|
603
597
|
'nova-compute',
|
|
604
598
|
)
|
|
@@ -610,14 +604,14 @@ class TestServiceSet(compute_fakes.TestComputev2):
|
|
|
610
604
|
|
|
611
605
|
def test_service_set_find_service_by_host_and_binary_many_results(self):
|
|
612
606
|
# Tests that more than one compute service is found by host and binary.
|
|
613
|
-
self.
|
|
607
|
+
self.compute_client.services.return_value = [
|
|
614
608
|
mock.Mock(),
|
|
615
609
|
mock.Mock(),
|
|
616
610
|
]
|
|
617
611
|
ex = self.assertRaises(
|
|
618
612
|
exceptions.CommandError,
|
|
619
613
|
self.cmd._find_service_by_host_and_binary,
|
|
620
|
-
self.
|
|
614
|
+
self.compute_client,
|
|
621
615
|
'fake-host',
|
|
622
616
|
'nova-compute',
|
|
623
617
|
)
|
|
@@ -58,7 +58,7 @@ class TestUsageList(TestUsage):
|
|
|
58
58
|
def setUp(self):
|
|
59
59
|
super().setUp()
|
|
60
60
|
|
|
61
|
-
self.
|
|
61
|
+
self.compute_client.usages.return_value = self.usages
|
|
62
62
|
|
|
63
63
|
self.projects_mock.list.return_value = [self.project]
|
|
64
64
|
# Get the command object to test
|
|
@@ -97,7 +97,7 @@ class TestUsageList(TestUsage):
|
|
|
97
97
|
columns, data = self.cmd.take_action(parsed_args)
|
|
98
98
|
|
|
99
99
|
self.projects_mock.list.assert_called_with()
|
|
100
|
-
self.
|
|
100
|
+
self.compute_client.usages.assert_called_with(
|
|
101
101
|
start=datetime.datetime(2016, 11, 11, 0, 0),
|
|
102
102
|
end=datetime.datetime(2016, 12, 20, 0, 0),
|
|
103
103
|
detailed=True,
|
|
@@ -118,7 +118,7 @@ class TestUsageList(TestUsage):
|
|
|
118
118
|
columns, data = self.cmd.take_action(parsed_args)
|
|
119
119
|
|
|
120
120
|
self.projects_mock.list.assert_called_with()
|
|
121
|
-
self.
|
|
121
|
+
self.compute_client.usages.assert_has_calls(
|
|
122
122
|
[mock.call(start=mock.ANY, end=mock.ANY, detailed=True)]
|
|
123
123
|
)
|
|
124
124
|
self.assertCountEqual(self.columns, columns)
|
|
@@ -151,7 +151,7 @@ class TestUsageShow(TestUsage):
|
|
|
151
151
|
def setUp(self):
|
|
152
152
|
super().setUp()
|
|
153
153
|
|
|
154
|
-
self.
|
|
154
|
+
self.compute_client.get_usage.return_value = self.usage
|
|
155
155
|
|
|
156
156
|
self.projects_mock.get.return_value = self.project
|
|
157
157
|
# Get the command object to test
|
|
@@ -194,7 +194,7 @@ class TestUsageShow(TestUsage):
|
|
|
194
194
|
|
|
195
195
|
columns, data = self.cmd.take_action(parsed_args)
|
|
196
196
|
|
|
197
|
-
self.
|
|
197
|
+
self.compute_client.get_usage.assert_called_with(
|
|
198
198
|
project=self.project.id,
|
|
199
199
|
start=datetime.datetime(2016, 11, 11, 0, 0),
|
|
200
200
|
end=datetime.datetime(2016, 12, 20, 0, 0),
|
|
@@ -228,7 +228,7 @@ class FakeExtension:
|
|
|
228
228
|
extension_info = {
|
|
229
229
|
'name': 'name-' + uuid.uuid4().hex,
|
|
230
230
|
'namespace': (
|
|
231
|
-
'http://docs.openstack.org/identity/
|
|
231
|
+
'http://docs.openstack.org/identity/api/ext/OS-KSCRUD/v1.0'
|
|
232
232
|
),
|
|
233
233
|
'description': 'description-' + uuid.uuid4().hex,
|
|
234
234
|
'updated': '2013-07-07T12:00:0-00:00',
|
|
@@ -77,9 +77,7 @@ class TestAccessRuleDelete(identity_fakes.TestIdentityv3):
|
|
|
77
77
|
self.cmd.take_action(parsed_args)
|
|
78
78
|
self.fail('CommandError should be raised.')
|
|
79
79
|
except exceptions.CommandError as e:
|
|
80
|
-
self.assertEqual(
|
|
81
|
-
'1 of 2 access rules failed to' ' delete.', str(e)
|
|
82
|
-
)
|
|
80
|
+
self.assertEqual('1 of 2 access rules failed to delete.', str(e))
|
|
83
81
|
|
|
84
82
|
calls = []
|
|
85
83
|
for a in arglist:
|
|
@@ -295,7 +295,7 @@ class TestApplicationCredentialDelete(identity_fakes.TestIdentityv3):
|
|
|
295
295
|
self.fail('CommandError should be raised.')
|
|
296
296
|
except exceptions.CommandError as e:
|
|
297
297
|
self.assertEqual(
|
|
298
|
-
'1 of 2 application credentials failed to
|
|
298
|
+
'1 of 2 application credentials failed to delete.', str(e)
|
|
299
299
|
)
|
|
300
300
|
|
|
301
301
|
calls = []
|
|
@@ -73,10 +73,10 @@ class TestCredentialCreate(identity_fakes.TestIdentityv3):
|
|
|
73
73
|
columns, data = self.cmd.take_action(parsed_args)
|
|
74
74
|
|
|
75
75
|
kwargs = {
|
|
76
|
-
'
|
|
76
|
+
'user_id': self.credential.user_id,
|
|
77
77
|
'type': self.credential.type,
|
|
78
78
|
'blob': self.credential.blob,
|
|
79
|
-
'
|
|
79
|
+
'project_id': None,
|
|
80
80
|
}
|
|
81
81
|
self.identity_sdk_client.create_credential.assert_called_once_with(
|
|
82
82
|
**kwargs
|
|
@@ -105,10 +105,10 @@ class TestCredentialCreate(identity_fakes.TestIdentityv3):
|
|
|
105
105
|
columns, data = self.cmd.take_action(parsed_args)
|
|
106
106
|
|
|
107
107
|
kwargs = {
|
|
108
|
-
'
|
|
108
|
+
'user_id': self.credential.user_id,
|
|
109
109
|
'type': self.credential.type,
|
|
110
110
|
'blob': self.credential.blob,
|
|
111
|
-
'
|
|
111
|
+
'project_id': self.credential.project_id,
|
|
112
112
|
}
|
|
113
113
|
self.identity_sdk_client.create_credential.assert_called_once_with(
|
|
114
114
|
**kwargs
|