python-openstackclient 7.4.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/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 +7 -5
- openstackclient/compute/v2/agent.py +5 -5
- openstackclient/compute/v2/aggregate.py +17 -15
- openstackclient/compute/v2/console.py +10 -4
- openstackclient/compute/v2/console_connection.py +48 -0
- 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 +18 -13
- openstackclient/compute/v2/server.py +144 -121
- openstackclient/compute/v2/server_backup.py +1 -1
- openstackclient/compute/v2/server_event.py +8 -17
- 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 +95 -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/application_credential.py +2 -2
- openstackclient/identity/v3/consumer.py +4 -3
- openstackclient/identity/v3/credential.py +6 -7
- openstackclient/identity/v3/domain.py +63 -44
- 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 +116 -72
- 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 +23 -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 +47 -11
- openstackclient/image/client.py +7 -5
- openstackclient/image/v1/image.py +11 -15
- openstackclient/image/v2/cache.py +2 -4
- openstackclient/image/v2/image.py +41 -48
- 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 -16
- 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 +69 -47
- 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 +7 -16
- 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 +53 -42
- openstackclient/network/v2/security_group.py +13 -19
- openstackclient/network/v2/security_group_rule.py +10 -11
- 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 +7 -3
- openstackclient/tests/functional/common/test_quota.py +3 -1
- openstackclient/tests/functional/compute/v2/common.py +12 -6
- openstackclient/tests/functional/compute/v2/test_keypair.py +41 -5
- 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 +85 -315
- 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 +34 -17
- openstackclient/tests/unit/compute/v2/test_console_connection.py +72 -0
- openstackclient/tests/unit/compute/v2/test_flavor.py +72 -72
- 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 +36 -29
- openstackclient/tests/unit/compute/v2/test_server.py +693 -606
- openstackclient/tests/unit/compute/v2/test_server_backup.py +36 -77
- openstackclient/tests/unit/compute/v2/test_server_event.py +18 -20
- openstackclient/tests/unit/compute/v2/test_server_group.py +25 -31
- openstackclient/tests/unit/compute/v2/test_server_image.py +37 -78
- openstackclient/tests/unit/compute/v2/test_server_migration.py +41 -41
- 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 +48 -26
- openstackclient/tests/unit/identity/v3/test_domain.py +115 -105
- openstackclient/tests/unit/identity/v3/test_endpoint.py +167 -172
- openstackclient/tests/unit/identity/v3/test_group.py +353 -202
- openstackclient/tests/unit/identity/v3/test_mappings.py +2 -2
- openstackclient/tests/unit/identity/v3/test_project.py +16 -0
- openstackclient/tests/unit/identity/v3/test_trust.py +5 -2
- openstackclient/tests/unit/identity/v3/test_user.py +102 -6
- openstackclient/tests/unit/image/v1/fakes.py +2 -2
- openstackclient/tests/unit/image/v1/test_image.py +8 -9
- openstackclient/tests/unit/image/v2/test_image.py +84 -46
- openstackclient/tests/unit/integ/cli/test_shell.py +1 -2
- openstackclient/tests/unit/network/test_common.py +2 -2
- openstackclient/tests/unit/network/v2/fakes.py +405 -485
- openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +8 -14
- openstackclient/tests/unit/network/v2/test_floating_ip_network.py +62 -54
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +1 -1
- 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_compute.py +11 -11
- 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_network_trunk.py +2 -2
- openstackclient/tests/unit/network/v2/test_port.py +21 -22
- openstackclient/tests/unit/network/v2/test_router.py +130 -51
- openstackclient/tests/unit/network/v2/test_security_group_compute.py +11 -19
- openstackclient/tests/unit/network/v2/test_security_group_network.py +25 -27
- openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +15 -17
- openstackclient/tests/unit/network/v2/test_security_group_rule_network.py +33 -39
- openstackclient/tests/unit/object/v1/test_object_all.py +4 -3
- openstackclient/tests/unit/test_shell.py +16 -13
- 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 +109 -106
- 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/v2/test_volume_transfer_request.py +1 -1
- openstackclient/tests/unit/volume/v3/fakes.py +2 -8
- 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 +131 -120
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +4 -4
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +198 -203
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +683 -49
- 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/service.py +41 -38
- openstackclient/volume/v2/volume.py +71 -53
- openstackclient/volume/v2/volume_backup.py +15 -10
- openstackclient/volume/v2/volume_snapshot.py +129 -93
- 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_log_level.py +22 -28
- openstackclient/volume/v3/block_storage_manage.py +1 -3
- openstackclient/volume/v3/service.py +105 -14
- openstackclient/volume/v3/volume.py +218 -58
- openstackclient/volume/v3/volume_attachment.py +3 -2
- openstackclient/volume/v3/volume_backup.py +31 -27
- openstackclient/volume/v3/volume_group.py +2 -1
- openstackclient/volume/v3/volume_group_snapshot.py +2 -1
- openstackclient/volume/v3/volume_snapshot.py +489 -13
- openstackclient/volume/v3/volume_type.py +10 -21
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/AUTHORS +11 -0
- python_openstackclient-8.1.0.dist-info/METADATA +264 -0
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/RECORD +238 -259
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/entry_points.txt +7 -47
- python_openstackclient-8.1.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/METADATA +0 -172
- python_openstackclient-7.4.0.dist-info/pbr.json +0 -1
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/LICENSE +0 -0
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/top_level.txt +0 -0
|
@@ -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:
|
|
@@ -24,6 +24,7 @@ from openstack.identity.v3 import (
|
|
|
24
24
|
application_credential as _application_credential,
|
|
25
25
|
)
|
|
26
26
|
from openstack.identity.v3 import role as _role
|
|
27
|
+
from openstack.identity.v3 import user as _user
|
|
27
28
|
from openstack.test import fakes as sdk_fakes
|
|
28
29
|
from openstackclient.identity.v3 import application_credential
|
|
29
30
|
from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes
|
|
@@ -295,7 +296,7 @@ class TestApplicationCredentialDelete(identity_fakes.TestIdentityv3):
|
|
|
295
296
|
self.fail('CommandError should be raised.')
|
|
296
297
|
except exceptions.CommandError as e:
|
|
297
298
|
self.assertEqual(
|
|
298
|
-
'1 of 2 application credentials failed to
|
|
299
|
+
'1 of 2 application credentials failed to delete.', str(e)
|
|
299
300
|
)
|
|
300
301
|
|
|
301
302
|
calls = []
|
|
@@ -325,6 +326,31 @@ class TestApplicationCredentialList(identity_fakes.TestIdentityv3):
|
|
|
325
326
|
self.identity_sdk_client.application_credentials.return_value = [
|
|
326
327
|
self.application_credential
|
|
327
328
|
]
|
|
329
|
+
self.user = sdk_fakes.generate_fake_resource(resource_type=_user.User)
|
|
330
|
+
self.identity_sdk_client.find_user.return_value = self.user
|
|
331
|
+
|
|
332
|
+
self.columns = (
|
|
333
|
+
'ID',
|
|
334
|
+
'Name',
|
|
335
|
+
'Description',
|
|
336
|
+
'Project ID',
|
|
337
|
+
'Roles',
|
|
338
|
+
'Unrestricted',
|
|
339
|
+
'Access Rules',
|
|
340
|
+
'Expires At',
|
|
341
|
+
)
|
|
342
|
+
self.data = (
|
|
343
|
+
(
|
|
344
|
+
self.application_credential.id,
|
|
345
|
+
self.application_credential.name,
|
|
346
|
+
self.application_credential.description,
|
|
347
|
+
self.application_credential.project_id,
|
|
348
|
+
'',
|
|
349
|
+
self.application_credential.unrestricted,
|
|
350
|
+
self.application_credential.access_rules,
|
|
351
|
+
self.application_credential.expires_at,
|
|
352
|
+
),
|
|
353
|
+
)
|
|
328
354
|
|
|
329
355
|
# Get the command object to test
|
|
330
356
|
self.cmd = application_credential.ListApplicationCredential(
|
|
@@ -339,39 +365,35 @@ class TestApplicationCredentialList(identity_fakes.TestIdentityv3):
|
|
|
339
365
|
conn = self.app.client_manager.sdk_connection
|
|
340
366
|
user_id = conn.config.get_auth().get_user_id(conn.identity)
|
|
341
367
|
|
|
342
|
-
# In base command class Lister in cliff, abstract method take_action()
|
|
343
|
-
# returns a tuple containing the column names and an iterable
|
|
344
|
-
# containing the data to be listed.
|
|
345
368
|
columns, data = self.cmd.take_action(parsed_args)
|
|
346
369
|
|
|
370
|
+
self.assertEqual(self.columns, columns)
|
|
371
|
+
self.assertEqual(self.data, tuple(data))
|
|
372
|
+
|
|
373
|
+
self.identity_sdk_client.find_user.assert_not_called()
|
|
347
374
|
self.identity_sdk_client.application_credentials.assert_called_with(
|
|
348
375
|
user=user_id
|
|
349
376
|
)
|
|
350
377
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
378
|
+
def test_application_credential_list_user(self):
|
|
379
|
+
arglist = ['--user', self.user.name]
|
|
380
|
+
verifylist = []
|
|
381
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
382
|
+
|
|
383
|
+
conn = self.app.client_manager.sdk_connection
|
|
384
|
+
conn.config.get_auth().get_user_id(conn.identity)
|
|
385
|
+
|
|
386
|
+
columns, data = self.cmd.take_action(parsed_args)
|
|
387
|
+
|
|
388
|
+
self.assertEqual(self.columns, columns)
|
|
389
|
+
self.assertEqual(self.data, tuple(data))
|
|
390
|
+
|
|
391
|
+
self.identity_sdk_client.find_user.assert_called_once_with(
|
|
392
|
+
name_or_id=self.user.name, ignore_missing=False
|
|
360
393
|
)
|
|
361
|
-
self.
|
|
362
|
-
|
|
363
|
-
(
|
|
364
|
-
self.application_credential.id,
|
|
365
|
-
self.application_credential.name,
|
|
366
|
-
self.application_credential.description,
|
|
367
|
-
self.application_credential.project_id,
|
|
368
|
-
self.application_credential.roles,
|
|
369
|
-
self.application_credential.unrestricted,
|
|
370
|
-
self.application_credential.access_rules,
|
|
371
|
-
self.application_credential.expires_at,
|
|
372
|
-
),
|
|
394
|
+
self.identity_sdk_client.application_credentials.assert_called_with(
|
|
395
|
+
user=self.user.id
|
|
373
396
|
)
|
|
374
|
-
self.assertEqual(datalist, tuple(data))
|
|
375
397
|
|
|
376
398
|
|
|
377
399
|
class TestApplicationCredentialShow(identity_fakes.TestIdentityv3):
|