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
|
@@ -36,28 +36,32 @@ class TestCreateSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
|
36
36
|
project = identity_fakes.FakeProject.create_one_project()
|
|
37
37
|
domain = identity_fakes.FakeDomain.create_one_domain()
|
|
38
38
|
# The security group to be created.
|
|
39
|
-
_security_group = (
|
|
40
|
-
network_fakes.FakeSecurityGroup.create_one_security_group()
|
|
41
|
-
)
|
|
39
|
+
_security_group = network_fakes.create_one_security_group()
|
|
42
40
|
|
|
43
41
|
columns = (
|
|
42
|
+
'created_at',
|
|
44
43
|
'description',
|
|
45
44
|
'id',
|
|
46
45
|
'name',
|
|
47
46
|
'project_id',
|
|
47
|
+
'revision_number',
|
|
48
48
|
'rules',
|
|
49
49
|
'stateful',
|
|
50
50
|
'tags',
|
|
51
|
+
'updated_at',
|
|
51
52
|
)
|
|
52
53
|
|
|
53
54
|
data = (
|
|
55
|
+
_security_group.created_at,
|
|
54
56
|
_security_group.description,
|
|
55
57
|
_security_group.id,
|
|
56
58
|
_security_group.name,
|
|
57
59
|
_security_group.project_id,
|
|
60
|
+
_security_group.revision_number,
|
|
58
61
|
security_group.NetworkSecurityGroupRulesColumn([]),
|
|
59
62
|
_security_group.stateful,
|
|
60
63
|
_security_group.tags,
|
|
64
|
+
_security_group.updated_at,
|
|
61
65
|
)
|
|
62
66
|
|
|
63
67
|
def setUp(self):
|
|
@@ -163,7 +167,7 @@ class TestCreateSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
|
163
167
|
else:
|
|
164
168
|
self.assertFalse(self.network_client.set_tags.called)
|
|
165
169
|
self.assertEqual(self.columns, columns)
|
|
166
|
-
self.
|
|
170
|
+
self.assertEqual(self.data, data)
|
|
167
171
|
|
|
168
172
|
def test_create_with_tags(self):
|
|
169
173
|
self._test_create_with_tag(add_tags=True)
|
|
@@ -174,7 +178,7 @@ class TestCreateSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
|
174
178
|
|
|
175
179
|
class TestDeleteSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
176
180
|
# The security groups to be deleted.
|
|
177
|
-
_security_groups = network_fakes.
|
|
181
|
+
_security_groups = network_fakes.create_security_groups()
|
|
178
182
|
|
|
179
183
|
def setUp(self):
|
|
180
184
|
super().setUp()
|
|
@@ -184,9 +188,7 @@ class TestDeleteSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
|
184
188
|
)
|
|
185
189
|
|
|
186
190
|
self.network_client.find_security_group = (
|
|
187
|
-
network_fakes.
|
|
188
|
-
self._security_groups
|
|
189
|
-
)
|
|
191
|
+
network_fakes.get_security_groups(self._security_groups)
|
|
190
192
|
)
|
|
191
193
|
|
|
192
194
|
# Get the command object to test
|
|
@@ -264,9 +266,7 @@ class TestDeleteSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
|
264
266
|
|
|
265
267
|
class TestListSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
266
268
|
# The security group to be listed.
|
|
267
|
-
_security_groups = network_fakes.
|
|
268
|
-
count=3
|
|
269
|
-
)
|
|
269
|
+
_security_groups = network_fakes.create_security_groups(count=3)
|
|
270
270
|
|
|
271
271
|
columns = (
|
|
272
272
|
'ID',
|
|
@@ -412,10 +412,8 @@ class TestListSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
|
412
412
|
|
|
413
413
|
class TestSetSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
414
414
|
# The security group to be set.
|
|
415
|
-
_security_group = (
|
|
416
|
-
|
|
417
|
-
attrs={'tags': ['green', 'red']}
|
|
418
|
-
)
|
|
415
|
+
_security_group = network_fakes.create_one_security_group(
|
|
416
|
+
attrs={'tags': ['green', 'red']}
|
|
419
417
|
)
|
|
420
418
|
|
|
421
419
|
def setUp(self):
|
|
@@ -515,37 +513,39 @@ class TestSetSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
|
515
513
|
|
|
516
514
|
class TestShowSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
517
515
|
# The security group rule to be shown with the group.
|
|
518
|
-
_security_group_rule = (
|
|
519
|
-
network_fakes.FakeSecurityGroupRule.create_one_security_group_rule()
|
|
520
|
-
)
|
|
516
|
+
_security_group_rule = network_fakes.create_one_security_group_rule()
|
|
521
517
|
|
|
522
518
|
# The security group to be shown.
|
|
523
|
-
_security_group = (
|
|
524
|
-
|
|
525
|
-
attrs={'security_group_rules': [_security_group_rule._info]}
|
|
526
|
-
)
|
|
519
|
+
_security_group = network_fakes.create_one_security_group(
|
|
520
|
+
attrs={'security_group_rules': [dict(_security_group_rule)]}
|
|
527
521
|
)
|
|
528
522
|
|
|
529
523
|
columns = (
|
|
524
|
+
'created_at',
|
|
530
525
|
'description',
|
|
531
526
|
'id',
|
|
532
527
|
'name',
|
|
533
528
|
'project_id',
|
|
529
|
+
'revision_number',
|
|
534
530
|
'rules',
|
|
535
531
|
'stateful',
|
|
536
532
|
'tags',
|
|
533
|
+
'updated_at',
|
|
537
534
|
)
|
|
538
535
|
|
|
539
536
|
data = (
|
|
537
|
+
_security_group.created_at,
|
|
540
538
|
_security_group.description,
|
|
541
539
|
_security_group.id,
|
|
542
540
|
_security_group.name,
|
|
543
541
|
_security_group.project_id,
|
|
542
|
+
_security_group.revision_number,
|
|
544
543
|
security_group.NetworkSecurityGroupRulesColumn(
|
|
545
|
-
[_security_group_rule
|
|
544
|
+
[dict(_security_group_rule)]
|
|
546
545
|
),
|
|
547
546
|
_security_group.stateful,
|
|
548
547
|
_security_group.tags,
|
|
548
|
+
_security_group.updated_at,
|
|
549
549
|
)
|
|
550
550
|
|
|
551
551
|
def setUp(self):
|
|
@@ -583,10 +583,8 @@ class TestShowSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
|
583
583
|
|
|
584
584
|
class TestUnsetSecurityGroupNetwork(TestSecurityGroupNetwork):
|
|
585
585
|
# The security group to be unset.
|
|
586
|
-
_security_group = (
|
|
587
|
-
|
|
588
|
-
attrs={'tags': ['green', 'red']}
|
|
589
|
-
)
|
|
586
|
+
_security_group = network_fakes.create_one_security_group(
|
|
587
|
+
attrs={'tags': ['green', 'red']}
|
|
590
588
|
)
|
|
591
589
|
|
|
592
590
|
def setUp(self):
|
|
@@ -159,7 +159,7 @@ class TestCreateSecurityGroupRuleCompute(compute_fakes.TestComputev2):
|
|
|
159
159
|
columns, data = self.cmd.take_action(parsed_args)
|
|
160
160
|
|
|
161
161
|
sgr_mock.assert_called_once_with(
|
|
162
|
-
self.
|
|
162
|
+
self.compute_client,
|
|
163
163
|
security_group_id=self._security_group['id'],
|
|
164
164
|
ip_protocol=self._security_group_rule['ip_protocol'],
|
|
165
165
|
from_port=self._security_group_rule['from_port'],
|
|
@@ -202,7 +202,7 @@ class TestCreateSecurityGroupRuleCompute(compute_fakes.TestComputev2):
|
|
|
202
202
|
columns, data = self.cmd.take_action(parsed_args)
|
|
203
203
|
|
|
204
204
|
sgr_mock.assert_called_once_with(
|
|
205
|
-
self.
|
|
205
|
+
self.compute_client,
|
|
206
206
|
security_group_id=self._security_group['id'],
|
|
207
207
|
ip_protocol=self._security_group_rule['ip_protocol'],
|
|
208
208
|
from_port=self._security_group_rule['from_port'],
|
|
@@ -240,7 +240,7 @@ class TestCreateSecurityGroupRuleCompute(compute_fakes.TestComputev2):
|
|
|
240
240
|
columns, data = self.cmd.take_action(parsed_args)
|
|
241
241
|
|
|
242
242
|
sgr_mock.assert_called_once_with(
|
|
243
|
-
self.
|
|
243
|
+
self.compute_client,
|
|
244
244
|
security_group_id=self._security_group['id'],
|
|
245
245
|
ip_protocol=self._security_group_rule['ip_protocol'],
|
|
246
246
|
from_port=self._security_group_rule['from_port'],
|
|
@@ -279,7 +279,7 @@ class TestCreateSecurityGroupRuleCompute(compute_fakes.TestComputev2):
|
|
|
279
279
|
columns, data = self.cmd.take_action(parsed_args)
|
|
280
280
|
|
|
281
281
|
sgr_mock.assert_called_once_with(
|
|
282
|
-
self.
|
|
282
|
+
self.compute_client,
|
|
283
283
|
security_group_id=self._security_group['id'],
|
|
284
284
|
ip_protocol=self._security_group_rule['ip_protocol'],
|
|
285
285
|
from_port=self._security_group_rule['from_port'],
|
|
@@ -316,7 +316,7 @@ class TestDeleteSecurityGroupRuleCompute(compute_fakes.TestComputev2):
|
|
|
316
316
|
result = self.cmd.take_action(parsed_args)
|
|
317
317
|
|
|
318
318
|
sgr_mock.assert_called_once_with(
|
|
319
|
-
self.
|
|
319
|
+
self.compute_client, self._security_group_rules[0]['id']
|
|
320
320
|
)
|
|
321
321
|
self.assertIsNone(result)
|
|
322
322
|
|
|
@@ -335,11 +335,11 @@ class TestDeleteSecurityGroupRuleCompute(compute_fakes.TestComputev2):
|
|
|
335
335
|
sgr_mock.assert_has_calls(
|
|
336
336
|
[
|
|
337
337
|
mock.call(
|
|
338
|
-
self.
|
|
338
|
+
self.compute_client,
|
|
339
339
|
self._security_group_rules[0]['id'],
|
|
340
340
|
),
|
|
341
341
|
mock.call(
|
|
342
|
-
self.
|
|
342
|
+
self.compute_client,
|
|
343
343
|
self._security_group_rules[1]['id'],
|
|
344
344
|
),
|
|
345
345
|
]
|
|
@@ -367,10 +367,10 @@ class TestDeleteSecurityGroupRuleCompute(compute_fakes.TestComputev2):
|
|
|
367
367
|
sgr_mock.assert_has_calls(
|
|
368
368
|
[
|
|
369
369
|
mock.call(
|
|
370
|
-
self.
|
|
370
|
+
self.compute_client,
|
|
371
371
|
self._security_group_rules[0]['id'],
|
|
372
372
|
),
|
|
373
|
-
mock.call(self.
|
|
373
|
+
mock.call(self.compute_client, 'unexist_rule'),
|
|
374
374
|
]
|
|
375
375
|
)
|
|
376
376
|
|
|
@@ -383,7 +383,6 @@ class TestListSecurityGroupRuleCompute(compute_fakes.TestComputev2):
|
|
|
383
383
|
_security_group_rule_tcp = compute_fakes.create_one_security_group_rule(
|
|
384
384
|
{
|
|
385
385
|
'ip_protocol': 'tcp',
|
|
386
|
-
'ethertype': 'IPv4',
|
|
387
386
|
'from_port': 80,
|
|
388
387
|
'to_port': 80,
|
|
389
388
|
'group': {'name': _security_group['name']},
|
|
@@ -392,7 +391,6 @@ class TestListSecurityGroupRuleCompute(compute_fakes.TestComputev2):
|
|
|
392
391
|
_security_group_rule_icmp = compute_fakes.create_one_security_group_rule(
|
|
393
392
|
{
|
|
394
393
|
'ip_protocol': 'icmp',
|
|
395
|
-
'ethertype': 'IPv4',
|
|
396
394
|
'from_port': -1,
|
|
397
395
|
'to_port': -1,
|
|
398
396
|
'ip_range': {'cidr': '10.0.2.0/24'},
|
|
@@ -426,7 +424,7 @@ class TestListSecurityGroupRuleCompute(compute_fakes.TestComputev2):
|
|
|
426
424
|
expected_rule_with_group = (
|
|
427
425
|
rule['id'],
|
|
428
426
|
rule['ip_protocol'],
|
|
429
|
-
|
|
427
|
+
'', # ethertype is a neutron-only thing
|
|
430
428
|
rule['ip_range'],
|
|
431
429
|
rule['port_range'],
|
|
432
430
|
rule['remote_security_group'],
|
|
@@ -457,7 +455,7 @@ class TestListSecurityGroupRuleCompute(compute_fakes.TestComputev2):
|
|
|
457
455
|
|
|
458
456
|
columns, data = self.cmd.take_action(parsed_args)
|
|
459
457
|
compute_v2.list_security_groups.assert_called_once_with(
|
|
460
|
-
self.
|
|
458
|
+
self.compute_client, all_projects=False
|
|
461
459
|
)
|
|
462
460
|
self.assertEqual(self.expected_columns_no_group, columns)
|
|
463
461
|
self.assertEqual(self.expected_data_no_group, list(data))
|
|
@@ -473,7 +471,7 @@ class TestListSecurityGroupRuleCompute(compute_fakes.TestComputev2):
|
|
|
473
471
|
|
|
474
472
|
columns, data = self.cmd.take_action(parsed_args)
|
|
475
473
|
compute_v2.find_security_group.assert_called_once_with(
|
|
476
|
-
self.
|
|
474
|
+
self.compute_client, self._security_group['id']
|
|
477
475
|
)
|
|
478
476
|
self.assertEqual(self.expected_columns_with_group, columns)
|
|
479
477
|
self.assertEqual(self.expected_data_with_group, list(data))
|
|
@@ -489,7 +487,7 @@ class TestListSecurityGroupRuleCompute(compute_fakes.TestComputev2):
|
|
|
489
487
|
|
|
490
488
|
columns, data = self.cmd.take_action(parsed_args)
|
|
491
489
|
compute_v2.list_security_groups.assert_called_once_with(
|
|
492
|
-
self.
|
|
490
|
+
self.compute_client, all_projects=True
|
|
493
491
|
)
|
|
494
492
|
self.assertEqual(self.expected_columns_no_group, columns)
|
|
495
493
|
self.assertEqual(self.expected_data_no_group, list(data))
|
|
@@ -505,7 +503,7 @@ class TestListSecurityGroupRuleCompute(compute_fakes.TestComputev2):
|
|
|
505
503
|
|
|
506
504
|
columns, data = self.cmd.take_action(parsed_args)
|
|
507
505
|
compute_v2.list_security_groups.assert_called_once_with(
|
|
508
|
-
self.
|
|
506
|
+
self.compute_client, all_projects=False
|
|
509
507
|
)
|
|
510
508
|
self.assertEqual(self.expected_columns_no_group, columns)
|
|
511
509
|
self.assertEqual(self.expected_data_no_group, list(data))
|
|
@@ -551,7 +549,7 @@ class TestShowSecurityGroupRuleCompute(compute_fakes.TestComputev2):
|
|
|
551
549
|
columns, data = self.cmd.take_action(parsed_args)
|
|
552
550
|
|
|
553
551
|
compute_v2.list_security_groups.assert_called_once_with(
|
|
554
|
-
self.
|
|
552
|
+
self.compute_client
|
|
555
553
|
)
|
|
556
554
|
self.assertEqual(self.columns, columns)
|
|
557
555
|
self.assertEqual(self.data, data)
|
|
@@ -40,14 +40,13 @@ class TestCreateSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork):
|
|
|
40
40
|
_security_group_rule = None
|
|
41
41
|
|
|
42
42
|
# The security group that will contain the rule created.
|
|
43
|
-
_security_group = (
|
|
44
|
-
network_fakes.FakeSecurityGroup.create_one_security_group()
|
|
45
|
-
)
|
|
43
|
+
_security_group = network_fakes.create_one_security_group()
|
|
46
44
|
|
|
47
45
|
# The address group to be used in security group rules
|
|
48
46
|
_address_group = network_fakes.create_one_address_group()
|
|
49
47
|
|
|
50
48
|
expected_columns = (
|
|
49
|
+
'created_at',
|
|
51
50
|
'description',
|
|
52
51
|
'direction',
|
|
53
52
|
'ether_type',
|
|
@@ -59,21 +58,22 @@ class TestCreateSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork):
|
|
|
59
58
|
'remote_address_group_id',
|
|
60
59
|
'remote_group_id',
|
|
61
60
|
'remote_ip_prefix',
|
|
61
|
+
'revision_number',
|
|
62
62
|
'security_group_id',
|
|
63
|
+
'updated_at',
|
|
63
64
|
)
|
|
64
65
|
|
|
65
66
|
expected_data = None
|
|
66
67
|
|
|
67
68
|
def _setup_security_group_rule(self, attrs=None):
|
|
68
69
|
self._security_group_rule = (
|
|
69
|
-
network_fakes.
|
|
70
|
-
attrs
|
|
71
|
-
)
|
|
70
|
+
network_fakes.create_one_security_group_rule(attrs)
|
|
72
71
|
)
|
|
73
72
|
self.network_client.create_security_group_rule = mock.Mock(
|
|
74
73
|
return_value=self._security_group_rule
|
|
75
74
|
)
|
|
76
75
|
self.expected_data = (
|
|
76
|
+
self._security_group_rule.created_at,
|
|
77
77
|
self._security_group_rule.description,
|
|
78
78
|
self._security_group_rule.direction,
|
|
79
79
|
self._security_group_rule.ether_type,
|
|
@@ -85,7 +85,9 @@ class TestCreateSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork):
|
|
|
85
85
|
self._security_group_rule.remote_address_group_id,
|
|
86
86
|
self._security_group_rule.remote_group_id,
|
|
87
87
|
self._security_group_rule.remote_ip_prefix,
|
|
88
|
+
self._security_group_rule.revision_number,
|
|
88
89
|
self._security_group_rule.security_group_id,
|
|
90
|
+
self._security_group_rule.updated_at,
|
|
89
91
|
)
|
|
90
92
|
|
|
91
93
|
def setUp(self):
|
|
@@ -963,11 +965,7 @@ class TestCreateSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork):
|
|
|
963
965
|
|
|
964
966
|
class TestDeleteSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork):
|
|
965
967
|
# The security group rules to be deleted.
|
|
966
|
-
_security_group_rules = (
|
|
967
|
-
network_fakes.FakeSecurityGroupRule.create_security_group_rules(
|
|
968
|
-
count=2
|
|
969
|
-
)
|
|
970
|
-
)
|
|
968
|
+
_security_group_rules = network_fakes.create_security_group_rules(count=2)
|
|
971
969
|
|
|
972
970
|
def setUp(self):
|
|
973
971
|
super().setUp()
|
|
@@ -977,9 +975,7 @@ class TestDeleteSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork):
|
|
|
977
975
|
)
|
|
978
976
|
|
|
979
977
|
self.network_client.find_security_group_rule = (
|
|
980
|
-
network_fakes.
|
|
981
|
-
self._security_group_rules
|
|
982
|
-
)
|
|
978
|
+
network_fakes.get_security_group_rules(self._security_group_rules)
|
|
983
979
|
)
|
|
984
980
|
|
|
985
981
|
# Get the command object to test
|
|
@@ -1057,33 +1053,27 @@ class TestDeleteSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork):
|
|
|
1057
1053
|
|
|
1058
1054
|
class TestListSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork):
|
|
1059
1055
|
# The security group to hold the rules.
|
|
1060
|
-
_security_group = (
|
|
1061
|
-
network_fakes.FakeSecurityGroup.create_one_security_group()
|
|
1062
|
-
)
|
|
1056
|
+
_security_group = network_fakes.create_one_security_group()
|
|
1063
1057
|
|
|
1064
1058
|
# The security group rule to be listed.
|
|
1065
|
-
_security_group_rule_tcp = (
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
}
|
|
1073
|
-
)
|
|
1059
|
+
_security_group_rule_tcp = network_fakes.create_one_security_group_rule(
|
|
1060
|
+
{
|
|
1061
|
+
'protocol': 'tcp',
|
|
1062
|
+
'port_range_max': 80,
|
|
1063
|
+
'port_range_min': 80,
|
|
1064
|
+
'security_group_id': _security_group.id,
|
|
1065
|
+
}
|
|
1074
1066
|
)
|
|
1075
|
-
_security_group_rule_icmp = (
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
}
|
|
1082
|
-
)
|
|
1067
|
+
_security_group_rule_icmp = network_fakes.create_one_security_group_rule(
|
|
1068
|
+
{
|
|
1069
|
+
'protocol': 'icmp',
|
|
1070
|
+
'remote_ip_prefix': '10.0.2.0/24',
|
|
1071
|
+
'security_group_id': _security_group.id,
|
|
1072
|
+
}
|
|
1083
1073
|
)
|
|
1084
1074
|
_security_group.security_group_rules = [
|
|
1085
|
-
_security_group_rule_tcp
|
|
1086
|
-
_security_group_rule_icmp
|
|
1075
|
+
dict(_security_group_rule_tcp),
|
|
1076
|
+
dict(_security_group_rule_icmp),
|
|
1087
1077
|
]
|
|
1088
1078
|
_security_group_rules = [
|
|
1089
1079
|
_security_group_rule_tcp,
|
|
@@ -1264,11 +1254,10 @@ class TestListSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork):
|
|
|
1264
1254
|
|
|
1265
1255
|
class TestShowSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork):
|
|
1266
1256
|
# The security group rule to be shown.
|
|
1267
|
-
_security_group_rule = (
|
|
1268
|
-
network_fakes.FakeSecurityGroupRule.create_one_security_group_rule()
|
|
1269
|
-
)
|
|
1257
|
+
_security_group_rule = network_fakes.create_one_security_group_rule()
|
|
1270
1258
|
|
|
1271
1259
|
columns = (
|
|
1260
|
+
'created_at',
|
|
1272
1261
|
'description',
|
|
1273
1262
|
'direction',
|
|
1274
1263
|
'ether_type',
|
|
@@ -1280,10 +1269,13 @@ class TestShowSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork):
|
|
|
1280
1269
|
'remote_address_group_id',
|
|
1281
1270
|
'remote_group_id',
|
|
1282
1271
|
'remote_ip_prefix',
|
|
1272
|
+
'revision_number',
|
|
1283
1273
|
'security_group_id',
|
|
1274
|
+
'updated_at',
|
|
1284
1275
|
)
|
|
1285
1276
|
|
|
1286
1277
|
data = (
|
|
1278
|
+
_security_group_rule.created_at,
|
|
1287
1279
|
_security_group_rule.description,
|
|
1288
1280
|
_security_group_rule.direction,
|
|
1289
1281
|
_security_group_rule.ether_type,
|
|
@@ -1295,7 +1287,9 @@ class TestShowSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork):
|
|
|
1295
1287
|
_security_group_rule.remote_address_group_id,
|
|
1296
1288
|
_security_group_rule.remote_group_id,
|
|
1297
1289
|
_security_group_rule.remote_ip_prefix,
|
|
1290
|
+
_security_group_rule.revision_number,
|
|
1298
1291
|
_security_group_rule.security_group_id,
|
|
1292
|
+
_security_group_rule.updated_at,
|
|
1299
1293
|
)
|
|
1300
1294
|
|
|
1301
1295
|
def setUp(self):
|
|
@@ -252,9 +252,10 @@ class TestObjectSave(TestObjectAll):
|
|
|
252
252
|
def __exit__(self, *a):
|
|
253
253
|
self.context_manager_calls.append('__exit__')
|
|
254
254
|
|
|
255
|
-
with
|
|
256
|
-
'
|
|
257
|
-
|
|
255
|
+
with (
|
|
256
|
+
mock.patch('sys.stdout') as fake_stdout,
|
|
257
|
+
mock.patch('os.fdopen', return_value=FakeStdout()) as fake_fdopen,
|
|
258
|
+
):
|
|
258
259
|
fake_stdout.fileno.return_value = 123
|
|
259
260
|
self.cmd.take_action(parsed_args)
|
|
260
261
|
|
|
@@ -183,14 +183,14 @@ class TestShell(osc_lib_test_utils.TestShell):
|
|
|
183
183
|
osc_lib_test_utils.fake_execute(_shell, _cmd)
|
|
184
184
|
|
|
185
185
|
self.app.assert_called_with(["list", "role"])
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
186
|
+
|
|
187
|
+
if default_args.get('token'):
|
|
188
|
+
self.assertEqual(default_args['token'], _shell.options.token)
|
|
189
|
+
|
|
190
|
+
if default_args.get('auth_url'):
|
|
191
|
+
self.assertEqual(
|
|
192
|
+
default_args['auth_url'], _shell.options.auth_url
|
|
193
|
+
)
|
|
194
194
|
|
|
195
195
|
def _assert_cli(self, cmd_options, default_args):
|
|
196
196
|
with mock.patch(
|
|
@@ -204,25 +204,28 @@ class TestShell(osc_lib_test_utils.TestShell):
|
|
|
204
204
|
osc_lib_test_utils.fake_execute(_shell, _cmd)
|
|
205
205
|
|
|
206
206
|
self.app.assert_called_with(["list", "server"])
|
|
207
|
+
|
|
208
|
+
# TODO(stephenfin): Remove "or ''" when we bump osc-lib minimum to
|
|
209
|
+
# a version that includes I1d26133c9d9ed299d1035f207059aa8fe463a001
|
|
207
210
|
self.assertEqual(
|
|
208
211
|
default_args["compute_api_version"],
|
|
209
|
-
_shell.options.os_compute_api_version,
|
|
212
|
+
_shell.options.os_compute_api_version or '',
|
|
210
213
|
)
|
|
211
214
|
self.assertEqual(
|
|
212
215
|
default_args["identity_api_version"],
|
|
213
|
-
_shell.options.os_identity_api_version,
|
|
216
|
+
_shell.options.os_identity_api_version or '',
|
|
214
217
|
)
|
|
215
218
|
self.assertEqual(
|
|
216
219
|
default_args["image_api_version"],
|
|
217
|
-
_shell.options.os_image_api_version,
|
|
220
|
+
_shell.options.os_image_api_version or '',
|
|
218
221
|
)
|
|
219
222
|
self.assertEqual(
|
|
220
223
|
default_args["volume_api_version"],
|
|
221
|
-
_shell.options.os_volume_api_version,
|
|
224
|
+
_shell.options.os_volume_api_version or '',
|
|
222
225
|
)
|
|
223
226
|
self.assertEqual(
|
|
224
227
|
default_args["network_api_version"],
|
|
225
|
-
_shell.options.os_network_api_version,
|
|
228
|
+
_shell.options.os_network_api_version or '',
|
|
226
229
|
)
|
|
227
230
|
|
|
228
231
|
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
|
|
15
15
|
import copy
|
|
16
16
|
import random
|
|
17
|
-
import typing as ty
|
|
18
17
|
from unittest import mock
|
|
19
18
|
import uuid
|
|
20
19
|
|
|
@@ -92,7 +91,7 @@ class FakeClientMixin:
|
|
|
92
91
|
self.volume_sdk_client = self.app.client_manager.sdk_connection.volume
|
|
93
92
|
self.set_volume_api_version() # default to the lowest
|
|
94
93
|
|
|
95
|
-
def set_volume_api_version(self, version:
|
|
94
|
+
def set_volume_api_version(self, version: str | None = None):
|
|
96
95
|
"""Set a fake block storage API version.
|
|
97
96
|
|
|
98
97
|
:param version: The fake microversion to "support". This must be None
|