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
|
@@ -23,7 +23,7 @@ class EndpointTests(common.IdentityTests):
|
|
|
23
23
|
|
|
24
24
|
def test_endpoint_delete(self):
|
|
25
25
|
endpoint_id = self._create_dummy_endpoint(add_clean_up=False)
|
|
26
|
-
raw_output = self.openstack('endpoint delete
|
|
26
|
+
raw_output = self.openstack(f'endpoint delete {endpoint_id}')
|
|
27
27
|
self.assertEqual(0, len(raw_output))
|
|
28
28
|
|
|
29
29
|
def test_endpoint_multi_delete(self):
|
|
@@ -45,20 +45,15 @@ class EndpointTests(common.IdentityTests):
|
|
|
45
45
|
endpoint_id = self._create_dummy_endpoint(add_clean_up=False)
|
|
46
46
|
project_id = self._create_dummy_project(add_clean_up=False)
|
|
47
47
|
raw_output = self.openstack(
|
|
48
|
-
'endpoint add project '
|
|
49
|
-
'%(endpoint_id)s '
|
|
50
|
-
'%(project_id)s'
|
|
51
|
-
% {'project_id': project_id, 'endpoint_id': endpoint_id}
|
|
48
|
+
'endpoint add project ' f'{endpoint_id} ' f'{project_id}'
|
|
52
49
|
)
|
|
53
50
|
self.assertEqual(0, len(raw_output))
|
|
54
|
-
raw_output = self.openstack(
|
|
55
|
-
'endpoint list --endpoint %s' % endpoint_id
|
|
56
|
-
)
|
|
51
|
+
raw_output = self.openstack(f'endpoint list --endpoint {endpoint_id}')
|
|
57
52
|
self.assertIn(project_id, raw_output)
|
|
58
53
|
items = self.parse_listing(raw_output)
|
|
59
54
|
self.assert_table_structure(items, self.ENDPOINT_LIST_PROJECT_HEADERS)
|
|
60
55
|
|
|
61
|
-
raw_output = self.openstack('endpoint list --project
|
|
56
|
+
raw_output = self.openstack(f'endpoint list --project {project_id}')
|
|
62
57
|
self.assertIn(endpoint_id, raw_output)
|
|
63
58
|
items = self.parse_listing(raw_output)
|
|
64
59
|
self.assert_table_structure(items, self.ENDPOINT_LIST_HEADERS)
|
|
@@ -68,18 +63,17 @@ class EndpointTests(common.IdentityTests):
|
|
|
68
63
|
new_endpoint_url = data_utils.rand_url()
|
|
69
64
|
raw_output = self.openstack(
|
|
70
65
|
'endpoint set '
|
|
71
|
-
'--interface
|
|
72
|
-
'--url
|
|
66
|
+
'--interface {interface} '
|
|
67
|
+
'--url {url} '
|
|
73
68
|
'--disable '
|
|
74
|
-
'
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
69
|
+
'{endpoint_id}'.format(
|
|
70
|
+
interface='admin',
|
|
71
|
+
url=new_endpoint_url,
|
|
72
|
+
endpoint_id=endpoint_id,
|
|
73
|
+
)
|
|
80
74
|
)
|
|
81
75
|
self.assertEqual(0, len(raw_output))
|
|
82
|
-
raw_output = self.openstack('endpoint show
|
|
76
|
+
raw_output = self.openstack(f'endpoint show {endpoint_id}')
|
|
83
77
|
endpoint = self.parse_show_as_object(raw_output)
|
|
84
78
|
self.assertEqual('admin', endpoint['interface'])
|
|
85
79
|
self.assertEqual(new_endpoint_url, endpoint['url'])
|
|
@@ -87,7 +81,7 @@ class EndpointTests(common.IdentityTests):
|
|
|
87
81
|
|
|
88
82
|
def test_endpoint_show(self):
|
|
89
83
|
endpoint_id = self._create_dummy_endpoint()
|
|
90
|
-
raw_output = self.openstack('endpoint show
|
|
84
|
+
raw_output = self.openstack(f'endpoint show {endpoint_id}')
|
|
91
85
|
items = self.parse_show(raw_output)
|
|
92
86
|
self.assert_show_fields(items, self.ENDPOINT_FIELDS)
|
|
93
87
|
|
|
@@ -95,17 +89,11 @@ class EndpointTests(common.IdentityTests):
|
|
|
95
89
|
endpoint_id = self._create_dummy_endpoint(add_clean_up=False)
|
|
96
90
|
project_id = self._create_dummy_project(add_clean_up=False)
|
|
97
91
|
raw_output = self.openstack(
|
|
98
|
-
'endpoint add project '
|
|
99
|
-
'%(endpoint_id)s '
|
|
100
|
-
'%(project_id)s'
|
|
101
|
-
% {'project_id': project_id, 'endpoint_id': endpoint_id}
|
|
92
|
+
'endpoint add project ' f'{endpoint_id} ' f'{project_id}'
|
|
102
93
|
)
|
|
103
94
|
self.assertEqual(0, len(raw_output))
|
|
104
95
|
|
|
105
96
|
raw_output = self.openstack(
|
|
106
|
-
'endpoint remove project '
|
|
107
|
-
'%(endpoint_id)s '
|
|
108
|
-
'%(project_id)s'
|
|
109
|
-
% {'project_id': project_id, 'endpoint_id': endpoint_id}
|
|
97
|
+
'endpoint remove project ' f'{endpoint_id} ' f'{project_id}'
|
|
110
98
|
)
|
|
111
99
|
self.assertEqual(0, len(raw_output))
|
|
@@ -28,9 +28,7 @@ class GroupTests(common.IdentityTests):
|
|
|
28
28
|
|
|
29
29
|
def test_group_list_with_domain(self):
|
|
30
30
|
group_name = self._create_dummy_group()
|
|
31
|
-
raw_output = self.openstack(
|
|
32
|
-
'group list --domain %s' % self.domain_name
|
|
33
|
-
)
|
|
31
|
+
raw_output = self.openstack(f'group list --domain {self.domain_name}')
|
|
34
32
|
items = self.parse_listing(raw_output)
|
|
35
33
|
self.assert_table_structure(items, common.BASIC_LIST_HEADERS)
|
|
36
34
|
self.assertIn(group_name, raw_output)
|
|
@@ -38,18 +36,14 @@ class GroupTests(common.IdentityTests):
|
|
|
38
36
|
def test_group_delete(self):
|
|
39
37
|
group_name = self._create_dummy_group(add_clean_up=False)
|
|
40
38
|
raw_output = self.openstack(
|
|
41
|
-
'group delete '
|
|
42
|
-
'--domain %(domain)s '
|
|
43
|
-
'%(name)s' % {'domain': self.domain_name, 'name': group_name}
|
|
39
|
+
'group delete ' f'--domain {self.domain_name} ' f'{group_name}'
|
|
44
40
|
)
|
|
45
41
|
self.assertEqual(0, len(raw_output))
|
|
46
42
|
|
|
47
43
|
def test_group_show(self):
|
|
48
44
|
group_name = self._create_dummy_group()
|
|
49
45
|
raw_output = self.openstack(
|
|
50
|
-
'group show '
|
|
51
|
-
'--domain %(domain)s '
|
|
52
|
-
'%(name)s' % {'domain': self.domain_name, 'name': group_name}
|
|
46
|
+
'group show ' f'--domain {self.domain_name} ' f'{group_name}'
|
|
53
47
|
)
|
|
54
48
|
items = self.parse_show(raw_output)
|
|
55
49
|
self.assert_show_fields(items, self.GROUP_FIELDS)
|
|
@@ -59,34 +53,22 @@ class GroupTests(common.IdentityTests):
|
|
|
59
53
|
new_group_name = data_utils.rand_name('NewTestGroup')
|
|
60
54
|
raw_output = self.openstack(
|
|
61
55
|
'group set '
|
|
62
|
-
'--domain
|
|
63
|
-
'--name
|
|
64
|
-
'
|
|
65
|
-
% {
|
|
66
|
-
'domain': self.domain_name,
|
|
67
|
-
'new_group': new_group_name,
|
|
68
|
-
'group': group_name,
|
|
69
|
-
}
|
|
56
|
+
f'--domain {self.domain_name} '
|
|
57
|
+
f'--name {new_group_name} '
|
|
58
|
+
f'{group_name}'
|
|
70
59
|
)
|
|
71
60
|
self.assertEqual(0, len(raw_output))
|
|
72
61
|
raw_output = self.openstack(
|
|
73
|
-
'group show '
|
|
74
|
-
'--domain %(domain)s '
|
|
75
|
-
'%(group)s' % {'domain': self.domain_name, 'group': new_group_name}
|
|
62
|
+
'group show ' f'--domain {self.domain_name} ' f'{new_group_name}'
|
|
76
63
|
)
|
|
77
64
|
group = self.parse_show_as_object(raw_output)
|
|
78
65
|
self.assertEqual(new_group_name, group['name'])
|
|
79
66
|
# reset group name to make sure it will be cleaned up
|
|
80
67
|
raw_output = self.openstack(
|
|
81
68
|
'group set '
|
|
82
|
-
'--domain
|
|
83
|
-
'--name
|
|
84
|
-
'
|
|
85
|
-
% {
|
|
86
|
-
'domain': self.domain_name,
|
|
87
|
-
'new_group': group_name,
|
|
88
|
-
'group': new_group_name,
|
|
89
|
-
}
|
|
69
|
+
f'--domain {self.domain_name} '
|
|
70
|
+
f'--name {group_name} '
|
|
71
|
+
f'{new_group_name}'
|
|
90
72
|
)
|
|
91
73
|
self.assertEqual(0, len(raw_output))
|
|
92
74
|
|
|
@@ -95,28 +77,16 @@ class GroupTests(common.IdentityTests):
|
|
|
95
77
|
username = self._create_dummy_user()
|
|
96
78
|
raw_output = self.openstack(
|
|
97
79
|
'group add user '
|
|
98
|
-
'--group-domain
|
|
99
|
-
'--user-domain
|
|
100
|
-
'
|
|
101
|
-
% {
|
|
102
|
-
'group_domain': self.domain_name,
|
|
103
|
-
'user_domain': self.domain_name,
|
|
104
|
-
'group': group_name,
|
|
105
|
-
'user': username,
|
|
106
|
-
}
|
|
80
|
+
f'--group-domain {self.domain_name} '
|
|
81
|
+
f'--user-domain {self.domain_name} '
|
|
82
|
+
f'{group_name} {username}'
|
|
107
83
|
)
|
|
108
84
|
self.addCleanup(
|
|
109
85
|
self.openstack,
|
|
110
86
|
'group remove user '
|
|
111
|
-
'--group-domain
|
|
112
|
-
'--user-domain
|
|
113
|
-
'
|
|
114
|
-
% {
|
|
115
|
-
'group_domain': self.domain_name,
|
|
116
|
-
'user_domain': self.domain_name,
|
|
117
|
-
'group': group_name,
|
|
118
|
-
'user': username,
|
|
119
|
-
},
|
|
87
|
+
f'--group-domain {self.domain_name} '
|
|
88
|
+
f'--user-domain {self.domain_name} '
|
|
89
|
+
f'{group_name} {username}',
|
|
120
90
|
)
|
|
121
91
|
self.assertOutput('', raw_output)
|
|
122
92
|
|
|
@@ -125,45 +95,26 @@ class GroupTests(common.IdentityTests):
|
|
|
125
95
|
username = self._create_dummy_user()
|
|
126
96
|
raw_output = self.openstack(
|
|
127
97
|
'group add user '
|
|
128
|
-
'--group-domain
|
|
129
|
-
'--user-domain
|
|
130
|
-
'
|
|
131
|
-
% {
|
|
132
|
-
'group_domain': self.domain_name,
|
|
133
|
-
'user_domain': self.domain_name,
|
|
134
|
-
'group': group_name,
|
|
135
|
-
'user': username,
|
|
136
|
-
}
|
|
98
|
+
f'--group-domain {self.domain_name} '
|
|
99
|
+
f'--user-domain {self.domain_name} '
|
|
100
|
+
f'{group_name} {username}'
|
|
137
101
|
)
|
|
138
102
|
self.addCleanup(
|
|
139
103
|
self.openstack,
|
|
140
104
|
'group remove user '
|
|
141
|
-
'--group-domain
|
|
142
|
-
'--user-domain
|
|
143
|
-
'
|
|
144
|
-
% {
|
|
145
|
-
'group_domain': self.domain_name,
|
|
146
|
-
'user_domain': self.domain_name,
|
|
147
|
-
'group': group_name,
|
|
148
|
-
'user': username,
|
|
149
|
-
},
|
|
105
|
+
f'--group-domain {self.domain_name} '
|
|
106
|
+
f'--user-domain {self.domain_name} '
|
|
107
|
+
f'{group_name} {username}',
|
|
150
108
|
)
|
|
151
109
|
self.assertOutput('', raw_output)
|
|
152
110
|
raw_output = self.openstack(
|
|
153
111
|
'group contains user '
|
|
154
|
-
'--group-domain
|
|
155
|
-
'--user-domain
|
|
156
|
-
'
|
|
157
|
-
% {
|
|
158
|
-
'group_domain': self.domain_name,
|
|
159
|
-
'user_domain': self.domain_name,
|
|
160
|
-
'group': group_name,
|
|
161
|
-
'user': username,
|
|
162
|
-
}
|
|
112
|
+
f'--group-domain {self.domain_name} '
|
|
113
|
+
f'--user-domain {self.domain_name} '
|
|
114
|
+
f'{group_name} {username}'
|
|
163
115
|
)
|
|
164
116
|
self.assertEqual(
|
|
165
|
-
'
|
|
166
|
-
% {'user': username, 'group': group_name},
|
|
117
|
+
f'{username} in group {group_name}\n',
|
|
167
118
|
raw_output,
|
|
168
119
|
)
|
|
169
120
|
|
|
@@ -172,27 +123,15 @@ class GroupTests(common.IdentityTests):
|
|
|
172
123
|
username = self._create_dummy_user()
|
|
173
124
|
add_raw_output = self.openstack(
|
|
174
125
|
'group add user '
|
|
175
|
-
'--group-domain
|
|
176
|
-
'--user-domain
|
|
177
|
-
'
|
|
178
|
-
% {
|
|
179
|
-
'group_domain': self.domain_name,
|
|
180
|
-
'user_domain': self.domain_name,
|
|
181
|
-
'group': group_name,
|
|
182
|
-
'user': username,
|
|
183
|
-
}
|
|
126
|
+
f'--group-domain {self.domain_name} '
|
|
127
|
+
f'--user-domain {self.domain_name} '
|
|
128
|
+
f'{group_name} {username}'
|
|
184
129
|
)
|
|
185
130
|
remove_raw_output = self.openstack(
|
|
186
131
|
'group remove user '
|
|
187
|
-
'--group-domain
|
|
188
|
-
'--user-domain
|
|
189
|
-
'
|
|
190
|
-
% {
|
|
191
|
-
'group_domain': self.domain_name,
|
|
192
|
-
'user_domain': self.domain_name,
|
|
193
|
-
'group': group_name,
|
|
194
|
-
'user': username,
|
|
195
|
-
}
|
|
132
|
+
f'--group-domain {self.domain_name} '
|
|
133
|
+
f'--user-domain {self.domain_name} '
|
|
134
|
+
f'{group_name} {username}'
|
|
196
135
|
)
|
|
197
136
|
self.assertOutput('', add_raw_output)
|
|
198
137
|
self.assertOutput('', remove_raw_output)
|
|
@@ -24,7 +24,7 @@ class IdentityProviderTests(common.IdentityTests):
|
|
|
24
24
|
def test_idp_delete(self):
|
|
25
25
|
identity_provider = self._create_dummy_idp(add_clean_up=False)
|
|
26
26
|
raw_output = self.openstack(
|
|
27
|
-
'identity provider delete
|
|
27
|
+
f'identity provider delete {identity_provider}'
|
|
28
28
|
)
|
|
29
29
|
self.assertEqual(0, len(raw_output))
|
|
30
30
|
|
|
@@ -39,7 +39,7 @@ class IdentityProviderTests(common.IdentityTests):
|
|
|
39
39
|
def test_idp_show(self):
|
|
40
40
|
identity_provider = self._create_dummy_idp(add_clean_up=True)
|
|
41
41
|
raw_output = self.openstack(
|
|
42
|
-
'identity provider show
|
|
42
|
+
f'identity provider show {identity_provider}'
|
|
43
43
|
)
|
|
44
44
|
items = self.parse_show(raw_output)
|
|
45
45
|
self.assert_show_fields(items, self.IDENTITY_PROVIDER_FIELDS)
|
|
@@ -64,7 +64,7 @@ class IdentityProviderTests(common.IdentityTests):
|
|
|
64
64
|
)
|
|
65
65
|
self.assertEqual(0, len(raw_output))
|
|
66
66
|
raw_output = self.openstack(
|
|
67
|
-
'identity provider show
|
|
67
|
+
f'identity provider show {identity_provider}'
|
|
68
68
|
)
|
|
69
69
|
updated_value = self.parse_show_as_object(raw_output)
|
|
70
70
|
self.assertIn(new_remoteid, updated_value['remote_ids'])
|
|
@@ -23,19 +23,19 @@ class LimitTestCase(common.IdentityTests):
|
|
|
23
23
|
def test_limit_create_with_service_name(self):
|
|
24
24
|
registered_limit_id = self._create_dummy_registered_limit()
|
|
25
25
|
raw_output = self.openstack(
|
|
26
|
-
'registered limit show
|
|
26
|
+
f'registered limit show {registered_limit_id}',
|
|
27
27
|
cloud=SYSTEM_CLOUD,
|
|
28
28
|
)
|
|
29
29
|
items = self.parse_show(raw_output)
|
|
30
30
|
service_id = self._extract_value_from_items('service_id', items)
|
|
31
31
|
resource_name = self._extract_value_from_items('resource_name', items)
|
|
32
32
|
|
|
33
|
-
raw_output = self.openstack('service show
|
|
33
|
+
raw_output = self.openstack(f'service show {service_id}')
|
|
34
34
|
items = self.parse_show(raw_output)
|
|
35
35
|
service_name = self._extract_value_from_items('name', items)
|
|
36
36
|
|
|
37
37
|
project_name = self._create_dummy_project()
|
|
38
|
-
raw_output = self.openstack('project show
|
|
38
|
+
raw_output = self.openstack(f'project show {project_name}')
|
|
39
39
|
items = self.parse_show(raw_output)
|
|
40
40
|
project_id = self._extract_value_from_items('id', items)
|
|
41
41
|
|
|
@@ -47,16 +47,16 @@ class LimitTestCase(common.IdentityTests):
|
|
|
47
47
|
}
|
|
48
48
|
raw_output = self.openstack(
|
|
49
49
|
'limit create'
|
|
50
|
-
' --project
|
|
51
|
-
' --service
|
|
52
|
-
' --resource-limit
|
|
53
|
-
'
|
|
50
|
+
' --project {project_id}'
|
|
51
|
+
' --service {service_name}'
|
|
52
|
+
' --resource-limit {resource_limit}'
|
|
53
|
+
' {resource_name}'.format(**params),
|
|
54
54
|
cloud=SYSTEM_CLOUD,
|
|
55
55
|
)
|
|
56
56
|
items = self.parse_show(raw_output)
|
|
57
57
|
limit_id = self._extract_value_from_items('id', items)
|
|
58
58
|
self.addCleanup(
|
|
59
|
-
self.openstack, 'limit delete
|
|
59
|
+
self.openstack, f'limit delete {limit_id}', cloud=SYSTEM_CLOUD
|
|
60
60
|
)
|
|
61
61
|
|
|
62
62
|
self.assert_show_fields(items, self.LIMIT_FIELDS)
|
|
@@ -64,14 +64,14 @@ class LimitTestCase(common.IdentityTests):
|
|
|
64
64
|
def test_limit_create_with_project_name(self):
|
|
65
65
|
registered_limit_id = self._create_dummy_registered_limit()
|
|
66
66
|
raw_output = self.openstack(
|
|
67
|
-
'registered limit show
|
|
67
|
+
f'registered limit show {registered_limit_id}',
|
|
68
68
|
cloud=SYSTEM_CLOUD,
|
|
69
69
|
)
|
|
70
70
|
items = self.parse_show(raw_output)
|
|
71
71
|
service_id = self._extract_value_from_items('service_id', items)
|
|
72
72
|
resource_name = self._extract_value_from_items('resource_name', items)
|
|
73
73
|
|
|
74
|
-
raw_output = self.openstack('service show
|
|
74
|
+
raw_output = self.openstack(f'service show {service_id}')
|
|
75
75
|
items = self.parse_show(raw_output)
|
|
76
76
|
service_name = self._extract_value_from_items('name', items)
|
|
77
77
|
|
|
@@ -85,16 +85,16 @@ class LimitTestCase(common.IdentityTests):
|
|
|
85
85
|
}
|
|
86
86
|
raw_output = self.openstack(
|
|
87
87
|
'limit create'
|
|
88
|
-
' --project
|
|
89
|
-
' --service
|
|
90
|
-
' --resource-limit
|
|
91
|
-
'
|
|
88
|
+
' --project {project_name}'
|
|
89
|
+
' --service {service_name}'
|
|
90
|
+
' --resource-limit {resource_limit}'
|
|
91
|
+
' {resource_name}'.format(**params),
|
|
92
92
|
cloud=SYSTEM_CLOUD,
|
|
93
93
|
)
|
|
94
94
|
items = self.parse_show(raw_output)
|
|
95
95
|
limit_id = self._extract_value_from_items('id', items)
|
|
96
96
|
self.addCleanup(
|
|
97
|
-
self.openstack, 'limit delete
|
|
97
|
+
self.openstack, f'limit delete {limit_id}', cloud=SYSTEM_CLOUD
|
|
98
98
|
)
|
|
99
99
|
|
|
100
100
|
self.assert_show_fields(items, self.LIMIT_FIELDS)
|
|
@@ -117,8 +117,8 @@ class LimitTestCase(common.IdentityTests):
|
|
|
117
117
|
|
|
118
118
|
raw_output = self.openstack(
|
|
119
119
|
'registered limit set'
|
|
120
|
-
'
|
|
121
|
-
' --region
|
|
120
|
+
' {registered_limit_id}'
|
|
121
|
+
' --region {region_id}'.format(**params),
|
|
122
122
|
cloud=SYSTEM_CLOUD,
|
|
123
123
|
)
|
|
124
124
|
items = self.parse_show(raw_output)
|
|
@@ -126,7 +126,7 @@ class LimitTestCase(common.IdentityTests):
|
|
|
126
126
|
resource_name = self._extract_value_from_items('resource_name', items)
|
|
127
127
|
|
|
128
128
|
project_name = self._create_dummy_project()
|
|
129
|
-
raw_output = self.openstack('project show
|
|
129
|
+
raw_output = self.openstack(f'project show {project_name}')
|
|
130
130
|
items = self.parse_show(raw_output)
|
|
131
131
|
project_id = self._extract_value_from_items('id', items)
|
|
132
132
|
description = data_utils.arbitrary_string()
|
|
@@ -141,18 +141,18 @@ class LimitTestCase(common.IdentityTests):
|
|
|
141
141
|
}
|
|
142
142
|
raw_output = self.openstack(
|
|
143
143
|
'limit create'
|
|
144
|
-
' --project
|
|
145
|
-
' --service
|
|
146
|
-
' --resource-limit
|
|
147
|
-
' --region
|
|
148
|
-
' --description
|
|
149
|
-
'
|
|
144
|
+
' --project {project_id}'
|
|
145
|
+
' --service {service_id}'
|
|
146
|
+
' --resource-limit {resource_limit}'
|
|
147
|
+
' --region {region_id}'
|
|
148
|
+
' --description {description}'
|
|
149
|
+
' {resource_name}'.format(**params),
|
|
150
150
|
cloud=SYSTEM_CLOUD,
|
|
151
151
|
)
|
|
152
152
|
items = self.parse_show(raw_output)
|
|
153
153
|
limit_id = self._extract_value_from_items('id', items)
|
|
154
154
|
self.addCleanup(
|
|
155
|
-
self.openstack, 'limit delete
|
|
155
|
+
self.openstack, f'limit delete {limit_id}', cloud=SYSTEM_CLOUD
|
|
156
156
|
)
|
|
157
157
|
|
|
158
158
|
self.assert_show_fields(items, self.LIMIT_FIELDS)
|
|
@@ -160,7 +160,7 @@ class LimitTestCase(common.IdentityTests):
|
|
|
160
160
|
def test_limit_show(self):
|
|
161
161
|
limit_id = self._create_dummy_limit()
|
|
162
162
|
raw_output = self.openstack(
|
|
163
|
-
'limit show
|
|
163
|
+
f'limit show {limit_id}', cloud=SYSTEM_CLOUD
|
|
164
164
|
)
|
|
165
165
|
items = self.parse_show(raw_output)
|
|
166
166
|
self.assert_show_fields(items, self.LIMIT_FIELDS)
|
|
@@ -174,9 +174,9 @@ class LimitTestCase(common.IdentityTests):
|
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
raw_output = self.openstack(
|
|
177
|
-
'limit set'
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
'limit set' ' --description {description}' ' {limit_id}'.format(
|
|
178
|
+
**params
|
|
179
|
+
),
|
|
180
180
|
cloud=SYSTEM_CLOUD,
|
|
181
181
|
)
|
|
182
182
|
items = self.parse_show(raw_output)
|
|
@@ -189,8 +189,8 @@ class LimitTestCase(common.IdentityTests):
|
|
|
189
189
|
|
|
190
190
|
raw_output = self.openstack(
|
|
191
191
|
'limit set'
|
|
192
|
-
' --resource-limit
|
|
193
|
-
'
|
|
192
|
+
' --resource-limit {resource_limit}'
|
|
193
|
+
' {limit_id}'.format(**params),
|
|
194
194
|
cloud=SYSTEM_CLOUD,
|
|
195
195
|
)
|
|
196
196
|
items = self.parse_show(raw_output)
|
|
@@ -205,6 +205,6 @@ class LimitTestCase(common.IdentityTests):
|
|
|
205
205
|
def test_limit_delete(self):
|
|
206
206
|
limit_id = self._create_dummy_limit(add_clean_up=False)
|
|
207
207
|
raw_output = self.openstack(
|
|
208
|
-
'limit delete
|
|
208
|
+
f'limit delete {limit_id}', cloud=SYSTEM_CLOUD
|
|
209
209
|
)
|
|
210
210
|
self.assertEqual(0, len(raw_output))
|
|
@@ -21,23 +21,18 @@ class ProjectTests(common.IdentityTests):
|
|
|
21
21
|
description = data_utils.rand_name('description')
|
|
22
22
|
raw_output = self.openstack(
|
|
23
23
|
'project create '
|
|
24
|
-
'--domain
|
|
25
|
-
'--description
|
|
24
|
+
f'--domain {self.domain_name} '
|
|
25
|
+
f'--description {description} '
|
|
26
26
|
'--enable '
|
|
27
27
|
'--property k1=v1 '
|
|
28
28
|
'--property k2=v2 '
|
|
29
|
-
'
|
|
30
|
-
% {
|
|
31
|
-
'domain': self.domain_name,
|
|
32
|
-
'description': description,
|
|
33
|
-
'name': project_name,
|
|
34
|
-
}
|
|
29
|
+
f'{project_name}'
|
|
35
30
|
)
|
|
36
31
|
self.addCleanup(
|
|
37
32
|
self.openstack,
|
|
38
33
|
'project delete '
|
|
39
|
-
'--domain
|
|
40
|
-
'
|
|
34
|
+
f'--domain {self.domain_name} '
|
|
35
|
+
f'{project_name}',
|
|
41
36
|
)
|
|
42
37
|
items = self.parse_show(raw_output)
|
|
43
38
|
show_fields = list(self.PROJECT_FIELDS)
|
|
@@ -50,9 +45,7 @@ class ProjectTests(common.IdentityTests):
|
|
|
50
45
|
def test_project_delete(self):
|
|
51
46
|
project_name = self._create_dummy_project(add_clean_up=False)
|
|
52
47
|
raw_output = self.openstack(
|
|
53
|
-
'project delete '
|
|
54
|
-
'--domain %(domain)s '
|
|
55
|
-
'%(name)s' % {'domain': self.domain_name, 'name': project_name}
|
|
48
|
+
'project delete ' f'--domain {self.domain_name} ' f'{project_name}'
|
|
56
49
|
)
|
|
57
50
|
self.assertEqual(0, len(raw_output))
|
|
58
51
|
|
|
@@ -64,7 +57,7 @@ class ProjectTests(common.IdentityTests):
|
|
|
64
57
|
def test_project_list_with_domain(self):
|
|
65
58
|
project_name = self._create_dummy_project()
|
|
66
59
|
raw_output = self.openstack(
|
|
67
|
-
'project list --domain
|
|
60
|
+
f'project list --domain {self.domain_name}'
|
|
68
61
|
)
|
|
69
62
|
items = self.parse_listing(raw_output)
|
|
70
63
|
self.assert_table_structure(items, common.BASIC_LIST_HEADERS)
|
|
@@ -76,17 +69,17 @@ class ProjectTests(common.IdentityTests):
|
|
|
76
69
|
new_project_name = data_utils.rand_name('NewTestProject')
|
|
77
70
|
raw_output = self.openstack(
|
|
78
71
|
'project set '
|
|
79
|
-
'--name
|
|
72
|
+
f'--name {new_project_name} '
|
|
80
73
|
'--disable '
|
|
81
74
|
'--property k0=v0 '
|
|
82
|
-
'
|
|
75
|
+
f'{project_name}'
|
|
83
76
|
)
|
|
84
77
|
self.assertEqual(0, len(raw_output))
|
|
85
78
|
# check project details
|
|
86
79
|
raw_output = self.openstack(
|
|
87
80
|
'project show '
|
|
88
|
-
'--domain
|
|
89
|
-
'
|
|
81
|
+
f'--domain {self.domain_name} '
|
|
82
|
+
f'{new_project_name}'
|
|
90
83
|
)
|
|
91
84
|
items = self.parse_show(raw_output)
|
|
92
85
|
fields = list(self.PROJECT_FIELDS)
|
|
@@ -99,17 +92,16 @@ class ProjectTests(common.IdentityTests):
|
|
|
99
92
|
# reset project to make sure it will be cleaned up
|
|
100
93
|
self.openstack(
|
|
101
94
|
'project set '
|
|
102
|
-
'--name
|
|
95
|
+
f'--name {project_name} '
|
|
103
96
|
'--enable '
|
|
104
|
-
'
|
|
97
|
+
f'{new_project_name}'
|
|
105
98
|
)
|
|
106
99
|
|
|
107
100
|
def test_project_show(self):
|
|
108
101
|
raw_output = self.openstack(
|
|
109
102
|
'project show '
|
|
110
|
-
'--domain
|
|
111
|
-
'
|
|
112
|
-
% {'domain': self.domain_name, 'name': self.project_name}
|
|
103
|
+
f'--domain {self.domain_name} '
|
|
104
|
+
f'{self.project_name}'
|
|
113
105
|
)
|
|
114
106
|
items = self.parse_show(raw_output)
|
|
115
107
|
self.assert_show_fields(items, self.PROJECT_FIELDS)
|
|
@@ -118,9 +110,8 @@ class ProjectTests(common.IdentityTests):
|
|
|
118
110
|
output = self.openstack(
|
|
119
111
|
'project show '
|
|
120
112
|
'--parents --children '
|
|
121
|
-
'--domain
|
|
122
|
-
'
|
|
123
|
-
% {'domain': self.domain_name, 'name': self.project_name},
|
|
113
|
+
f'--domain {self.domain_name} '
|
|
114
|
+
f'{self.project_name}',
|
|
124
115
|
parse_output=True,
|
|
125
116
|
)
|
|
126
117
|
for attr_name in self.PROJECT_FIELDS + ['parents', 'subtree']:
|
|
@@ -23,7 +23,7 @@ class RegionTests(common.IdentityTests):
|
|
|
23
23
|
|
|
24
24
|
def test_region_delete(self):
|
|
25
25
|
region_id = self._create_dummy_region(add_clean_up=False)
|
|
26
|
-
raw_output = self.openstack('region delete
|
|
26
|
+
raw_output = self.openstack(f'region delete {region_id}')
|
|
27
27
|
self.assertEqual(0, len(raw_output))
|
|
28
28
|
|
|
29
29
|
def test_region_multi_delete(self):
|
|
@@ -43,27 +43,26 @@ class RegionTests(common.IdentityTests):
|
|
|
43
43
|
new_parent_region_id = self._create_dummy_region()
|
|
44
44
|
region_id = self._create_dummy_region(parent_region_id)
|
|
45
45
|
# check region details
|
|
46
|
-
raw_output = self.openstack('region show
|
|
46
|
+
raw_output = self.openstack(f'region show {region_id}')
|
|
47
47
|
region = self.parse_show_as_object(raw_output)
|
|
48
48
|
self.assertEqual(parent_region_id, region['parent_region'])
|
|
49
49
|
self.assertEqual(region_id, region['region'])
|
|
50
50
|
# update parent-region
|
|
51
51
|
raw_output = self.openstack(
|
|
52
52
|
'region set '
|
|
53
|
-
'--parent-region
|
|
54
|
-
'
|
|
55
|
-
% {'parent_region': new_parent_region_id, 'region': region_id}
|
|
53
|
+
f'--parent-region {new_parent_region_id} '
|
|
54
|
+
f'{region_id}'
|
|
56
55
|
)
|
|
57
56
|
self.assertEqual(0, len(raw_output))
|
|
58
57
|
# check updated region details
|
|
59
|
-
raw_output = self.openstack('region show
|
|
58
|
+
raw_output = self.openstack(f'region show {region_id}')
|
|
60
59
|
region = self.parse_show_as_object(raw_output)
|
|
61
60
|
self.assertEqual(new_parent_region_id, region['parent_region'])
|
|
62
61
|
self.assertEqual(region_id, region['region'])
|
|
63
62
|
|
|
64
63
|
def test_region_show(self):
|
|
65
64
|
region_id = self._create_dummy_region()
|
|
66
|
-
raw_output = self.openstack('region show
|
|
65
|
+
raw_output = self.openstack(f'region show {region_id}')
|
|
67
66
|
region = self.parse_show_as_object(raw_output)
|
|
68
67
|
self.assertEqual(region_id, region['region'])
|
|
69
68
|
self.assertEqual('None', region['parent_region'])
|