python-openstackclient 7.1.3__py3-none-any.whl → 7.2.1__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 +7 -2
- openstackclient/common/module.py +2 -2
- openstackclient/common/quota.py +4 -4
- openstackclient/compute/v2/flavor.py +1 -1
- openstackclient/compute/v2/server.py +122 -59
- 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 +1 -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/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 +123 -115
- 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/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.3.dist-info → python_openstackclient-7.2.1.dist-info}/AUTHORS +3 -0
- {python_openstackclient-7.1.3.dist-info → python_openstackclient-7.2.1.dist-info}/METADATA +2 -3
- {python_openstackclient-7.1.3.dist-info → python_openstackclient-7.2.1.dist-info}/RECORD +127 -126
- python_openstackclient-7.2.1.dist-info/pbr.json +1 -0
- python_openstackclient-7.1.3.dist-info/pbr.json +0 -1
- {python_openstackclient-7.1.3.dist-info → python_openstackclient-7.2.1.dist-info}/LICENSE +0 -0
- {python_openstackclient-7.1.3.dist-info → python_openstackclient-7.2.1.dist-info}/WHEEL +0 -0
- {python_openstackclient-7.1.3.dist-info → python_openstackclient-7.2.1.dist-info}/entry_points.txt +0 -0
- {python_openstackclient-7.1.3.dist-info → python_openstackclient-7.2.1.dist-info}/top_level.txt +0 -0
|
@@ -67,13 +67,9 @@ class IdentityTests(base.TestCase):
|
|
|
67
67
|
cls.openstack(
|
|
68
68
|
'--os-identity-api-version 2 '
|
|
69
69
|
'project create '
|
|
70
|
-
'--description
|
|
70
|
+
f'--description {cls.project_description} '
|
|
71
71
|
'--enable '
|
|
72
|
-
'
|
|
73
|
-
% {
|
|
74
|
-
'description': cls.project_description,
|
|
75
|
-
'name': cls.project_name,
|
|
76
|
-
}
|
|
72
|
+
f'{cls.project_name}'
|
|
77
73
|
)
|
|
78
74
|
except tempest_exceptions.CommandFailed:
|
|
79
75
|
# Good chance this is due to Identity v2 admin not being enabled
|
|
@@ -87,7 +83,7 @@ class IdentityTests(base.TestCase):
|
|
|
87
83
|
try:
|
|
88
84
|
cls.openstack(
|
|
89
85
|
'--os-identity-api-version 2 '
|
|
90
|
-
'project delete
|
|
86
|
+
f'project delete {cls.project_name}'
|
|
91
87
|
)
|
|
92
88
|
finally:
|
|
93
89
|
super().tearDownClass()
|
|
@@ -111,14 +107,13 @@ class IdentityTests(base.TestCase):
|
|
|
111
107
|
project_description = data_utils.rand_name('description')
|
|
112
108
|
raw_output = self.openstack(
|
|
113
109
|
'project create '
|
|
114
|
-
'--description
|
|
115
|
-
'--enable
|
|
116
|
-
% {'description': project_description, 'name': project_name}
|
|
110
|
+
f'--description {project_description} '
|
|
111
|
+
f'--enable {project_name}'
|
|
117
112
|
)
|
|
118
113
|
project = self.parse_show_as_object(raw_output)
|
|
119
114
|
if add_clean_up:
|
|
120
115
|
self.addCleanup(
|
|
121
|
-
self.openstack, 'project delete
|
|
116
|
+
self.openstack, 'project delete {}'.format(project['id'])
|
|
122
117
|
)
|
|
123
118
|
items = self.parse_show(raw_output)
|
|
124
119
|
self.assert_show_fields(items, self.PROJECT_FIELDS)
|
|
@@ -130,22 +125,18 @@ class IdentityTests(base.TestCase):
|
|
|
130
125
|
email = data_utils.rand_name() + '@example.com'
|
|
131
126
|
raw_output = self.openstack(
|
|
132
127
|
'user create '
|
|
133
|
-
'--project
|
|
134
|
-
'--password
|
|
135
|
-
'--email
|
|
128
|
+
f'--project {self.project_name} '
|
|
129
|
+
f'--password {password} '
|
|
130
|
+
f'--email {email} '
|
|
136
131
|
'--enable '
|
|
137
|
-
'
|
|
138
|
-
% {
|
|
139
|
-
'project': self.project_name,
|
|
140
|
-
'email': email,
|
|
141
|
-
'password': password,
|
|
142
|
-
'name': username,
|
|
143
|
-
}
|
|
132
|
+
f'{username}'
|
|
144
133
|
)
|
|
145
134
|
if add_clean_up:
|
|
146
135
|
self.addCleanup(
|
|
147
136
|
self.openstack,
|
|
148
|
-
'user delete
|
|
137
|
+
'user delete {}'.format(
|
|
138
|
+
self.parse_show_as_object(raw_output)['id']
|
|
139
|
+
),
|
|
149
140
|
)
|
|
150
141
|
items = self.parse_show(raw_output)
|
|
151
142
|
self.assert_show_fields(items, self.USER_FIELDS)
|
|
@@ -153,10 +144,12 @@ class IdentityTests(base.TestCase):
|
|
|
153
144
|
|
|
154
145
|
def _create_dummy_role(self, add_clean_up=True):
|
|
155
146
|
role_name = data_utils.rand_name('TestRole')
|
|
156
|
-
raw_output = self.openstack('role create
|
|
147
|
+
raw_output = self.openstack(f'role create {role_name}')
|
|
157
148
|
role = self.parse_show_as_object(raw_output)
|
|
158
149
|
if add_clean_up:
|
|
159
|
-
self.addCleanup(
|
|
150
|
+
self.addCleanup(
|
|
151
|
+
self.openstack, 'role delete {}'.format(role['id'])
|
|
152
|
+
)
|
|
160
153
|
items = self.parse_show(raw_output)
|
|
161
154
|
self.assert_show_fields(items, self.ROLE_FIELDS)
|
|
162
155
|
self.assertEqual(role_name, role['name'])
|
|
@@ -168,7 +161,7 @@ class IdentityTests(base.TestCase):
|
|
|
168
161
|
access_key = ec2_credentials['access']
|
|
169
162
|
if add_clean_up:
|
|
170
163
|
self.addCleanup(
|
|
171
|
-
self.openstack, 'ec2 credentials delete
|
|
164
|
+
self.openstack, f'ec2 credentials delete {access_key}'
|
|
172
165
|
)
|
|
173
166
|
items = self.parse_show(raw_output)
|
|
174
167
|
self.assert_show_fields(items, self.EC2_CREDENTIALS_FIELDS)
|
|
@@ -178,7 +171,9 @@ class IdentityTests(base.TestCase):
|
|
|
178
171
|
raw_output = self.openstack('token issue')
|
|
179
172
|
token = self.parse_show_as_object(raw_output)
|
|
180
173
|
if add_clean_up:
|
|
181
|
-
self.addCleanup(
|
|
174
|
+
self.addCleanup(
|
|
175
|
+
self.openstack, 'token revoke {}'.format(token['id'])
|
|
176
|
+
)
|
|
182
177
|
items = self.parse_show(raw_output)
|
|
183
178
|
self.assert_show_fields(items, self.TOKEN_FIELDS)
|
|
184
179
|
return token['id']
|
|
@@ -189,19 +184,14 @@ class IdentityTests(base.TestCase):
|
|
|
189
184
|
type_name = data_utils.rand_name('TestType')
|
|
190
185
|
raw_output = self.openstack(
|
|
191
186
|
'service create '
|
|
192
|
-
'--name
|
|
193
|
-
'--description
|
|
194
|
-
'
|
|
195
|
-
% {
|
|
196
|
-
'name': service_name,
|
|
197
|
-
'description': description,
|
|
198
|
-
'type': type_name,
|
|
199
|
-
}
|
|
187
|
+
f'--name {service_name} '
|
|
188
|
+
f'--description {description} '
|
|
189
|
+
f'{type_name}'
|
|
200
190
|
)
|
|
201
191
|
if add_clean_up:
|
|
202
192
|
service = self.parse_show_as_object(raw_output)
|
|
203
193
|
self.addCleanup(
|
|
204
|
-
self.openstack, 'service delete
|
|
194
|
+
self.openstack, 'service delete {}'.format(service['id'])
|
|
205
195
|
)
|
|
206
196
|
items = self.parse_show(raw_output)
|
|
207
197
|
self.assert_show_fields(items, self.SERVICE_FIELDS)
|
|
@@ -215,23 +205,16 @@ class IdentityTests(base.TestCase):
|
|
|
215
205
|
internal_url = data_utils.rand_url()
|
|
216
206
|
raw_output = self.openstack(
|
|
217
207
|
'endpoint create '
|
|
218
|
-
'--publicurl
|
|
219
|
-
'--adminurl
|
|
220
|
-
'--internalurl
|
|
221
|
-
'--region
|
|
222
|
-
'
|
|
223
|
-
% {
|
|
224
|
-
'publicurl': public_url,
|
|
225
|
-
'adminurl': admin_url,
|
|
226
|
-
'internalurl': internal_url,
|
|
227
|
-
'region': region_id,
|
|
228
|
-
'service': service_name,
|
|
229
|
-
}
|
|
208
|
+
f'--publicurl {public_url} '
|
|
209
|
+
f'--adminurl {admin_url} '
|
|
210
|
+
f'--internalurl {internal_url} '
|
|
211
|
+
f'--region {region_id} '
|
|
212
|
+
f'{service_name}'
|
|
230
213
|
)
|
|
231
214
|
endpoint = self.parse_show_as_object(raw_output)
|
|
232
215
|
if add_clean_up:
|
|
233
216
|
self.addCleanup(
|
|
234
|
-
self.openstack, 'endpoint delete
|
|
217
|
+
self.openstack, 'endpoint delete {}'.format(endpoint['id'])
|
|
235
218
|
)
|
|
236
219
|
items = self.parse_show(raw_output)
|
|
237
220
|
self.assert_show_fields(items, self.ENDPOINT_FIELDS)
|
|
@@ -35,7 +35,7 @@ class CatalogTests(common.IdentityTests):
|
|
|
35
35
|
| type | identity |
|
|
36
36
|
+-----------+-------------------------------------------+
|
|
37
37
|
"""
|
|
38
|
-
raw_output = self.openstack('catalog show
|
|
38
|
+
raw_output = self.openstack('catalog show {}'.format('identity'))
|
|
39
39
|
items = self.parse_show(raw_output)
|
|
40
40
|
# items may have multiple endpoint urls with empty key
|
|
41
41
|
self.assert_show_fields(items, ['endpoints', 'name', 'type', ''])
|
|
@@ -20,7 +20,7 @@ class EC2CredentialsTests(common.IdentityTests):
|
|
|
20
20
|
def test_ec2_credentials_delete(self):
|
|
21
21
|
access_key = self._create_dummy_ec2_credentials(add_clean_up=False)
|
|
22
22
|
raw_output = self.openstack(
|
|
23
|
-
'ec2 credentials delete
|
|
23
|
+
f'ec2 credentials delete {access_key}',
|
|
24
24
|
)
|
|
25
25
|
self.assertEqual(0, len(raw_output))
|
|
26
26
|
|
|
@@ -41,7 +41,7 @@ class EC2CredentialsTests(common.IdentityTests):
|
|
|
41
41
|
def test_ec2_credentials_show(self):
|
|
42
42
|
access_key = self._create_dummy_ec2_credentials()
|
|
43
43
|
show_output = self.openstack(
|
|
44
|
-
'ec2 credentials show
|
|
44
|
+
f'ec2 credentials show {access_key}',
|
|
45
45
|
)
|
|
46
46
|
items = self.parse_show(show_output)
|
|
47
47
|
self.assert_show_fields(items, self.EC2_CREDENTIALS_FIELDS)
|
|
@@ -19,7 +19,7 @@ class EndpointTests(common.IdentityTests):
|
|
|
19
19
|
|
|
20
20
|
def test_endpoint_delete(self):
|
|
21
21
|
endpoint_id = self._create_dummy_endpoint(add_clean_up=False)
|
|
22
|
-
raw_output = self.openstack('endpoint delete
|
|
22
|
+
raw_output = self.openstack(f'endpoint delete {endpoint_id}')
|
|
23
23
|
self.assertEqual(0, len(raw_output))
|
|
24
24
|
|
|
25
25
|
def test_endpoint_multi_delete(self):
|
|
@@ -39,6 +39,6 @@ class EndpointTests(common.IdentityTests):
|
|
|
39
39
|
|
|
40
40
|
def test_endpoint_show(self):
|
|
41
41
|
endpoint_id = self._create_dummy_endpoint()
|
|
42
|
-
raw_output = self.openstack('endpoint show
|
|
42
|
+
raw_output = self.openstack(f'endpoint show {endpoint_id}')
|
|
43
43
|
items = self.parse_show(raw_output)
|
|
44
44
|
self.assert_show_fields(items, self.ENDPOINT_FIELDS)
|
|
@@ -21,13 +21,13 @@ class ProjectTests(common.IdentityTests):
|
|
|
21
21
|
description = data_utils.rand_name('description')
|
|
22
22
|
raw_output = self.openstack(
|
|
23
23
|
'project create '
|
|
24
|
-
'--description
|
|
24
|
+
f'--description {description} '
|
|
25
25
|
'--enable '
|
|
26
26
|
'--property k1=v1 '
|
|
27
27
|
'--property k2=v2 '
|
|
28
|
-
'
|
|
28
|
+
f'{project_name}'
|
|
29
29
|
)
|
|
30
|
-
self.addCleanup(self.openstack, 'project delete
|
|
30
|
+
self.addCleanup(self.openstack, f'project delete {project_name}')
|
|
31
31
|
items = self.parse_show(raw_output)
|
|
32
32
|
show_fields = list(self.PROJECT_FIELDS)
|
|
33
33
|
show_fields.extend(['k1', 'k2'])
|
|
@@ -38,7 +38,7 @@ class ProjectTests(common.IdentityTests):
|
|
|
38
38
|
|
|
39
39
|
def test_project_delete(self):
|
|
40
40
|
project_name = self._create_dummy_project(add_clean_up=False)
|
|
41
|
-
raw_output = self.openstack('project delete
|
|
41
|
+
raw_output = self.openstack(f'project delete {project_name}')
|
|
42
42
|
self.assertEqual(0, len(raw_output))
|
|
43
43
|
|
|
44
44
|
def test_project_list(self):
|
|
@@ -51,14 +51,14 @@ class ProjectTests(common.IdentityTests):
|
|
|
51
51
|
new_project_name = data_utils.rand_name('NewTestProject')
|
|
52
52
|
raw_output = self.openstack(
|
|
53
53
|
'project set '
|
|
54
|
-
'--name
|
|
54
|
+
f'--name {new_project_name} '
|
|
55
55
|
'--disable '
|
|
56
56
|
'--property k0=v0 '
|
|
57
|
-
'
|
|
57
|
+
f'{project_name}'
|
|
58
58
|
)
|
|
59
59
|
self.assertEqual(0, len(raw_output))
|
|
60
60
|
# check project details
|
|
61
|
-
raw_output = self.openstack('project show
|
|
61
|
+
raw_output = self.openstack(f'project show {new_project_name}')
|
|
62
62
|
items = self.parse_show(raw_output)
|
|
63
63
|
fields = list(self.PROJECT_FIELDS)
|
|
64
64
|
fields.extend(['properties'])
|
|
@@ -70,7 +70,7 @@ class ProjectTests(common.IdentityTests):
|
|
|
70
70
|
|
|
71
71
|
def test_project_show(self):
|
|
72
72
|
project_name = self._create_dummy_project()
|
|
73
|
-
raw_output = self.openstack('project show
|
|
73
|
+
raw_output = self.openstack(f'project show {project_name}')
|
|
74
74
|
items = self.parse_show(raw_output)
|
|
75
75
|
fields = list(self.PROJECT_FIELDS)
|
|
76
76
|
fields.extend(['properties'])
|
|
@@ -19,7 +19,7 @@ class RoleTests(common.IdentityTests):
|
|
|
19
19
|
|
|
20
20
|
def test_role_delete(self):
|
|
21
21
|
role_name = self._create_dummy_role(add_clean_up=False)
|
|
22
|
-
raw_output = self.openstack('role delete
|
|
22
|
+
raw_output = self.openstack(f'role delete {role_name}')
|
|
23
23
|
self.assertEqual(0, len(raw_output))
|
|
24
24
|
|
|
25
25
|
def test_role_list(self):
|
|
@@ -30,7 +30,7 @@ class RoleTests(common.IdentityTests):
|
|
|
30
30
|
|
|
31
31
|
def test_role_show(self):
|
|
32
32
|
role_name = self._create_dummy_role()
|
|
33
|
-
raw_output = self.openstack('role show
|
|
33
|
+
raw_output = self.openstack(f'role show {role_name}')
|
|
34
34
|
items = self.parse_show(raw_output)
|
|
35
35
|
self.assert_show_fields(items, self.ROLE_FIELDS)
|
|
36
36
|
|
|
@@ -39,26 +39,16 @@ class RoleTests(common.IdentityTests):
|
|
|
39
39
|
username = self._create_dummy_user()
|
|
40
40
|
raw_output = self.openstack(
|
|
41
41
|
'role add '
|
|
42
|
-
'--project
|
|
43
|
-
'--user
|
|
44
|
-
'
|
|
45
|
-
% {
|
|
46
|
-
'project': self.project_name,
|
|
47
|
-
'user': username,
|
|
48
|
-
'role': role_name,
|
|
49
|
-
}
|
|
42
|
+
f'--project {self.project_name} '
|
|
43
|
+
f'--user {username} '
|
|
44
|
+
f'{role_name}'
|
|
50
45
|
)
|
|
51
46
|
self.addCleanup(
|
|
52
47
|
self.openstack,
|
|
53
48
|
'role remove '
|
|
54
|
-
'--project
|
|
55
|
-
'--user
|
|
56
|
-
'
|
|
57
|
-
% {
|
|
58
|
-
'project': self.project_name,
|
|
59
|
-
'user': username,
|
|
60
|
-
'role': role_name,
|
|
61
|
-
},
|
|
49
|
+
f'--project {self.project_name} '
|
|
50
|
+
f'--user {username} '
|
|
51
|
+
f'{role_name}',
|
|
62
52
|
)
|
|
63
53
|
items = self.parse_show(raw_output)
|
|
64
54
|
self.assert_show_fields(items, self.ROLE_FIELDS)
|
|
@@ -68,25 +58,15 @@ class RoleTests(common.IdentityTests):
|
|
|
68
58
|
username = self._create_dummy_user()
|
|
69
59
|
add_raw_output = self.openstack(
|
|
70
60
|
'role add '
|
|
71
|
-
'--project
|
|
72
|
-
'--user
|
|
73
|
-
'
|
|
74
|
-
% {
|
|
75
|
-
'project': self.project_name,
|
|
76
|
-
'user': username,
|
|
77
|
-
'role': role_name,
|
|
78
|
-
}
|
|
61
|
+
f'--project {self.project_name} '
|
|
62
|
+
f'--user {username} '
|
|
63
|
+
f'{role_name}'
|
|
79
64
|
)
|
|
80
65
|
del_raw_output = self.openstack(
|
|
81
66
|
'role remove '
|
|
82
|
-
'--project
|
|
83
|
-
'--user
|
|
84
|
-
'
|
|
85
|
-
% {
|
|
86
|
-
'project': self.project_name,
|
|
87
|
-
'user': username,
|
|
88
|
-
'role': role_name,
|
|
89
|
-
}
|
|
67
|
+
f'--project {self.project_name} '
|
|
68
|
+
f'--user {username} '
|
|
69
|
+
f'{role_name}'
|
|
90
70
|
)
|
|
91
71
|
items = self.parse_show(add_raw_output)
|
|
92
72
|
self.assert_show_fields(items, self.ROLE_FIELDS)
|
|
@@ -19,7 +19,7 @@ class ServiceTests(common.IdentityTests):
|
|
|
19
19
|
|
|
20
20
|
def test_service_delete(self):
|
|
21
21
|
service_name = self._create_dummy_service(add_clean_up=False)
|
|
22
|
-
raw_output = self.openstack('service delete
|
|
22
|
+
raw_output = self.openstack(f'service delete {service_name}')
|
|
23
23
|
self.assertEqual(0, len(raw_output))
|
|
24
24
|
|
|
25
25
|
def test_service_multi_delete(self):
|
|
@@ -38,6 +38,6 @@ class ServiceTests(common.IdentityTests):
|
|
|
38
38
|
|
|
39
39
|
def test_service_show(self):
|
|
40
40
|
service_name = self._create_dummy_service()
|
|
41
|
-
raw_output = self.openstack('service show
|
|
41
|
+
raw_output = self.openstack(f'service show {service_name}')
|
|
42
42
|
items = self.parse_show(raw_output)
|
|
43
43
|
self.assert_show_fields(items, self.SERVICE_FIELDS)
|
|
@@ -19,5 +19,5 @@ class TokenTests(common.IdentityTests):
|
|
|
19
19
|
|
|
20
20
|
def test_token_revoke(self):
|
|
21
21
|
token_id = self._create_dummy_token(add_clean_up=False)
|
|
22
|
-
raw_output = self.openstack('token revoke
|
|
22
|
+
raw_output = self.openstack(f'token revoke {token_id}')
|
|
23
23
|
self.assertEqual(0, len(raw_output))
|
|
@@ -22,7 +22,7 @@ class UserTests(common.IdentityTests):
|
|
|
22
22
|
|
|
23
23
|
def test_user_delete(self):
|
|
24
24
|
username = self._create_dummy_user(add_clean_up=False)
|
|
25
|
-
raw_output = self.openstack('user delete
|
|
25
|
+
raw_output = self.openstack(f'user delete {username}')
|
|
26
26
|
self.assertEqual(0, len(raw_output))
|
|
27
27
|
|
|
28
28
|
def test_user_list(self):
|
|
@@ -32,26 +32,24 @@ class UserTests(common.IdentityTests):
|
|
|
32
32
|
|
|
33
33
|
def test_user_set(self):
|
|
34
34
|
username = self._create_dummy_user()
|
|
35
|
-
raw_output = self.openstack('user show
|
|
35
|
+
raw_output = self.openstack(f'user show {username}')
|
|
36
36
|
user = self.parse_show_as_object(raw_output)
|
|
37
37
|
new_username = data_utils.rand_name('NewTestUser')
|
|
38
38
|
new_email = data_utils.rand_name() + '@example.com'
|
|
39
39
|
raw_output = self.openstack(
|
|
40
|
-
'user set '
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
'%(id)s'
|
|
44
|
-
% {'email': new_email, 'new_name': new_username, 'id': user['id']}
|
|
40
|
+
'user set ' '--email {email} ' '--name {new_name} ' '{id}'.format(
|
|
41
|
+
email=new_email, new_name=new_username, id=user['id']
|
|
42
|
+
)
|
|
45
43
|
)
|
|
46
44
|
self.assertEqual(0, len(raw_output))
|
|
47
|
-
raw_output = self.openstack('user show
|
|
45
|
+
raw_output = self.openstack(f'user show {new_username}')
|
|
48
46
|
new_user = self.parse_show_as_object(raw_output)
|
|
49
47
|
self.assertEqual(user['id'], new_user['id'])
|
|
50
48
|
self.assertEqual(new_email, new_user['email'])
|
|
51
49
|
|
|
52
50
|
def test_user_show(self):
|
|
53
51
|
username = self._create_dummy_user()
|
|
54
|
-
raw_output = self.openstack('user show
|
|
52
|
+
raw_output = self.openstack(f'user show {username}')
|
|
55
53
|
items = self.parse_show(raw_output)
|
|
56
54
|
self.assert_show_fields(items, self.USER_FIELDS)
|
|
57
55
|
|