python-openstackclient 7.1.2__py3-none-any.whl → 7.2.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/api/api.py +2 -1
- openstackclient/api/image_v2.py +1 -1
- openstackclient/api/object_store_v1.py +12 -20
- openstackclient/common/clientmanager.py +1 -1
- openstackclient/common/module.py +2 -2
- openstackclient/common/quota.py +4 -4
- openstackclient/compute/v2/flavor.py +1 -1
- openstackclient/compute/v2/server.py +123 -60
- openstackclient/compute/v2/server_backup.py +1 -1
- openstackclient/compute/v2/server_image.py +1 -1
- openstackclient/compute/v2/server_migration.py +11 -2
- openstackclient/compute/v2/usage.py +3 -3
- openstackclient/identity/common.py +4 -1
- openstackclient/identity/v2_0/project.py +1 -1
- openstackclient/identity/v2_0/role_assignment.py +1 -1
- openstackclient/identity/v2_0/user.py +2 -2
- openstackclient/identity/v3/access_rule.py +26 -14
- openstackclient/identity/v3/identity_provider.py +1 -1
- openstackclient/identity/v3/project.py +1 -1
- openstackclient/identity/v3/role_assignment.py +24 -3
- openstackclient/identity/v3/service.py +2 -1
- openstackclient/identity/v3/user.py +35 -15
- openstackclient/image/v2/image.py +13 -13
- openstackclient/image/v2/metadef_objects.py +6 -4
- openstackclient/network/common.py +8 -7
- openstackclient/network/v2/floating_ip.py +6 -2
- openstackclient/network/v2/floating_ip_port_forwarding.py +2 -2
- openstackclient/network/v2/l3_conntrack_helper.py +1 -1
- openstackclient/network/v2/ndp_proxy.py +1 -0
- openstackclient/network/v2/network_agent.py +2 -6
- openstackclient/network/v2/network_qos_rule.py +2 -5
- openstackclient/network/v2/network_trunk.py +5 -4
- openstackclient/network/v2/port.py +18 -3
- openstackclient/network/v2/router.py +7 -4
- openstackclient/network/v2/subnet_pool.py +2 -2
- openstackclient/shell.py +3 -2
- openstackclient/tests/functional/common/test_help.py +3 -9
- openstackclient/tests/functional/common/test_module.py +1 -1
- openstackclient/tests/functional/common/test_quota.py +2 -4
- openstackclient/tests/functional/compute/v2/common.py +1 -3
- openstackclient/tests/functional/compute/v2/test_hypervisor.py +3 -3
- openstackclient/tests/functional/compute/v2/test_keypair.py +2 -2
- openstackclient/tests/functional/compute/v2/test_server.py +1 -1
- openstackclient/tests/functional/identity/v2/common.py +31 -48
- openstackclient/tests/functional/identity/v2/test_catalog.py +1 -1
- openstackclient/tests/functional/identity/v2/test_ec2_credentials.py +2 -2
- openstackclient/tests/functional/identity/v2/test_endpoint.py +2 -2
- openstackclient/tests/functional/identity/v2/test_project.py +8 -8
- openstackclient/tests/functional/identity/v2/test_role.py +14 -34
- openstackclient/tests/functional/identity/v2/test_service.py +2 -2
- openstackclient/tests/functional/identity/v2/test_token.py +1 -1
- openstackclient/tests/functional/identity/v2/test_user.py +7 -9
- openstackclient/tests/functional/identity/v3/common.py +69 -110
- openstackclient/tests/functional/identity/v3/test_access_rule.py +86 -0
- openstackclient/tests/functional/identity/v3/test_application_credential.py +18 -44
- openstackclient/tests/functional/identity/v3/test_catalog.py +1 -1
- openstackclient/tests/functional/identity/v3/test_domain.py +9 -11
- openstackclient/tests/functional/identity/v3/test_endpoint.py +15 -27
- openstackclient/tests/functional/identity/v3/test_group.py +32 -93
- openstackclient/tests/functional/identity/v3/test_idp.py +3 -3
- openstackclient/tests/functional/identity/v3/test_limit.py +32 -32
- openstackclient/tests/functional/identity/v3/test_project.py +17 -26
- openstackclient/tests/functional/identity/v3/test_region.py +6 -7
- openstackclient/tests/functional/identity/v3/test_registered_limit.py +27 -36
- openstackclient/tests/functional/identity/v3/test_role.py +30 -60
- openstackclient/tests/functional/identity/v3/test_role_assignment.py +33 -80
- openstackclient/tests/functional/identity/v3/test_service.py +7 -13
- openstackclient/tests/functional/identity/v3/test_service_provider.py +3 -3
- openstackclient/tests/functional/identity/v3/test_user.py +17 -34
- openstackclient/tests/functional/image/v2/test_image.py +1 -3
- openstackclient/tests/functional/network/v2/common.py +1 -3
- openstackclient/tests/functional/network/v2/test_default_security_group_rule.py +3 -8
- openstackclient/tests/functional/network/v2/test_l3_conntrack_helper.py +27 -31
- openstackclient/tests/functional/network/v2/test_network.py +9 -12
- openstackclient/tests/functional/network/v2/test_network_agent.py +15 -20
- openstackclient/tests/functional/network/v2/test_network_flavor.py +2 -2
- openstackclient/tests/functional/network/v2/test_network_ndp_proxy.py +17 -39
- openstackclient/tests/functional/network/v2/test_network_qos_rule.py +48 -63
- openstackclient/tests/functional/network/v2/test_network_qos_rule_type.py +1 -1
- openstackclient/tests/functional/network/v2/test_network_segment_range.py +2 -2
- openstackclient/tests/functional/network/v2/test_network_trunk.py +15 -25
- openstackclient/tests/functional/network/v2/test_port.py +28 -34
- openstackclient/tests/functional/network/v2/test_router.py +13 -19
- openstackclient/tests/functional/object/v1/test_object.py +4 -7
- openstackclient/tests/functional/volume/base.py +5 -17
- openstackclient/tests/functional/volume/v1/test_volume_type.py +11 -11
- openstackclient/tests/functional/volume/v2/test_volume_backup.py +1 -1
- openstackclient/tests/functional/volume/v2/test_volume_type.py +13 -15
- openstackclient/tests/functional/volume/v3/test_volume_type.py +13 -15
- openstackclient/tests/unit/api/test_compute_v2.py +0 -5
- openstackclient/tests/unit/api/test_object_store_v1.py +6 -4
- openstackclient/tests/unit/common/test_extension.py +24 -31
- openstackclient/tests/unit/compute/v2/test_host.py +0 -1
- openstackclient/tests/unit/compute/v2/test_server.py +124 -116
- openstackclient/tests/unit/identity/v3/test_access_rule.py +65 -64
- openstackclient/tests/unit/identity/v3/test_group.py +4 -10
- openstackclient/tests/unit/identity/v3/test_limit.py +2 -2
- openstackclient/tests/unit/identity/v3/test_service.py +0 -3
- openstackclient/tests/unit/identity/v3/test_user.py +4 -90
- openstackclient/tests/unit/image/v2/test_metadef_objects.py +1 -2
- openstackclient/tests/unit/image/v2/test_metadef_resource_type_association.py +2 -6
- openstackclient/tests/unit/integ/base.py +1 -1
- openstackclient/tests/unit/network/v2/test_default_security_group_rule.py +3 -3
- openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +4 -4
- openstackclient/tests/unit/network/v2/test_local_ip_association.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +12 -13
- openstackclient/tests/unit/network/v2/test_network_trunk.py +31 -35
- openstackclient/tests/unit/network/v2/test_port.py +40 -17
- openstackclient/tests/unit/network/v2/test_subnet_pool.py +1 -1
- openstackclient/tests/unit/object/v1/test_object.py +1 -1
- openstackclient/tests/unit/utils.py +2 -2
- openstackclient/volume/client.py +1 -1
- openstackclient/volume/v1/volume.py +2 -2
- openstackclient/volume/v1/volume_backup.py +2 -2
- openstackclient/volume/v1/volume_snapshot.py +2 -2
- openstackclient/volume/v2/volume.py +2 -2
- openstackclient/volume/v2/volume_backup.py +2 -2
- openstackclient/volume/v2/volume_snapshot.py +2 -2
- openstackclient/volume/v2/volume_type.py +4 -4
- openstackclient/volume/v3/service.py +0 -1
- openstackclient/volume/v3/volume.py +3 -3
- openstackclient/volume/v3/volume_backup.py +2 -2
- openstackclient/volume/v3/volume_group.py +3 -7
- openstackclient/volume/v3/volume_type.py +6 -6
- {python_openstackclient-7.1.2.dist-info → python_openstackclient-7.2.0.dist-info}/AUTHORS +3 -0
- {python_openstackclient-7.1.2.dist-info → python_openstackclient-7.2.0.dist-info}/METADATA +2 -3
- {python_openstackclient-7.1.2.dist-info → python_openstackclient-7.2.0.dist-info}/RECORD +132 -131
- python_openstackclient-7.2.0.dist-info/pbr.json +1 -0
- python_openstackclient-7.1.2.dist-info/pbr.json +0 -1
- {python_openstackclient-7.1.2.dist-info → python_openstackclient-7.2.0.dist-info}/LICENSE +0 -0
- {python_openstackclient-7.1.2.dist-info → python_openstackclient-7.2.0.dist-info}/WHEEL +0 -0
- {python_openstackclient-7.1.2.dist-info → python_openstackclient-7.2.0.dist-info}/entry_points.txt +0 -0
- {python_openstackclient-7.1.2.dist-info → python_openstackclient-7.2.0.dist-info}/top_level.txt +0 -0
|
@@ -13,72 +13,66 @@
|
|
|
13
13
|
# under the License.
|
|
14
14
|
#
|
|
15
15
|
|
|
16
|
-
import
|
|
16
|
+
from unittest.mock import call
|
|
17
17
|
|
|
18
|
-
from
|
|
18
|
+
from openstack import exceptions as sdk_exceptions
|
|
19
|
+
from openstack.identity.v3 import access_rule as _access_rule
|
|
20
|
+
from openstack.test import fakes as sdk_fakes
|
|
19
21
|
from osc_lib import exceptions
|
|
20
22
|
|
|
21
23
|
from openstackclient.identity.v3 import access_rule
|
|
22
|
-
from openstackclient.tests.unit import fakes
|
|
23
24
|
from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes
|
|
24
25
|
|
|
25
26
|
|
|
26
|
-
class
|
|
27
|
-
|
|
28
|
-
super().setUp()
|
|
29
|
-
|
|
30
|
-
identity_manager = self.identity_client
|
|
31
|
-
self.access_rules_mock = identity_manager.access_rules
|
|
32
|
-
self.access_rules_mock.reset_mock()
|
|
33
|
-
self.roles_mock = identity_manager.roles
|
|
34
|
-
self.roles_mock.reset_mock()
|
|
27
|
+
class TestAccessRuleDelete(identity_fakes.TestIdentityv3):
|
|
28
|
+
access_rule = sdk_fakes.generate_fake_resource(_access_rule.AccessRule)
|
|
35
29
|
|
|
36
|
-
|
|
37
|
-
class TestAccessRuleDelete(TestAccessRule):
|
|
38
30
|
def setUp(self):
|
|
39
31
|
super().setUp()
|
|
40
32
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
None,
|
|
44
|
-
copy.deepcopy(identity_fakes.ACCESS_RULE),
|
|
45
|
-
loaded=True,
|
|
33
|
+
self.identity_sdk_client.get_access_rule.return_value = (
|
|
34
|
+
self.access_rule
|
|
46
35
|
)
|
|
47
|
-
self.
|
|
36
|
+
self.identity_sdk_client.delete_access_rule.return_value = None
|
|
48
37
|
|
|
49
38
|
# Get the command object to test
|
|
50
39
|
self.cmd = access_rule.DeleteAccessRule(self.app, None)
|
|
51
40
|
|
|
52
41
|
def test_access_rule_delete(self):
|
|
53
|
-
arglist = [
|
|
54
|
-
|
|
55
|
-
]
|
|
56
|
-
verifylist = [('access_rule', [identity_fakes.access_rule_id])]
|
|
42
|
+
arglist = [self.access_rule.id]
|
|
43
|
+
verifylist = [('access_rule', [self.access_rule.id])]
|
|
57
44
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
58
45
|
|
|
46
|
+
conn = self.app.client_manager.sdk_connection
|
|
47
|
+
user_id = conn.config.get_auth().get_user_id(conn.identity)
|
|
48
|
+
|
|
59
49
|
result = self.cmd.take_action(parsed_args)
|
|
60
50
|
|
|
61
|
-
self.
|
|
62
|
-
|
|
51
|
+
self.identity_sdk_client.delete_access_rule.assert_called_with(
|
|
52
|
+
user_id,
|
|
53
|
+
self.access_rule.id,
|
|
63
54
|
)
|
|
64
55
|
self.assertIsNone(result)
|
|
65
56
|
|
|
66
57
|
def test_delete_multi_access_rules_with_exception(self):
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
mock_get.return_value,
|
|
71
|
-
identity_exc.NotFound,
|
|
58
|
+
self.identity_sdk_client.get_access_rule.side_effect = [
|
|
59
|
+
self.access_rule,
|
|
60
|
+
sdk_exceptions.NotFoundException,
|
|
72
61
|
]
|
|
62
|
+
|
|
73
63
|
arglist = [
|
|
74
|
-
|
|
64
|
+
self.access_rule.id,
|
|
75
65
|
'nonexistent_access_rule',
|
|
76
66
|
]
|
|
77
67
|
verifylist = [
|
|
78
68
|
('access_rule', arglist),
|
|
79
69
|
]
|
|
70
|
+
|
|
80
71
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
81
72
|
|
|
73
|
+
conn = self.app.client_manager.sdk_connection
|
|
74
|
+
user_id = conn.config.get_auth().get_user_id(conn.identity)
|
|
75
|
+
|
|
82
76
|
try:
|
|
83
77
|
self.cmd.take_action(parsed_args)
|
|
84
78
|
self.fail('CommandError should be raised.')
|
|
@@ -87,26 +81,27 @@ class TestAccessRuleDelete(TestAccessRule):
|
|
|
87
81
|
'1 of 2 access rules failed to' ' delete.', str(e)
|
|
88
82
|
)
|
|
89
83
|
|
|
90
|
-
|
|
91
|
-
|
|
84
|
+
calls = []
|
|
85
|
+
for a in arglist:
|
|
86
|
+
calls.append(call(user_id, a))
|
|
87
|
+
|
|
88
|
+
self.identity_sdk_client.get_access_rule.assert_has_calls(calls)
|
|
92
89
|
|
|
93
|
-
self.assertEqual(
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
self.assertEqual(
|
|
91
|
+
2, self.identity_sdk_client.get_access_rule.call_count
|
|
92
|
+
)
|
|
93
|
+
self.identity_sdk_client.delete_access_rule.assert_called_once_with(
|
|
94
|
+
user_id, self.access_rule.id
|
|
96
95
|
)
|
|
97
96
|
|
|
98
97
|
|
|
99
|
-
class TestAccessRuleList(
|
|
98
|
+
class TestAccessRuleList(identity_fakes.TestIdentityv3):
|
|
99
|
+
access_rule = sdk_fakes.generate_fake_resource(_access_rule.AccessRule)
|
|
100
|
+
|
|
100
101
|
def setUp(self):
|
|
101
102
|
super().setUp()
|
|
102
103
|
|
|
103
|
-
self.
|
|
104
|
-
fakes.FakeResource(
|
|
105
|
-
None,
|
|
106
|
-
copy.deepcopy(identity_fakes.ACCESS_RULE),
|
|
107
|
-
loaded=True,
|
|
108
|
-
),
|
|
109
|
-
]
|
|
104
|
+
self.identity_sdk_client.access_rules.return_value = [self.access_rule]
|
|
110
105
|
|
|
111
106
|
# Get the command object to test
|
|
112
107
|
self.cmd = access_rule.ListAccessRule(self.app, None)
|
|
@@ -116,31 +111,34 @@ class TestAccessRuleList(TestAccessRule):
|
|
|
116
111
|
verifylist = []
|
|
117
112
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
118
113
|
|
|
114
|
+
conn = self.app.client_manager.sdk_connection
|
|
115
|
+
user_id = conn.config.get_auth().get_user_id(conn.identity)
|
|
116
|
+
|
|
119
117
|
columns, data = self.cmd.take_action(parsed_args)
|
|
120
118
|
|
|
121
|
-
self.
|
|
119
|
+
self.identity_sdk_client.access_rules.assert_called_with(user=user_id)
|
|
122
120
|
|
|
123
121
|
collist = ('ID', 'Service', 'Method', 'Path')
|
|
124
122
|
self.assertEqual(collist, columns)
|
|
125
123
|
datalist = (
|
|
126
124
|
(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
125
|
+
self.access_rule.id,
|
|
126
|
+
self.access_rule.service,
|
|
127
|
+
self.access_rule.method,
|
|
128
|
+
self.access_rule.path,
|
|
131
129
|
),
|
|
132
130
|
)
|
|
133
131
|
self.assertEqual(datalist, tuple(data))
|
|
134
132
|
|
|
135
133
|
|
|
136
|
-
class TestAccessRuleShow(
|
|
134
|
+
class TestAccessRuleShow(identity_fakes.TestIdentityv3):
|
|
135
|
+
access_rule = sdk_fakes.generate_fake_resource(_access_rule.AccessRule)
|
|
136
|
+
|
|
137
137
|
def setUp(self):
|
|
138
138
|
super().setUp()
|
|
139
139
|
|
|
140
|
-
self.
|
|
141
|
-
|
|
142
|
-
copy.deepcopy(identity_fakes.ACCESS_RULE),
|
|
143
|
-
loaded=True,
|
|
140
|
+
self.identity_sdk_client.get_access_rule.return_value = (
|
|
141
|
+
self.access_rule
|
|
144
142
|
)
|
|
145
143
|
|
|
146
144
|
# Get the command object to test
|
|
@@ -148,25 +146,28 @@ class TestAccessRuleShow(TestAccessRule):
|
|
|
148
146
|
|
|
149
147
|
def test_access_rule_show(self):
|
|
150
148
|
arglist = [
|
|
151
|
-
|
|
149
|
+
self.access_rule.id,
|
|
152
150
|
]
|
|
153
151
|
verifylist = [
|
|
154
|
-
('access_rule',
|
|
152
|
+
('access_rule', self.access_rule.id),
|
|
155
153
|
]
|
|
156
154
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
157
155
|
|
|
156
|
+
conn = self.app.client_manager.sdk_connection
|
|
157
|
+
user_id = conn.config.get_auth().get_user_id(conn.identity)
|
|
158
|
+
|
|
158
159
|
columns, data = self.cmd.take_action(parsed_args)
|
|
159
160
|
|
|
160
|
-
self.
|
|
161
|
-
|
|
161
|
+
self.identity_sdk_client.get_access_rule.assert_called_with(
|
|
162
|
+
user_id, self.access_rule.id
|
|
162
163
|
)
|
|
163
164
|
|
|
164
|
-
collist = ('
|
|
165
|
+
collist = ('ID', 'Method', 'Path', 'Service')
|
|
165
166
|
self.assertEqual(collist, columns)
|
|
166
167
|
datalist = (
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
self.access_rule.id,
|
|
169
|
+
self.access_rule.method,
|
|
170
|
+
self.access_rule.path,
|
|
171
|
+
self.access_rule.service,
|
|
171
172
|
)
|
|
172
173
|
self.assertEqual(datalist, data)
|
|
@@ -109,12 +109,9 @@ class TestGroupAddUser(TestGroup):
|
|
|
109
109
|
self.cmd.take_action(parsed_args)
|
|
110
110
|
self.fail('CommandError should be raised.')
|
|
111
111
|
except exceptions.CommandError as e:
|
|
112
|
-
msg = "1 of 2 users not added to group
|
|
112
|
+
msg = f"1 of 2 users not added to group {self._group.name}."
|
|
113
113
|
self.assertEqual(msg, str(e))
|
|
114
|
-
msg =
|
|
115
|
-
'user': self.users[0].name,
|
|
116
|
-
'group': self._group.name,
|
|
117
|
-
}
|
|
114
|
+
msg = f"{self.users[0].name} not added to group {self._group.name}: "
|
|
118
115
|
mock_error.assert_called_once_with(msg)
|
|
119
116
|
|
|
120
117
|
|
|
@@ -561,12 +558,9 @@ class TestGroupRemoveUser(TestGroup):
|
|
|
561
558
|
self.cmd.take_action(parsed_args)
|
|
562
559
|
self.fail('CommandError should be raised.')
|
|
563
560
|
except exceptions.CommandError as e:
|
|
564
|
-
msg = "1 of 2 users not removed from group
|
|
561
|
+
msg = f"1 of 2 users not removed from group {self._group.id}."
|
|
565
562
|
self.assertEqual(msg, str(e))
|
|
566
|
-
msg =
|
|
567
|
-
'user': self.users[0].id,
|
|
568
|
-
'group': self._group.id,
|
|
569
|
-
}
|
|
563
|
+
msg = f"{self.users[0].id} not removed from group {self._group.id}: "
|
|
570
564
|
mock_error.assert_called_once_with(msg)
|
|
571
565
|
|
|
572
566
|
|
|
@@ -90,7 +90,7 @@ class TestLimitCreate(TestLimit):
|
|
|
90
90
|
self.service,
|
|
91
91
|
identity_fakes.limit_resource_name,
|
|
92
92
|
resource_limit,
|
|
93
|
-
**kwargs
|
|
93
|
+
**kwargs,
|
|
94
94
|
)
|
|
95
95
|
|
|
96
96
|
collist = (
|
|
@@ -154,7 +154,7 @@ class TestLimitCreate(TestLimit):
|
|
|
154
154
|
self.service,
|
|
155
155
|
identity_fakes.limit_resource_name,
|
|
156
156
|
resource_limit,
|
|
157
|
-
**kwargs
|
|
157
|
+
**kwargs,
|
|
158
158
|
)
|
|
159
159
|
|
|
160
160
|
collist = (
|
|
@@ -311,7 +311,6 @@ class TestServiceSet(identity_fakes.TestIdentityv3):
|
|
|
311
311
|
# Set expected values
|
|
312
312
|
kwargs = {
|
|
313
313
|
'type': self.service.type,
|
|
314
|
-
'is_enabled': None,
|
|
315
314
|
}
|
|
316
315
|
self.identity_sdk_client.update_service.assert_called_with(
|
|
317
316
|
self.service.id, **kwargs
|
|
@@ -338,7 +337,6 @@ class TestServiceSet(identity_fakes.TestIdentityv3):
|
|
|
338
337
|
# Set expected values
|
|
339
338
|
kwargs = {
|
|
340
339
|
'name': self.service.name,
|
|
341
|
-
'is_enabled': None,
|
|
342
340
|
}
|
|
343
341
|
self.identity_sdk_client.update_service.assert_called_with(
|
|
344
342
|
self.service.id, **kwargs
|
|
@@ -365,7 +363,6 @@ class TestServiceSet(identity_fakes.TestIdentityv3):
|
|
|
365
363
|
# Set expected values
|
|
366
364
|
kwargs = {
|
|
367
365
|
'description': self.service.description,
|
|
368
|
-
'is_enabled': None,
|
|
369
366
|
}
|
|
370
367
|
self.identity_sdk_client.update_service.assert_called_with(
|
|
371
368
|
self.service.id, **kwargs
|
|
@@ -91,11 +91,6 @@ class TestUserCreate(identity_fakes.TestIdentityv3):
|
|
|
91
91
|
# Set expected values
|
|
92
92
|
kwargs = {
|
|
93
93
|
'name': self.user.name,
|
|
94
|
-
'default_project_id': None,
|
|
95
|
-
'description': None,
|
|
96
|
-
'domain_id': None,
|
|
97
|
-
'email': None,
|
|
98
|
-
'options': {},
|
|
99
94
|
'is_enabled': True,
|
|
100
95
|
'password': None,
|
|
101
96
|
}
|
|
@@ -127,11 +122,6 @@ class TestUserCreate(identity_fakes.TestIdentityv3):
|
|
|
127
122
|
# Set expected values
|
|
128
123
|
kwargs = {
|
|
129
124
|
'name': self.user.name,
|
|
130
|
-
'default_project_id': None,
|
|
131
|
-
'description': None,
|
|
132
|
-
'domain_id': None,
|
|
133
|
-
'email': None,
|
|
134
|
-
'options': {},
|
|
135
125
|
'is_enabled': True,
|
|
136
126
|
'password': 'secret',
|
|
137
127
|
}
|
|
@@ -165,11 +155,6 @@ class TestUserCreate(identity_fakes.TestIdentityv3):
|
|
|
165
155
|
# Set expected values
|
|
166
156
|
kwargs = {
|
|
167
157
|
'name': self.user.name,
|
|
168
|
-
'default_project_id': None,
|
|
169
|
-
'description': None,
|
|
170
|
-
'domain_id': None,
|
|
171
|
-
'email': None,
|
|
172
|
-
'options': {},
|
|
173
158
|
'is_enabled': True,
|
|
174
159
|
'password': 'abc123',
|
|
175
160
|
}
|
|
@@ -200,12 +185,8 @@ class TestUserCreate(identity_fakes.TestIdentityv3):
|
|
|
200
185
|
# Set expected values
|
|
201
186
|
kwargs = {
|
|
202
187
|
'name': self.user.name,
|
|
203
|
-
'default_project_id': None,
|
|
204
|
-
'description': None,
|
|
205
|
-
'domain_id': None,
|
|
206
188
|
'email': 'barney@example.com',
|
|
207
189
|
'is_enabled': True,
|
|
208
|
-
'options': {},
|
|
209
190
|
'password': None,
|
|
210
191
|
}
|
|
211
192
|
self.identity_sdk_client.create_user.assert_called_with(**kwargs)
|
|
@@ -236,11 +217,7 @@ class TestUserCreate(identity_fakes.TestIdentityv3):
|
|
|
236
217
|
kwargs = {
|
|
237
218
|
'name': self.user.name,
|
|
238
219
|
'default_project_id': self.project.id,
|
|
239
|
-
'description': None,
|
|
240
|
-
'domain_id': None,
|
|
241
|
-
'email': None,
|
|
242
220
|
'is_enabled': True,
|
|
243
|
-
'options': {},
|
|
244
221
|
'password': None,
|
|
245
222
|
}
|
|
246
223
|
self.identity_sdk_client.create_user.assert_called_with(**kwargs)
|
|
@@ -284,14 +261,13 @@ class TestUserCreate(identity_fakes.TestIdentityv3):
|
|
|
284
261
|
kwargs = {
|
|
285
262
|
'name': self.user.name,
|
|
286
263
|
'default_project_id': self.project.id,
|
|
287
|
-
'description': None,
|
|
288
|
-
'domain_id': None,
|
|
289
|
-
'email': None,
|
|
290
|
-
'options': {},
|
|
291
264
|
'is_enabled': True,
|
|
292
265
|
'password': None,
|
|
293
266
|
}
|
|
294
|
-
self.identity_sdk_client.create_user.
|
|
267
|
+
self.identity_sdk_client.create_user.assert_called_once_with(**kwargs)
|
|
268
|
+
self.identity_sdk_client.find_domain.assert_called_once_with(
|
|
269
|
+
self.project.domain_id, ignore_missing=False
|
|
270
|
+
)
|
|
295
271
|
|
|
296
272
|
self.assertEqual(self.columns, columns)
|
|
297
273
|
datalist = (
|
|
@@ -328,11 +304,7 @@ class TestUserCreate(identity_fakes.TestIdentityv3):
|
|
|
328
304
|
# Set expected values
|
|
329
305
|
kwargs = {
|
|
330
306
|
'name': self.user.name,
|
|
331
|
-
'default_project_id': None,
|
|
332
|
-
'description': None,
|
|
333
307
|
'domain_id': self.domain.id,
|
|
334
|
-
'email': None,
|
|
335
|
-
'options': {},
|
|
336
308
|
'is_enabled': True,
|
|
337
309
|
'password': None,
|
|
338
310
|
}
|
|
@@ -361,11 +333,6 @@ class TestUserCreate(identity_fakes.TestIdentityv3):
|
|
|
361
333
|
# Set expected values
|
|
362
334
|
kwargs = {
|
|
363
335
|
'name': self.user.name,
|
|
364
|
-
'default_project_id': None,
|
|
365
|
-
'description': None,
|
|
366
|
-
'domain_id': None,
|
|
367
|
-
'email': None,
|
|
368
|
-
'options': {},
|
|
369
336
|
'is_enabled': True,
|
|
370
337
|
'password': None,
|
|
371
338
|
}
|
|
@@ -394,11 +361,6 @@ class TestUserCreate(identity_fakes.TestIdentityv3):
|
|
|
394
361
|
# Set expected values
|
|
395
362
|
kwargs = {
|
|
396
363
|
'name': self.user.name,
|
|
397
|
-
'default_project_id': None,
|
|
398
|
-
'description': None,
|
|
399
|
-
'domain_id': None,
|
|
400
|
-
'email': None,
|
|
401
|
-
'options': {},
|
|
402
364
|
'is_enabled': False,
|
|
403
365
|
'password': None,
|
|
404
366
|
}
|
|
@@ -428,10 +390,6 @@ class TestUserCreate(identity_fakes.TestIdentityv3):
|
|
|
428
390
|
# Set expected values
|
|
429
391
|
kwargs = {
|
|
430
392
|
'name': self.user.name,
|
|
431
|
-
'default_project_id': None,
|
|
432
|
-
'description': None,
|
|
433
|
-
'domain_id': None,
|
|
434
|
-
'email': None,
|
|
435
393
|
'is_enabled': True,
|
|
436
394
|
'options': {'ignore_lockout_failure_attempts': True},
|
|
437
395
|
'password': None,
|
|
@@ -462,10 +420,6 @@ class TestUserCreate(identity_fakes.TestIdentityv3):
|
|
|
462
420
|
# Set expected values
|
|
463
421
|
kwargs = {
|
|
464
422
|
'name': self.user.name,
|
|
465
|
-
'default_project_id': None,
|
|
466
|
-
'description': None,
|
|
467
|
-
'domain_id': None,
|
|
468
|
-
'email': None,
|
|
469
423
|
'is_enabled': True,
|
|
470
424
|
'options': {'ignore_lockout_failure_attempts': False},
|
|
471
425
|
'password': None,
|
|
@@ -496,10 +450,6 @@ class TestUserCreate(identity_fakes.TestIdentityv3):
|
|
|
496
450
|
# Set expected values
|
|
497
451
|
kwargs = {
|
|
498
452
|
'name': self.user.name,
|
|
499
|
-
'default_project_id': None,
|
|
500
|
-
'description': None,
|
|
501
|
-
'domain_id': None,
|
|
502
|
-
'email': None,
|
|
503
453
|
'is_enabled': True,
|
|
504
454
|
'options': {'ignore_password_expiry': True},
|
|
505
455
|
'password': None,
|
|
@@ -530,10 +480,6 @@ class TestUserCreate(identity_fakes.TestIdentityv3):
|
|
|
530
480
|
# Set expected values
|
|
531
481
|
kwargs = {
|
|
532
482
|
'name': self.user.name,
|
|
533
|
-
'default_project_id': None,
|
|
534
|
-
'description': None,
|
|
535
|
-
'domain_id': None,
|
|
536
|
-
'email': None,
|
|
537
483
|
'is_enabled': True,
|
|
538
484
|
'options': {'ignore_password_expiry': False},
|
|
539
485
|
'password': None,
|
|
@@ -564,10 +510,6 @@ class TestUserCreate(identity_fakes.TestIdentityv3):
|
|
|
564
510
|
# Set expected values
|
|
565
511
|
kwargs = {
|
|
566
512
|
'name': self.user.name,
|
|
567
|
-
'default_project_id': None,
|
|
568
|
-
'description': None,
|
|
569
|
-
'domain_id': None,
|
|
570
|
-
'email': None,
|
|
571
513
|
'is_enabled': True,
|
|
572
514
|
'options': {'ignore_change_password_upon_first_use': True},
|
|
573
515
|
'password': None,
|
|
@@ -598,10 +540,6 @@ class TestUserCreate(identity_fakes.TestIdentityv3):
|
|
|
598
540
|
# Set expected values
|
|
599
541
|
kwargs = {
|
|
600
542
|
'name': self.user.name,
|
|
601
|
-
'default_project_id': None,
|
|
602
|
-
'description': None,
|
|
603
|
-
'domain_id': None,
|
|
604
|
-
'email': None,
|
|
605
543
|
'is_enabled': True,
|
|
606
544
|
'options': {'ignore_change_password_upon_first_use': False},
|
|
607
545
|
'password': None,
|
|
@@ -632,10 +570,6 @@ class TestUserCreate(identity_fakes.TestIdentityv3):
|
|
|
632
570
|
# Set expected values
|
|
633
571
|
kwargs = {
|
|
634
572
|
'name': self.user.name,
|
|
635
|
-
'default_project_id': None,
|
|
636
|
-
'description': None,
|
|
637
|
-
'domain_id': None,
|
|
638
|
-
'email': None,
|
|
639
573
|
'is_enabled': True,
|
|
640
574
|
'options': {'lock_password': True},
|
|
641
575
|
'password': None,
|
|
@@ -666,10 +600,6 @@ class TestUserCreate(identity_fakes.TestIdentityv3):
|
|
|
666
600
|
# Set expected values
|
|
667
601
|
kwargs = {
|
|
668
602
|
'name': self.user.name,
|
|
669
|
-
'default_project_id': None,
|
|
670
|
-
'description': None,
|
|
671
|
-
'domain_id': None,
|
|
672
|
-
'email': None,
|
|
673
603
|
'is_enabled': True,
|
|
674
604
|
'options': {'lock_password': False},
|
|
675
605
|
'password': None,
|
|
@@ -700,10 +630,6 @@ class TestUserCreate(identity_fakes.TestIdentityv3):
|
|
|
700
630
|
# Set expected values
|
|
701
631
|
kwargs = {
|
|
702
632
|
'name': self.user.name,
|
|
703
|
-
'default_project_id': None,
|
|
704
|
-
'description': None,
|
|
705
|
-
'domain_id': None,
|
|
706
|
-
'email': None,
|
|
707
633
|
'is_enabled': True,
|
|
708
634
|
'options': {'multi_factor_auth_enabled': True},
|
|
709
635
|
'password': None,
|
|
@@ -734,10 +660,6 @@ class TestUserCreate(identity_fakes.TestIdentityv3):
|
|
|
734
660
|
# Set expected values
|
|
735
661
|
kwargs = {
|
|
736
662
|
'name': self.user.name,
|
|
737
|
-
'default_project_id': None,
|
|
738
|
-
'description': None,
|
|
739
|
-
'domain_id': None,
|
|
740
|
-
'email': None,
|
|
741
663
|
'is_enabled': True,
|
|
742
664
|
'options': {'multi_factor_auth_enabled': False},
|
|
743
665
|
'password': None,
|
|
@@ -774,10 +696,6 @@ class TestUserCreate(identity_fakes.TestIdentityv3):
|
|
|
774
696
|
# Set expected values
|
|
775
697
|
kwargs = {
|
|
776
698
|
'name': self.user.name,
|
|
777
|
-
'default_project_id': None,
|
|
778
|
-
'description': None,
|
|
779
|
-
'domain_id': None,
|
|
780
|
-
'email': None,
|
|
781
699
|
'is_enabled': True,
|
|
782
700
|
'options': {
|
|
783
701
|
'multi_factor_auth_rules': [["password", "totp"], ["password"]]
|
|
@@ -815,10 +733,6 @@ class TestUserCreate(identity_fakes.TestIdentityv3):
|
|
|
815
733
|
# Set expected values
|
|
816
734
|
kwargs = {
|
|
817
735
|
'name': self.user.name,
|
|
818
|
-
'default_project_id': None,
|
|
819
|
-
'description': None,
|
|
820
|
-
'domain_id': None,
|
|
821
|
-
'email': None,
|
|
822
736
|
'is_enabled': True,
|
|
823
737
|
'options': {
|
|
824
738
|
'ignore_password_expiry': True,
|
|
@@ -256,7 +256,6 @@ class TestMetadefObjectPropertyShow(fakes.TestImagev2):
|
|
|
256
256
|
parsed_args,
|
|
257
257
|
)
|
|
258
258
|
self.assertIn(
|
|
259
|
-
'Property
|
|
260
|
-
% (parsed_args.property, parsed_args.object),
|
|
259
|
+
f'Property {parsed_args.property} not found in object {parsed_args.object}.',
|
|
261
260
|
str(exc),
|
|
262
261
|
)
|
|
@@ -42,9 +42,7 @@ class TestMetadefResourceTypeAssociationCreate(
|
|
|
42
42
|
def setUp(self):
|
|
43
43
|
super().setUp()
|
|
44
44
|
|
|
45
|
-
self.image_client.create_metadef_resource_type_association.return_value =
|
|
46
|
-
self.resource_type_association
|
|
47
|
-
)
|
|
45
|
+
self.image_client.create_metadef_resource_type_association.return_value = self.resource_type_association
|
|
48
46
|
self.cmd = metadef_resource_type_association.CreateMetadefResourceTypeAssociation(
|
|
49
47
|
self.app, None
|
|
50
48
|
)
|
|
@@ -74,9 +72,7 @@ class TestMetadefResourceTypeAssociationDelete(
|
|
|
74
72
|
def setUp(self):
|
|
75
73
|
super().setUp()
|
|
76
74
|
|
|
77
|
-
self.image_client.delete_metadef_resource_type_association.return_value =
|
|
78
|
-
self.resource_type_association
|
|
79
|
-
)
|
|
75
|
+
self.image_client.delete_metadef_resource_type_association.return_value = self.resource_type_association
|
|
80
76
|
self.cmd = metadef_resource_type_association.DeleteMetadefResourceTypeAssociation(
|
|
81
77
|
self.app, None
|
|
82
78
|
)
|
|
@@ -79,7 +79,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
79
79
|
default_security_group_rule_attrs.update(attrs)
|
|
80
80
|
self._default_sg_rule = sdk_fakes.generate_fake_resource(
|
|
81
81
|
_default_security_group_rule.DefaultSecurityGroupRule,
|
|
82
|
-
**default_security_group_rule_attrs
|
|
82
|
+
**default_security_group_rule_attrs,
|
|
83
83
|
)
|
|
84
84
|
|
|
85
85
|
self.sdk_client.create_default_security_group_rule.return_value = (
|
|
@@ -956,11 +956,11 @@ class TestListDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
956
956
|
# The security group rule to be listed.
|
|
957
957
|
_default_sg_rule_tcp = sdk_fakes.generate_fake_resource(
|
|
958
958
|
_default_security_group_rule.DefaultSecurityGroupRule,
|
|
959
|
-
**{'protocol': 'tcp', 'port_range_max': 80, 'port_range_min': 80}
|
|
959
|
+
**{'protocol': 'tcp', 'port_range_max': 80, 'port_range_min': 80},
|
|
960
960
|
)
|
|
961
961
|
_default_sg_rule_icmp = sdk_fakes.generate_fake_resource(
|
|
962
962
|
_default_security_group_rule.DefaultSecurityGroupRule,
|
|
963
|
-
**{'protocol': 'icmp', 'remote_ip_prefix': '10.0.2.0/24'}
|
|
963
|
+
**{'protocol': 'icmp', 'remote_ip_prefix': '10.0.2.0/24'},
|
|
964
964
|
)
|
|
965
965
|
_default_sg_rules = [
|
|
966
966
|
_default_sg_rule_tcp,
|
|
@@ -153,7 +153,7 @@ class TestCreateFloatingIPPortForwarding(TestFloatingIPPortForwarding):
|
|
|
153
153
|
'internal_port_id': self.new_port_forwarding_with_ranges.internal_port_id, # noqa: E501
|
|
154
154
|
'protocol': self.new_port_forwarding_with_ranges.protocol,
|
|
155
155
|
'description': self.new_port_forwarding_with_ranges.description, # noqa: E501
|
|
156
|
-
}
|
|
156
|
+
},
|
|
157
157
|
)
|
|
158
158
|
self.assertEqual(self.columns, columns)
|
|
159
159
|
self.assertEqual(self.data, data)
|
|
@@ -334,7 +334,7 @@ class TestCreateFloatingIPPortForwarding(TestFloatingIPPortForwarding):
|
|
|
334
334
|
'internal_port_id': self.new_port_forwarding.internal_port_id,
|
|
335
335
|
'protocol': self.new_port_forwarding.protocol,
|
|
336
336
|
'description': self.new_port_forwarding.description,
|
|
337
|
-
}
|
|
337
|
+
},
|
|
338
338
|
)
|
|
339
339
|
self.assertEqual(self.columns, columns)
|
|
340
340
|
self.assertEqual(self.data, data)
|
|
@@ -587,7 +587,7 @@ class TestSetFloatingIPPortForwarding(TestFloatingIPPortForwarding):
|
|
|
587
587
|
self.network_client.update_floating_ip_port_forwarding.assert_called_with(
|
|
588
588
|
self._port_forwarding.floatingip_id,
|
|
589
589
|
self._port_forwarding.id,
|
|
590
|
-
**attrs
|
|
590
|
+
**attrs,
|
|
591
591
|
)
|
|
592
592
|
self.assertIsNone(result)
|
|
593
593
|
|
|
@@ -648,7 +648,7 @@ class TestSetFloatingIPPortForwarding(TestFloatingIPPortForwarding):
|
|
|
648
648
|
self.network_client.update_floating_ip_port_forwarding.assert_called_with(
|
|
649
649
|
self._port_forwarding.floatingip_id,
|
|
650
650
|
self._port_forwarding.id,
|
|
651
|
-
**attrs
|
|
651
|
+
**attrs,
|
|
652
652
|
)
|
|
653
653
|
self.assertIsNone(result)
|
|
654
654
|
|
|
@@ -86,7 +86,7 @@ class TestCreateLocalIPAssociation(TestLocalIPAssociation):
|
|
|
86
86
|
self.new_local_ip_association.local_ip_id,
|
|
87
87
|
**{
|
|
88
88
|
'fixed_port_id': self.new_local_ip_association.fixed_port_id,
|
|
89
|
-
}
|
|
89
|
+
},
|
|
90
90
|
)
|
|
91
91
|
self.assertEqual(set(self.columns), set(columns))
|
|
92
92
|
self.assertEqual(set(self.data), set(data))
|
|
@@ -111,7 +111,7 @@ class TestCreateLocalIPAssociation(TestLocalIPAssociation):
|
|
|
111
111
|
**{
|
|
112
112
|
'fixed_port_id': self.new_local_ip_association.fixed_port_id,
|
|
113
113
|
'fixed_ip': self.new_local_ip_association.fixed_ip,
|
|
114
|
-
}
|
|
114
|
+
},
|
|
115
115
|
)
|
|
116
116
|
self.assertEqual(set(self.columns), set(columns))
|
|
117
117
|
self.assertEqual(set(self.data), set(data))
|