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
|
@@ -98,7 +98,7 @@ class TestQuotaList(TestQuota):
|
|
|
98
98
|
_compute_quota_set.QuotaSet
|
|
99
99
|
)
|
|
100
100
|
# the defaults are global hence use of return_value here
|
|
101
|
-
self.
|
|
101
|
+
self.compute_client.get_quota_set_defaults.return_value = (
|
|
102
102
|
self.default_compute_quotas
|
|
103
103
|
)
|
|
104
104
|
self.compute_reference_data = (
|
|
@@ -164,7 +164,7 @@ class TestQuotaList(TestQuota):
|
|
|
164
164
|
|
|
165
165
|
def test_quota_list_compute(self):
|
|
166
166
|
# Two projects with non-default quotas
|
|
167
|
-
self.
|
|
167
|
+
self.compute_client.get_quota_set.side_effect = self.compute_quotas
|
|
168
168
|
|
|
169
169
|
arglist = [
|
|
170
170
|
'--compute',
|
|
@@ -183,7 +183,7 @@ class TestQuotaList(TestQuota):
|
|
|
183
183
|
|
|
184
184
|
def test_quota_list_compute_default(self):
|
|
185
185
|
# One of the projects is at defaults
|
|
186
|
-
self.
|
|
186
|
+
self.compute_client.get_quota_set.side_effect = [
|
|
187
187
|
self.compute_quotas[0],
|
|
188
188
|
self.default_compute_quotas,
|
|
189
189
|
]
|
|
@@ -205,7 +205,7 @@ class TestQuotaList(TestQuota):
|
|
|
205
205
|
|
|
206
206
|
def test_quota_list_compute_project_not_found(self):
|
|
207
207
|
# Make one of the projects disappear
|
|
208
|
-
self.
|
|
208
|
+
self.compute_client.get_quota_set.side_effect = [
|
|
209
209
|
self.compute_quotas[0],
|
|
210
210
|
sdk_exceptions.NotFoundException("NotFound"),
|
|
211
211
|
]
|
|
@@ -227,7 +227,7 @@ class TestQuotaList(TestQuota):
|
|
|
227
227
|
|
|
228
228
|
def test_quota_list_compute_project_inaccessible(self):
|
|
229
229
|
# Make one of the projects inaccessible
|
|
230
|
-
self.
|
|
230
|
+
self.compute_client.get_quota_set.side_effect = [
|
|
231
231
|
self.compute_quotas[0],
|
|
232
232
|
sdk_exceptions.ForbiddenException("Forbidden"),
|
|
233
233
|
]
|
|
@@ -249,7 +249,7 @@ class TestQuotaList(TestQuota):
|
|
|
249
249
|
|
|
250
250
|
def test_quota_list_compute_server_error(self):
|
|
251
251
|
# Make the server "break"
|
|
252
|
-
self.
|
|
252
|
+
self.compute_client.get_quota_set.side_effect = (
|
|
253
253
|
sdk_exceptions.HttpException("Not implemented?")
|
|
254
254
|
)
|
|
255
255
|
|
|
@@ -470,7 +470,7 @@ class TestQuotaSet(TestQuota):
|
|
|
470
470
|
'server_group_members': servgroup_members_num,
|
|
471
471
|
}
|
|
472
472
|
|
|
473
|
-
self.
|
|
473
|
+
self.compute_client.update_quota_set.assert_called_once_with(
|
|
474
474
|
self.projects[0].id, **kwargs
|
|
475
475
|
)
|
|
476
476
|
self.assertIsNone(result)
|
|
@@ -744,7 +744,7 @@ class TestQuotaSet(TestQuota):
|
|
|
744
744
|
'volumes': volumes,
|
|
745
745
|
}
|
|
746
746
|
|
|
747
|
-
self.
|
|
747
|
+
self.compute_client.update_quota_class_set.assert_called_with(
|
|
748
748
|
self.projects[0].name, **kwargs_compute
|
|
749
749
|
)
|
|
750
750
|
self.volume_sdk_client.update_quota_class_set.assert_called_with(
|
|
@@ -842,7 +842,7 @@ class TestQuotaSet(TestQuota):
|
|
|
842
842
|
'volumes': volumes,
|
|
843
843
|
}
|
|
844
844
|
|
|
845
|
-
self.
|
|
845
|
+
self.compute_client.update_quota_class_set.assert_called_with(
|
|
846
846
|
'default', **kwargs_compute
|
|
847
847
|
)
|
|
848
848
|
self.volume_sdk_client.update_quota_class_set.assert_called_with(
|
|
@@ -899,7 +899,7 @@ class TestQuotaSet(TestQuota):
|
|
|
899
899
|
'subnet': subnet,
|
|
900
900
|
'force': True,
|
|
901
901
|
}
|
|
902
|
-
self.
|
|
902
|
+
self.compute_client.update_quota_set.assert_called_once_with(
|
|
903
903
|
self.projects[0].id, **kwargs_compute
|
|
904
904
|
)
|
|
905
905
|
self.volume_sdk_client.update_quota_set.assert_called_once_with(
|
|
@@ -942,7 +942,7 @@ class TestQuotaSet(TestQuota):
|
|
|
942
942
|
'subnet': 10,
|
|
943
943
|
'check_limit': True,
|
|
944
944
|
}
|
|
945
|
-
self.
|
|
945
|
+
self.compute_client.update_quota_set.assert_called_once_with(
|
|
946
946
|
self.projects[0].id, **kwargs_compute
|
|
947
947
|
)
|
|
948
948
|
self.volume_sdk_client.update_quota_set.assert_called_once_with(
|
|
@@ -955,18 +955,35 @@ class TestQuotaSet(TestQuota):
|
|
|
955
955
|
|
|
956
956
|
|
|
957
957
|
class TestQuotaShow(TestQuota):
|
|
958
|
+
_network_quota_details = {
|
|
959
|
+
'floating_ips': {'limit': 0, 'reserved': 0, 'used': 0},
|
|
960
|
+
'health_monitors': {'limit': 0, 'reserved': 0, 'used': 0},
|
|
961
|
+
'l7_policies': {'limit': 0, 'reserved': 0, 'used': 0},
|
|
962
|
+
'listeners': {'limit': 0, 'reserved': 0, 'used': 0},
|
|
963
|
+
'load_balancers': {'limit': 0, 'reserved': 0, 'used': 0},
|
|
964
|
+
'networks': {'limit': 0, 'reserved': 0, 'used': 0},
|
|
965
|
+
'pools': {'limit': 0, 'reserved': 0, 'used': 0},
|
|
966
|
+
'ports': {'limit': 0, 'reserved': 0, 'used': 0},
|
|
967
|
+
'rbac_policies': {'limit': 0, 'reserved': 0, 'used': 0},
|
|
968
|
+
'routers': {'limit': 0, 'reserved': 0, 'used': 0},
|
|
969
|
+
'security_group_rules': {'limit': 0, 'reserved': 0, 'used': 0},
|
|
970
|
+
'security_groups': {'limit': 0, 'reserved': 0, 'used': 0},
|
|
971
|
+
'subnet_pools': {'limit': 0, 'reserved': 0, 'used': 0},
|
|
972
|
+
'subnets': {'limit': 0, 'reserved': 0, 'used': 0},
|
|
973
|
+
}
|
|
974
|
+
|
|
958
975
|
def setUp(self):
|
|
959
976
|
super().setUp()
|
|
960
977
|
|
|
961
978
|
self.identity_sdk_client.find_project.return_value = self.projects[0]
|
|
962
979
|
|
|
963
|
-
self.
|
|
980
|
+
self.compute_client.get_quota_set.return_value = (
|
|
964
981
|
sdk_fakes.generate_fake_resource(_compute_quota_set.QuotaSet)
|
|
965
982
|
)
|
|
966
983
|
self.default_compute_quotas = sdk_fakes.generate_fake_resource(
|
|
967
984
|
_compute_quota_set.QuotaSet
|
|
968
985
|
)
|
|
969
|
-
self.
|
|
986
|
+
self.compute_client.get_quota_set_defaults.return_value = (
|
|
970
987
|
self.default_compute_quotas
|
|
971
988
|
)
|
|
972
989
|
|
|
@@ -980,9 +997,15 @@ class TestQuotaShow(TestQuota):
|
|
|
980
997
|
self.default_volume_quotas
|
|
981
998
|
)
|
|
982
999
|
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
1000
|
+
def get_network_quota_mock(*args, **kwargs):
|
|
1001
|
+
if kwargs.get("details"):
|
|
1002
|
+
return sdk_fakes.generate_fake_resource(
|
|
1003
|
+
_network_quota_set.QuotaDetails,
|
|
1004
|
+
**self._network_quota_details,
|
|
1005
|
+
)
|
|
1006
|
+
return sdk_fakes.generate_fake_resource(_network_quota_set.Quota)
|
|
1007
|
+
|
|
1008
|
+
self.network_client.get_quota.side_effect = get_network_quota_mock
|
|
986
1009
|
self.default_network_quotas = sdk_fakes.generate_fake_resource(
|
|
987
1010
|
_network_quota_set.QuotaDefault
|
|
988
1011
|
)
|
|
@@ -1004,7 +1027,7 @@ class TestQuotaShow(TestQuota):
|
|
|
1004
1027
|
|
|
1005
1028
|
self.cmd.take_action(parsed_args)
|
|
1006
1029
|
|
|
1007
|
-
self.
|
|
1030
|
+
self.compute_client.get_quota_set.assert_called_once_with(
|
|
1008
1031
|
self.projects[0].id,
|
|
1009
1032
|
usage=False,
|
|
1010
1033
|
)
|
|
@@ -1031,7 +1054,7 @@ class TestQuotaShow(TestQuota):
|
|
|
1031
1054
|
|
|
1032
1055
|
self.cmd.take_action(parsed_args)
|
|
1033
1056
|
|
|
1034
|
-
self.
|
|
1057
|
+
self.compute_client.get_quota_set.assert_called_once_with(
|
|
1035
1058
|
self.projects[0].id,
|
|
1036
1059
|
usage=False,
|
|
1037
1060
|
)
|
|
@@ -1051,7 +1074,7 @@ class TestQuotaShow(TestQuota):
|
|
|
1051
1074
|
|
|
1052
1075
|
self.cmd.take_action(parsed_args)
|
|
1053
1076
|
|
|
1054
|
-
self.
|
|
1077
|
+
self.compute_client.get_quota_set.assert_not_called()
|
|
1055
1078
|
self.volume_sdk_client.get_quota_set.assert_called_once_with(
|
|
1056
1079
|
self.projects[0].id,
|
|
1057
1080
|
usage=False,
|
|
@@ -1071,7 +1094,7 @@ class TestQuotaShow(TestQuota):
|
|
|
1071
1094
|
|
|
1072
1095
|
self.cmd.take_action(parsed_args)
|
|
1073
1096
|
|
|
1074
|
-
self.
|
|
1097
|
+
self.compute_client.get_quota_set.assert_not_called()
|
|
1075
1098
|
self.volume_sdk_client.get_quota_set.assert_not_called()
|
|
1076
1099
|
self.network_client.get_quota.assert_called_once_with(
|
|
1077
1100
|
self.projects[0].id,
|
|
@@ -1092,7 +1115,7 @@ class TestQuotaShow(TestQuota):
|
|
|
1092
1115
|
|
|
1093
1116
|
self.cmd.take_action(parsed_args)
|
|
1094
1117
|
|
|
1095
|
-
self.
|
|
1118
|
+
self.compute_client.get_quota_set_defaults.assert_called_once_with(
|
|
1096
1119
|
self.projects[0].id,
|
|
1097
1120
|
)
|
|
1098
1121
|
self.volume_sdk_client.get_quota_set_defaults.assert_called_once_with(
|
|
@@ -1116,7 +1139,7 @@ class TestQuotaShow(TestQuota):
|
|
|
1116
1139
|
|
|
1117
1140
|
self.cmd.take_action(parsed_args)
|
|
1118
1141
|
|
|
1119
|
-
self.
|
|
1142
|
+
self.compute_client.get_quota_set.assert_called_once_with(
|
|
1120
1143
|
self.projects[0].id,
|
|
1121
1144
|
usage=True,
|
|
1122
1145
|
)
|
|
@@ -1138,7 +1161,7 @@ class TestQuotaShow(TestQuota):
|
|
|
1138
1161
|
|
|
1139
1162
|
self.cmd.take_action(parsed_args)
|
|
1140
1163
|
|
|
1141
|
-
self.
|
|
1164
|
+
self.compute_client.get_quota_set.assert_called_once_with(
|
|
1142
1165
|
self.projects[1].id, usage=False
|
|
1143
1166
|
)
|
|
1144
1167
|
self.volume_sdk_client.get_quota_set.assert_called_once_with(
|
|
@@ -1158,7 +1181,7 @@ class TestQuotaDelete(TestQuota):
|
|
|
1158
1181
|
|
|
1159
1182
|
self.identity_sdk_client.find_project.return_value = self.projects[0]
|
|
1160
1183
|
|
|
1161
|
-
self.
|
|
1184
|
+
self.compute_client.revert_quota_set.return_value = None
|
|
1162
1185
|
self.volume_sdk_client.revert_quota_set.return_value = None
|
|
1163
1186
|
self.network_client.delete_quota.return_value = None
|
|
1164
1187
|
|
|
@@ -1182,7 +1205,7 @@ class TestQuotaDelete(TestQuota):
|
|
|
1182
1205
|
self.identity_sdk_client.find_project.assert_called_once_with(
|
|
1183
1206
|
self.projects[0].id, ignore_missing=False
|
|
1184
1207
|
)
|
|
1185
|
-
self.
|
|
1208
|
+
self.compute_client.revert_quota_set.assert_called_once_with(
|
|
1186
1209
|
self.projects[0].id,
|
|
1187
1210
|
)
|
|
1188
1211
|
self.volume_sdk_client.revert_quota_set.assert_called_once_with(
|
|
@@ -1211,7 +1234,7 @@ class TestQuotaDelete(TestQuota):
|
|
|
1211
1234
|
self.identity_sdk_client.find_project.assert_called_once_with(
|
|
1212
1235
|
self.projects[0].id, ignore_missing=False
|
|
1213
1236
|
)
|
|
1214
|
-
self.
|
|
1237
|
+
self.compute_client.revert_quota_set.assert_called_once_with(
|
|
1215
1238
|
self.projects[0].id,
|
|
1216
1239
|
)
|
|
1217
1240
|
self.volume_sdk_client.revert_quota_set.assert_not_called()
|
|
@@ -1236,7 +1259,7 @@ class TestQuotaDelete(TestQuota):
|
|
|
1236
1259
|
self.identity_sdk_client.find_project.assert_called_once_with(
|
|
1237
1260
|
self.projects[0].id, ignore_missing=False
|
|
1238
1261
|
)
|
|
1239
|
-
self.
|
|
1262
|
+
self.compute_client.revert_quota_set.assert_not_called()
|
|
1240
1263
|
self.volume_sdk_client.revert_quota_set.assert_called_once_with(
|
|
1241
1264
|
self.projects[0].id,
|
|
1242
1265
|
)
|
|
@@ -1261,7 +1284,7 @@ class TestQuotaDelete(TestQuota):
|
|
|
1261
1284
|
self.identity_sdk_client.find_project.assert_called_once_with(
|
|
1262
1285
|
self.projects[0].id, ignore_missing=False
|
|
1263
1286
|
)
|
|
1264
|
-
self.
|
|
1287
|
+
self.compute_client.revert_quota_set.assert_not_called()
|
|
1265
1288
|
self.volume_sdk_client.revert_quota_set.assert_not_called()
|
|
1266
1289
|
self.network_client.delete_quota.assert_called_once_with(
|
|
1267
1290
|
self.projects[0].id,
|
|
@@ -98,14 +98,8 @@ class FakeClientMixin:
|
|
|
98
98
|
def setUp(self):
|
|
99
99
|
super().setUp()
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
self.app.client_manager.sdk_connection.compute = mock.Mock(
|
|
104
|
-
_proxy.Proxy
|
|
105
|
-
)
|
|
106
|
-
self.compute_sdk_client = (
|
|
107
|
-
self.app.client_manager.sdk_connection.compute
|
|
108
|
-
)
|
|
101
|
+
self.app.client_manager.compute = mock.Mock(_proxy.Proxy)
|
|
102
|
+
self.compute_client = self.app.client_manager.compute
|
|
109
103
|
self.set_compute_api_version() # default to the lowest
|
|
110
104
|
|
|
111
105
|
def set_compute_api_version(self, version: str = '2.1'):
|
|
@@ -117,8 +111,8 @@ class FakeClientMixin:
|
|
|
117
111
|
"""
|
|
118
112
|
assert re.match(r'2.\d+', version)
|
|
119
113
|
|
|
120
|
-
self.
|
|
121
|
-
self.
|
|
114
|
+
self.compute_client.default_microversion = version
|
|
115
|
+
self.compute_client.get_endpoint_data.return_value = (
|
|
122
116
|
discover.EndpointData(
|
|
123
117
|
min_microversion='2.1', # nova has not bumped this yet
|
|
124
118
|
max_microversion=version,
|
|
@@ -61,7 +61,7 @@ class TestAgentCreate(compute_fakes.TestComputev2):
|
|
|
61
61
|
self._agent['version'],
|
|
62
62
|
)
|
|
63
63
|
|
|
64
|
-
self.
|
|
64
|
+
self.compute_client.post.return_value = fakes.FakeResponse(
|
|
65
65
|
data={'agent': self._agent}
|
|
66
66
|
)
|
|
67
67
|
self.cmd = agent.CreateAgent(self.app, None)
|
|
@@ -87,7 +87,7 @@ class TestAgentCreate(compute_fakes.TestComputev2):
|
|
|
87
87
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
88
88
|
columns, data = self.cmd.take_action(parsed_args)
|
|
89
89
|
|
|
90
|
-
self.
|
|
90
|
+
self.compute_client.post.assert_called_with(
|
|
91
91
|
'/os-agents',
|
|
92
92
|
json={
|
|
93
93
|
'agent': {
|
|
@@ -110,7 +110,7 @@ class TestAgentDelete(compute_fakes.TestComputev2):
|
|
|
110
110
|
def setUp(self):
|
|
111
111
|
super().setUp()
|
|
112
112
|
|
|
113
|
-
self.
|
|
113
|
+
self.compute_client.delete.return_value = fakes.FakeResponse(
|
|
114
114
|
status_code=http.HTTPStatus.NO_CONTENT
|
|
115
115
|
)
|
|
116
116
|
|
|
@@ -125,7 +125,7 @@ class TestAgentDelete(compute_fakes.TestComputev2):
|
|
|
125
125
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
126
126
|
result = self.cmd.take_action(parsed_args)
|
|
127
127
|
|
|
128
|
-
self.
|
|
128
|
+
self.compute_client.delete.assert_called_once_with(
|
|
129
129
|
'/os-agents/123',
|
|
130
130
|
microversion='2.1',
|
|
131
131
|
)
|
|
@@ -143,7 +143,7 @@ class TestAgentDelete(compute_fakes.TestComputev2):
|
|
|
143
143
|
calls = [
|
|
144
144
|
mock.call(f'/os-agents/{x}', microversion='2.1') for x in arglist
|
|
145
145
|
]
|
|
146
|
-
self.
|
|
146
|
+
self.compute_client.delete.assert_has_calls(calls)
|
|
147
147
|
self.assertIsNone(result)
|
|
148
148
|
|
|
149
149
|
def test_delete_multiple_agents_exception(self):
|
|
@@ -154,7 +154,7 @@ class TestAgentDelete(compute_fakes.TestComputev2):
|
|
|
154
154
|
|
|
155
155
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
156
156
|
|
|
157
|
-
self.
|
|
157
|
+
self.compute_client.delete.side_effect = [
|
|
158
158
|
fakes.FakeResponse(status_code=http.HTTPStatus.NO_CONTENT),
|
|
159
159
|
fakes.FakeResponse(status_code=http.HTTPStatus.NO_CONTENT),
|
|
160
160
|
fakes.FakeResponse(status_code=http.HTTPStatus.NOT_FOUND),
|
|
@@ -166,7 +166,7 @@ class TestAgentDelete(compute_fakes.TestComputev2):
|
|
|
166
166
|
calls = [
|
|
167
167
|
mock.call(f'/os-agents/{x}', microversion='2.1') for x in arglist
|
|
168
168
|
]
|
|
169
|
-
self.
|
|
169
|
+
self.compute_client.delete.assert_has_calls(calls)
|
|
170
170
|
|
|
171
171
|
def test_agent_delete_no_input(self):
|
|
172
172
|
arglist = []
|
|
@@ -208,7 +208,7 @@ class TestAgentList(compute_fakes.TestComputev2):
|
|
|
208
208
|
for _agent in _agents
|
|
209
209
|
]
|
|
210
210
|
|
|
211
|
-
self.
|
|
211
|
+
self.compute_client.get.return_value = fakes.FakeResponse(
|
|
212
212
|
data={'agents': _agents},
|
|
213
213
|
)
|
|
214
214
|
self.cmd = agent.ListAgent(self.app, None)
|
|
@@ -222,7 +222,7 @@ class TestAgentList(compute_fakes.TestComputev2):
|
|
|
222
222
|
|
|
223
223
|
self.assertEqual(self.columns, columns)
|
|
224
224
|
self.assertEqual(self.data, list(data))
|
|
225
|
-
self.
|
|
225
|
+
self.compute_client.get.assert_called_once_with(
|
|
226
226
|
'/os-agents',
|
|
227
227
|
microversion='2.1',
|
|
228
228
|
)
|
|
@@ -241,7 +241,7 @@ class TestAgentList(compute_fakes.TestComputev2):
|
|
|
241
241
|
|
|
242
242
|
self.assertEqual(self.columns, columns)
|
|
243
243
|
self.assertEqual(self.data, list(data))
|
|
244
|
-
self.
|
|
244
|
+
self.compute_client.get.assert_called_once_with(
|
|
245
245
|
'/os-agents?hypervisor=hypervisor',
|
|
246
246
|
microversion='2.1',
|
|
247
247
|
)
|
|
@@ -252,10 +252,10 @@ class TestAgentSet(compute_fakes.TestComputev2):
|
|
|
252
252
|
super().setUp()
|
|
253
253
|
|
|
254
254
|
self.agent = _generate_fake_agent()
|
|
255
|
-
self.
|
|
255
|
+
self.compute_client.get.return_value = fakes.FakeResponse(
|
|
256
256
|
data={'agents': [self.agent]},
|
|
257
257
|
)
|
|
258
|
-
self.
|
|
258
|
+
self.compute_client.put.return_value = fakes.FakeResponse()
|
|
259
259
|
|
|
260
260
|
self.cmd = agent.SetAgent(self.app, None)
|
|
261
261
|
|
|
@@ -269,7 +269,7 @@ class TestAgentSet(compute_fakes.TestComputev2):
|
|
|
269
269
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
270
270
|
result = self.cmd.take_action(parsed_args)
|
|
271
271
|
|
|
272
|
-
self.
|
|
272
|
+
self.compute_client.put.assert_called_once_with(
|
|
273
273
|
f'/os-agents/{self.agent["agent_id"]}',
|
|
274
274
|
json={
|
|
275
275
|
'para': {
|
|
@@ -297,7 +297,7 @@ class TestAgentSet(compute_fakes.TestComputev2):
|
|
|
297
297
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
298
298
|
result = self.cmd.take_action(parsed_args)
|
|
299
299
|
|
|
300
|
-
self.
|
|
300
|
+
self.compute_client.put.assert_called_once_with(
|
|
301
301
|
f'/os-agents/{self.agent["agent_id"]}',
|
|
302
302
|
json={
|
|
303
303
|
'para': {
|
|
@@ -325,7 +325,7 @@ class TestAgentSet(compute_fakes.TestComputev2):
|
|
|
325
325
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
326
326
|
result = self.cmd.take_action(parsed_args)
|
|
327
327
|
|
|
328
|
-
self.
|
|
328
|
+
self.compute_client.put.assert_called_once_with(
|
|
329
329
|
f'/os-agents/{self.agent["agent_id"]}',
|
|
330
330
|
json={
|
|
331
331
|
'para': {
|
|
@@ -353,7 +353,7 @@ class TestAgentSet(compute_fakes.TestComputev2):
|
|
|
353
353
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
354
354
|
result = self.cmd.take_action(parsed_args)
|
|
355
355
|
|
|
356
|
-
self.
|
|
356
|
+
self.compute_client.put.assert_called_once_with(
|
|
357
357
|
f'/os-agents/{self.agent["agent_id"]}',
|
|
358
358
|
json={
|
|
359
359
|
'para': {
|