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
|
@@ -275,17 +275,16 @@ class RouterTests(common.NetworkTagTests):
|
|
|
275
275
|
subnet_name = uuid.uuid4().hex
|
|
276
276
|
router_name = uuid.uuid4().hex
|
|
277
277
|
|
|
278
|
-
self.openstack('network create
|
|
279
|
-
self.addCleanup(self.openstack, 'network delete
|
|
278
|
+
self.openstack(f'network create {network_name}')
|
|
279
|
+
self.addCleanup(self.openstack, f'network delete {network_name}')
|
|
280
280
|
|
|
281
281
|
self.openstack(
|
|
282
|
-
'subnet create
|
|
283
|
-
'--network
|
|
284
|
-
% (subnet_name, network_name)
|
|
282
|
+
f'subnet create {subnet_name} '
|
|
283
|
+
f'--network {network_name} --subnet-range 10.0.0.0/24'
|
|
285
284
|
)
|
|
286
285
|
|
|
287
|
-
self.openstack('router create
|
|
288
|
-
self.addCleanup(self.openstack, 'router delete
|
|
286
|
+
self.openstack(f'router create {router_name}')
|
|
287
|
+
self.addCleanup(self.openstack, f'router delete {router_name}')
|
|
289
288
|
|
|
290
289
|
self.openstack(f'router add subnet {router_name} {subnet_name}')
|
|
291
290
|
self.addCleanup(
|
|
@@ -295,24 +294,20 @@ class RouterTests(common.NetworkTagTests):
|
|
|
295
294
|
|
|
296
295
|
out1 = (
|
|
297
296
|
self.openstack(
|
|
298
|
-
'router add route
|
|
299
|
-
'--route destination=10.0.10.0/24,gateway=10.0.0.10'
|
|
300
|
-
% router_name,
|
|
297
|
+
f'router add route {router_name} '
|
|
298
|
+
'--route destination=10.0.10.0/24,gateway=10.0.0.10',
|
|
301
299
|
parse_output=True,
|
|
302
300
|
),
|
|
303
301
|
)
|
|
304
302
|
self.assertEqual(1, len(out1[0]['routes']))
|
|
305
303
|
|
|
306
|
-
self.addCleanup(
|
|
307
|
-
self.openstack, 'router set %s --no-route' % router_name
|
|
308
|
-
)
|
|
304
|
+
self.addCleanup(self.openstack, f'router set {router_name} --no-route')
|
|
309
305
|
|
|
310
306
|
out2 = (
|
|
311
307
|
self.openstack(
|
|
312
|
-
'router add route
|
|
308
|
+
f'router add route {router_name} '
|
|
313
309
|
'--route destination=10.0.10.0/24,gateway=10.0.0.10 '
|
|
314
|
-
'--route destination=10.0.11.0/24,gateway=10.0.0.11'
|
|
315
|
-
% router_name,
|
|
310
|
+
'--route destination=10.0.11.0/24,gateway=10.0.0.11',
|
|
316
311
|
parse_output=True,
|
|
317
312
|
),
|
|
318
313
|
)
|
|
@@ -320,10 +315,9 @@ class RouterTests(common.NetworkTagTests):
|
|
|
320
315
|
|
|
321
316
|
out3 = (
|
|
322
317
|
self.openstack(
|
|
323
|
-
'router remove route
|
|
318
|
+
f'router remove route {router_name} '
|
|
324
319
|
'--route destination=10.0.11.0/24,gateway=10.0.0.11 '
|
|
325
|
-
'--route destination=10.0.12.0/24,gateway=10.0.0.12'
|
|
326
|
-
% router_name,
|
|
320
|
+
'--route destination=10.0.12.0/24,gateway=10.0.0.12',
|
|
327
321
|
parse_output=True,
|
|
328
322
|
),
|
|
329
323
|
)
|
|
@@ -59,7 +59,7 @@ class ObjectTests(common.ObjectStoreTests):
|
|
|
59
59
|
items = self.parse_listing(raw_output)
|
|
60
60
|
self.assert_show_fields(items, OBJECT_FIELDS)
|
|
61
61
|
|
|
62
|
-
raw_output = self.openstack('object list
|
|
62
|
+
raw_output = self.openstack(f'object list {self.CONTAINER_NAME}')
|
|
63
63
|
items = self.parse_listing(raw_output)
|
|
64
64
|
self.assert_table_structure(items, BASIC_LIST_HEADERS)
|
|
65
65
|
|
|
@@ -69,15 +69,12 @@ class ObjectTests(common.ObjectStoreTests):
|
|
|
69
69
|
tmp_file = 'tmp.txt'
|
|
70
70
|
self.addCleanup(os.remove, tmp_file)
|
|
71
71
|
self.openstack(
|
|
72
|
-
'object save
|
|
73
|
-
% (self.CONTAINER_NAME, object_file, tmp_file)
|
|
72
|
+
f'object save {self.CONTAINER_NAME} {object_file} --file {tmp_file}'
|
|
74
73
|
)
|
|
75
74
|
# TODO(stevemar): Assert returned fields
|
|
76
75
|
|
|
77
76
|
raw_output = self.openstack(
|
|
78
|
-
'object save {} {} --file -'
|
|
79
|
-
self.CONTAINER_NAME, object_file
|
|
80
|
-
)
|
|
77
|
+
f'object save {self.CONTAINER_NAME} {object_file} --file -'
|
|
81
78
|
)
|
|
82
79
|
self.assertEqual(raw_output, 'test content')
|
|
83
80
|
|
|
@@ -91,6 +88,6 @@ class ObjectTests(common.ObjectStoreTests):
|
|
|
91
88
|
|
|
92
89
|
self.openstack(f'object create {self.CONTAINER_NAME} {object_file}')
|
|
93
90
|
raw_output = self.openstack(
|
|
94
|
-
'container delete -r
|
|
91
|
+
f'container delete -r {self.CONTAINER_NAME}'
|
|
95
92
|
)
|
|
96
93
|
self.assertEqual(0, len(raw_output))
|
|
@@ -40,21 +40,15 @@ class BaseVolumeTests(base.TestCase):
|
|
|
40
40
|
current_status = output['status']
|
|
41
41
|
if current_status == desired_status:
|
|
42
42
|
print(
|
|
43
|
-
'{} {} now has status {}'
|
|
44
|
-
check_type, check_name, current_status
|
|
45
|
-
)
|
|
43
|
+
f'{check_type} {check_name} now has status {current_status}'
|
|
46
44
|
)
|
|
47
45
|
return
|
|
48
46
|
print(
|
|
49
|
-
'Checking {} {} Waiting for {} current status: {}'
|
|
50
|
-
check_type, check_name, desired_status, current_status
|
|
51
|
-
)
|
|
47
|
+
f'Checking {check_type} {check_name} Waiting for {desired_status} current status: {current_status}'
|
|
52
48
|
)
|
|
53
49
|
if current_status in failures:
|
|
54
50
|
raise Exception(
|
|
55
|
-
'Current status {} of {} {} is one of failures {}'
|
|
56
|
-
current_status, check_type, check_name, failures
|
|
57
|
-
)
|
|
51
|
+
f'Current status {current_status} of {check_type} {check_name} is one of failures {failures}'
|
|
58
52
|
)
|
|
59
53
|
time.sleep(interval)
|
|
60
54
|
total_sleep += interval
|
|
@@ -72,15 +66,9 @@ class BaseVolumeTests(base.TestCase):
|
|
|
72
66
|
if check_name not in names:
|
|
73
67
|
print(f'{check_type} {check_name} is now deleted')
|
|
74
68
|
return
|
|
75
|
-
print(
|
|
76
|
-
'Checking {} {} Waiting for deleted'.format(
|
|
77
|
-
check_type, check_name
|
|
78
|
-
)
|
|
79
|
-
)
|
|
69
|
+
print(f'Checking {check_type} {check_name} Waiting for deleted')
|
|
80
70
|
time.sleep(interval)
|
|
81
71
|
total_sleep += interval
|
|
82
72
|
raise Exception(
|
|
83
|
-
'Timeout: {} {} was not deleted in {} seconds'
|
|
84
|
-
check_type, check_name, wait
|
|
85
|
-
)
|
|
73
|
+
f'Timeout: {check_type} {check_name} was not deleted in {wait} seconds'
|
|
86
74
|
)
|
|
@@ -32,7 +32,7 @@ class VolumeTypeTests(common.BaseVolumeTests):
|
|
|
32
32
|
self.assertEqual(name, cmd_output['name'])
|
|
33
33
|
|
|
34
34
|
cmd_output = self.openstack(
|
|
35
|
-
'volume type show
|
|
35
|
+
f'volume type show {name}',
|
|
36
36
|
parse_output=True,
|
|
37
37
|
)
|
|
38
38
|
self.assertEqual(self.NAME, cmd_output['name'])
|
|
@@ -57,19 +57,19 @@ class VolumeTypeTests(common.BaseVolumeTests):
|
|
|
57
57
|
self.assertEqual(name, cmd_output['name'])
|
|
58
58
|
|
|
59
59
|
raw_output = self.openstack(
|
|
60
|
-
'volume type set --property a=b --property c=d
|
|
60
|
+
f'volume type set --property a=b --property c=d {name}'
|
|
61
61
|
)
|
|
62
62
|
self.assertEqual("", raw_output)
|
|
63
63
|
cmd_output = self.openstack(
|
|
64
|
-
'volume type show
|
|
64
|
+
f'volume type show {name}',
|
|
65
65
|
parse_output=True,
|
|
66
66
|
)
|
|
67
67
|
self.assertEqual({'a': 'b', 'c': 'd'}, cmd_output['properties'])
|
|
68
68
|
|
|
69
|
-
raw_output = self.openstack('volume type unset --property a
|
|
69
|
+
raw_output = self.openstack(f'volume type unset --property a {name}')
|
|
70
70
|
self.assertEqual("", raw_output)
|
|
71
71
|
cmd_output = self.openstack(
|
|
72
|
-
'volume type show
|
|
72
|
+
f'volume type show {name}',
|
|
73
73
|
parse_output=True,
|
|
74
74
|
)
|
|
75
75
|
self.assertEqual({'c': 'd'}, cmd_output['properties'])
|
|
@@ -84,21 +84,21 @@ class VolumeTypeTests(common.BaseVolumeTests):
|
|
|
84
84
|
self.assertEqual(name, cmd_output['name'])
|
|
85
85
|
|
|
86
86
|
raw_output = self.openstack(
|
|
87
|
-
'volume type set --property a=b --property c=d
|
|
87
|
+
f'volume type set --property a=b --property c=d {name}'
|
|
88
88
|
)
|
|
89
89
|
self.assertEqual("", raw_output)
|
|
90
90
|
cmd_output = self.openstack(
|
|
91
|
-
'volume type show
|
|
91
|
+
f'volume type show {name}',
|
|
92
92
|
parse_output=True,
|
|
93
93
|
)
|
|
94
94
|
self.assertEqual({'a': 'b', 'c': 'd'}, cmd_output['properties'])
|
|
95
95
|
|
|
96
96
|
raw_output = self.openstack(
|
|
97
|
-
'volume type unset --property a --property c
|
|
97
|
+
f'volume type unset --property a --property c {name}'
|
|
98
98
|
)
|
|
99
99
|
self.assertEqual("", raw_output)
|
|
100
100
|
cmd_output = self.openstack(
|
|
101
|
-
'volume type show
|
|
101
|
+
f'volume type show {name}',
|
|
102
102
|
parse_output=True,
|
|
103
103
|
)
|
|
104
104
|
self.assertEqual({}, cmd_output['properties'])
|
|
@@ -106,9 +106,9 @@ class VolumeTypeTests(common.BaseVolumeTests):
|
|
|
106
106
|
def test_multi_delete(self):
|
|
107
107
|
vol_type1 = uuid.uuid4().hex
|
|
108
108
|
vol_type2 = uuid.uuid4().hex
|
|
109
|
-
self.openstack('volume type create
|
|
109
|
+
self.openstack(f'volume type create {vol_type1}')
|
|
110
110
|
time.sleep(5)
|
|
111
|
-
self.openstack('volume type create
|
|
111
|
+
self.openstack(f'volume type create {vol_type2}')
|
|
112
112
|
time.sleep(5)
|
|
113
113
|
cmd = f'volume type delete {vol_type1} {vol_type2}'
|
|
114
114
|
raw_output = self.openstack(cmd)
|
|
@@ -32,7 +32,7 @@ class VolumeTypeTests(common.BaseVolumeTests):
|
|
|
32
32
|
self.assertEqual(name, cmd_output['name'])
|
|
33
33
|
|
|
34
34
|
cmd_output = self.openstack(
|
|
35
|
-
'volume type show
|
|
35
|
+
f'volume type show {name}',
|
|
36
36
|
parse_output=True,
|
|
37
37
|
)
|
|
38
38
|
self.assertEqual(name, cmd_output['name'])
|
|
@@ -57,19 +57,19 @@ class VolumeTypeTests(common.BaseVolumeTests):
|
|
|
57
57
|
self.assertEqual(name, cmd_output['name'])
|
|
58
58
|
|
|
59
59
|
raw_output = self.openstack(
|
|
60
|
-
'volume type set --property a=b --property c=d
|
|
60
|
+
f'volume type set --property a=b --property c=d {name}'
|
|
61
61
|
)
|
|
62
62
|
self.assertEqual("", raw_output)
|
|
63
63
|
cmd_output = self.openstack(
|
|
64
|
-
'volume type show
|
|
64
|
+
f'volume type show {name}',
|
|
65
65
|
parse_output=True,
|
|
66
66
|
)
|
|
67
67
|
self.assertEqual({'a': 'b', 'c': 'd'}, cmd_output['properties'])
|
|
68
68
|
|
|
69
|
-
raw_output = self.openstack('volume type unset --property a
|
|
69
|
+
raw_output = self.openstack(f'volume type unset --property a {name}')
|
|
70
70
|
self.assertEqual("", raw_output)
|
|
71
71
|
cmd_output = self.openstack(
|
|
72
|
-
'volume type show
|
|
72
|
+
f'volume type show {name}',
|
|
73
73
|
parse_output=True,
|
|
74
74
|
)
|
|
75
75
|
self.assertEqual({'c': 'd'}, cmd_output['properties'])
|
|
@@ -84,21 +84,21 @@ class VolumeTypeTests(common.BaseVolumeTests):
|
|
|
84
84
|
self.assertEqual(name, cmd_output['name'])
|
|
85
85
|
|
|
86
86
|
raw_output = self.openstack(
|
|
87
|
-
'volume type set --property a=b --property c=d
|
|
87
|
+
f'volume type set --property a=b --property c=d {name}'
|
|
88
88
|
)
|
|
89
89
|
self.assertEqual("", raw_output)
|
|
90
90
|
cmd_output = self.openstack(
|
|
91
|
-
'volume type show
|
|
91
|
+
f'volume type show {name}',
|
|
92
92
|
parse_output=True,
|
|
93
93
|
)
|
|
94
94
|
self.assertEqual({'a': 'b', 'c': 'd'}, cmd_output['properties'])
|
|
95
95
|
|
|
96
96
|
raw_output = self.openstack(
|
|
97
|
-
'volume type unset --property a --property c
|
|
97
|
+
f'volume type unset --property a --property c {name}'
|
|
98
98
|
)
|
|
99
99
|
self.assertEqual("", raw_output)
|
|
100
100
|
cmd_output = self.openstack(
|
|
101
|
-
'volume type show
|
|
101
|
+
f'volume type show {name}',
|
|
102
102
|
parse_output=True,
|
|
103
103
|
)
|
|
104
104
|
self.assertEqual({}, cmd_output['properties'])
|
|
@@ -112,22 +112,20 @@ class VolumeTypeTests(common.BaseVolumeTests):
|
|
|
112
112
|
self.addCleanup(self.openstack, 'volume type delete ' + name)
|
|
113
113
|
self.assertEqual(name, cmd_output['name'])
|
|
114
114
|
|
|
115
|
-
raw_output = self.openstack(
|
|
116
|
-
'volume type set --project admin %s' % name
|
|
117
|
-
)
|
|
115
|
+
raw_output = self.openstack(f'volume type set --project admin {name}')
|
|
118
116
|
self.assertEqual("", raw_output)
|
|
119
117
|
|
|
120
118
|
raw_output = self.openstack(
|
|
121
|
-
'volume type unset --project admin
|
|
119
|
+
f'volume type unset --project admin {name}'
|
|
122
120
|
)
|
|
123
121
|
self.assertEqual("", raw_output)
|
|
124
122
|
|
|
125
123
|
def test_multi_delete(self):
|
|
126
124
|
vol_type1 = uuid.uuid4().hex
|
|
127
125
|
vol_type2 = uuid.uuid4().hex
|
|
128
|
-
self.openstack('volume type create
|
|
126
|
+
self.openstack(f'volume type create {vol_type1}')
|
|
129
127
|
time.sleep(5)
|
|
130
|
-
self.openstack('volume type create
|
|
128
|
+
self.openstack(f'volume type create {vol_type2}')
|
|
131
129
|
time.sleep(5)
|
|
132
130
|
cmd = f'volume type delete {vol_type1} {vol_type2}'
|
|
133
131
|
raw_output = self.openstack(cmd)
|
|
@@ -32,7 +32,7 @@ class VolumeTypeTests(common.BaseVolumeTests):
|
|
|
32
32
|
self.assertEqual(name, cmd_output['name'])
|
|
33
33
|
|
|
34
34
|
cmd_output = self.openstack(
|
|
35
|
-
'volume type show
|
|
35
|
+
f'volume type show {name}',
|
|
36
36
|
parse_output=True,
|
|
37
37
|
)
|
|
38
38
|
self.assertEqual(name, cmd_output['name'])
|
|
@@ -57,19 +57,19 @@ class VolumeTypeTests(common.BaseVolumeTests):
|
|
|
57
57
|
self.assertEqual(name, cmd_output['name'])
|
|
58
58
|
|
|
59
59
|
raw_output = self.openstack(
|
|
60
|
-
'volume type set --property a=b --property c=d
|
|
60
|
+
f'volume type set --property a=b --property c=d {name}'
|
|
61
61
|
)
|
|
62
62
|
self.assertEqual("", raw_output)
|
|
63
63
|
cmd_output = self.openstack(
|
|
64
|
-
'volume type show
|
|
64
|
+
f'volume type show {name}',
|
|
65
65
|
parse_output=True,
|
|
66
66
|
)
|
|
67
67
|
self.assertEqual({'a': 'b', 'c': 'd'}, cmd_output['properties'])
|
|
68
68
|
|
|
69
|
-
raw_output = self.openstack('volume type unset --property a
|
|
69
|
+
raw_output = self.openstack(f'volume type unset --property a {name}')
|
|
70
70
|
self.assertEqual("", raw_output)
|
|
71
71
|
cmd_output = self.openstack(
|
|
72
|
-
'volume type show
|
|
72
|
+
f'volume type show {name}',
|
|
73
73
|
parse_output=True,
|
|
74
74
|
)
|
|
75
75
|
self.assertEqual({'c': 'd'}, cmd_output['properties'])
|
|
@@ -84,21 +84,21 @@ class VolumeTypeTests(common.BaseVolumeTests):
|
|
|
84
84
|
self.assertEqual(name, cmd_output['name'])
|
|
85
85
|
|
|
86
86
|
raw_output = self.openstack(
|
|
87
|
-
'volume type set --property a=b --property c=d
|
|
87
|
+
f'volume type set --property a=b --property c=d {name}'
|
|
88
88
|
)
|
|
89
89
|
self.assertEqual("", raw_output)
|
|
90
90
|
cmd_output = self.openstack(
|
|
91
|
-
'volume type show
|
|
91
|
+
f'volume type show {name}',
|
|
92
92
|
parse_output=True,
|
|
93
93
|
)
|
|
94
94
|
self.assertEqual({'a': 'b', 'c': 'd'}, cmd_output['properties'])
|
|
95
95
|
|
|
96
96
|
raw_output = self.openstack(
|
|
97
|
-
'volume type unset --property a --property c
|
|
97
|
+
f'volume type unset --property a --property c {name}'
|
|
98
98
|
)
|
|
99
99
|
self.assertEqual("", raw_output)
|
|
100
100
|
cmd_output = self.openstack(
|
|
101
|
-
'volume type show
|
|
101
|
+
f'volume type show {name}',
|
|
102
102
|
parse_output=True,
|
|
103
103
|
)
|
|
104
104
|
self.assertEqual({}, cmd_output['properties'])
|
|
@@ -112,22 +112,20 @@ class VolumeTypeTests(common.BaseVolumeTests):
|
|
|
112
112
|
self.addCleanup(self.openstack, 'volume type delete ' + name)
|
|
113
113
|
self.assertEqual(name, cmd_output['name'])
|
|
114
114
|
|
|
115
|
-
raw_output = self.openstack(
|
|
116
|
-
'volume type set --project admin %s' % name
|
|
117
|
-
)
|
|
115
|
+
raw_output = self.openstack(f'volume type set --project admin {name}')
|
|
118
116
|
self.assertEqual("", raw_output)
|
|
119
117
|
|
|
120
118
|
raw_output = self.openstack(
|
|
121
|
-
'volume type unset --project admin
|
|
119
|
+
f'volume type unset --project admin {name}'
|
|
122
120
|
)
|
|
123
121
|
self.assertEqual("", raw_output)
|
|
124
122
|
|
|
125
123
|
def test_multi_delete(self):
|
|
126
124
|
vol_type1 = uuid.uuid4().hex
|
|
127
125
|
vol_type2 = uuid.uuid4().hex
|
|
128
|
-
self.openstack('volume type create
|
|
126
|
+
self.openstack(f'volume type create {vol_type1}')
|
|
129
127
|
time.sleep(5)
|
|
130
|
-
self.openstack('volume type create
|
|
128
|
+
self.openstack(f'volume type create {vol_type2}')
|
|
131
129
|
time.sleep(5)
|
|
132
130
|
cmd = f'volume type delete {vol_type1} {vol_type2}'
|
|
133
131
|
raw_output = self.openstack(cmd)
|
|
@@ -26,7 +26,6 @@ from openstackclient.tests.unit import utils
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
class TestSecurityGroup(utils.TestCase):
|
|
29
|
-
|
|
30
29
|
def setUp(self):
|
|
31
30
|
super().setUp()
|
|
32
31
|
|
|
@@ -227,7 +226,6 @@ class TestSecurityGroup(utils.TestCase):
|
|
|
227
226
|
|
|
228
227
|
|
|
229
228
|
class TestSecurityGroupRule(utils.TestCase):
|
|
230
|
-
|
|
231
229
|
def setUp(self):
|
|
232
230
|
super().setUp()
|
|
233
231
|
|
|
@@ -290,7 +288,6 @@ class TestSecurityGroupRule(utils.TestCase):
|
|
|
290
288
|
|
|
291
289
|
|
|
292
290
|
class TestNetwork(utils.TestCase):
|
|
293
|
-
|
|
294
291
|
def setUp(self):
|
|
295
292
|
super().setUp()
|
|
296
293
|
|
|
@@ -457,7 +454,6 @@ class TestNetwork(utils.TestCase):
|
|
|
457
454
|
|
|
458
455
|
|
|
459
456
|
class TestFloatingIP(utils.TestCase):
|
|
460
|
-
|
|
461
457
|
def setUp(self):
|
|
462
458
|
super().setUp()
|
|
463
459
|
|
|
@@ -547,7 +543,6 @@ class TestFloatingIP(utils.TestCase):
|
|
|
547
543
|
|
|
548
544
|
|
|
549
545
|
class TestFloatingIPPool(utils.TestCase):
|
|
550
|
-
|
|
551
546
|
def setUp(self):
|
|
552
547
|
super().setUp()
|
|
553
548
|
|
|
@@ -135,16 +135,18 @@ class TestContainer(TestObjectAPIv1):
|
|
|
135
135
|
self.requests_mock.register_uri(
|
|
136
136
|
'GET',
|
|
137
137
|
FAKE_URL
|
|
138
|
-
+ '?marker
|
|
139
|
-
|
|
138
|
+
+ '?marker={}&limit=1&format=json'.format(
|
|
139
|
+
LIST_CONTAINER_RESP[0]['name']
|
|
140
|
+
),
|
|
140
141
|
json=[LIST_CONTAINER_RESP[1]],
|
|
141
142
|
status_code=200,
|
|
142
143
|
)
|
|
143
144
|
self.requests_mock.register_uri(
|
|
144
145
|
'GET',
|
|
145
146
|
FAKE_URL
|
|
146
|
-
+ '?marker
|
|
147
|
-
|
|
147
|
+
+ '?marker={}&limit=1&format=json'.format(
|
|
148
|
+
LIST_CONTAINER_RESP[1]['name']
|
|
149
|
+
),
|
|
148
150
|
json=[],
|
|
149
151
|
status_code=200,
|
|
150
152
|
)
|
|
@@ -14,7 +14,6 @@ from unittest import mock
|
|
|
14
14
|
|
|
15
15
|
from openstackclient.common import extension
|
|
16
16
|
from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes
|
|
17
|
-
from openstackclient.tests.unit import fakes
|
|
18
17
|
from openstackclient.tests.unit.identity.v2_0 import fakes as identity_fakes
|
|
19
18
|
from openstackclient.tests.unit.network.v2 import fakes as network_fakes
|
|
20
19
|
from openstackclient.tests.unit import utils
|
|
@@ -22,23 +21,13 @@ from openstackclient.tests.unit import utils as tests_utils
|
|
|
22
21
|
from openstackclient.tests.unit.volume.v3 import fakes as volume_fakes
|
|
23
22
|
|
|
24
23
|
|
|
25
|
-
class TestExtension(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
)
|
|
33
|
-
self.app.client_manager.identity = identity_client
|
|
34
|
-
self.identity_extensions_mock = identity_client.extensions
|
|
35
|
-
self.identity_extensions_mock.reset_mock()
|
|
36
|
-
|
|
37
|
-
sdk_connection = self.app.client_manager.sdk_connection
|
|
38
|
-
self.compute_extensions_mock = sdk_connection.compute.extensions
|
|
39
|
-
self.compute_extensions_mock.reset_mock()
|
|
40
|
-
self.volume_extensions_mock = sdk_connection.volume.extensions
|
|
41
|
-
self.volume_extensions_mock.reset_mock()
|
|
24
|
+
class TestExtension(
|
|
25
|
+
network_fakes.FakeClientMixin,
|
|
26
|
+
compute_fakes.FakeClientMixin,
|
|
27
|
+
volume_fakes.FakeClientMixin,
|
|
28
|
+
identity_fakes.FakeClientMixin,
|
|
29
|
+
utils.TestCommand,
|
|
30
|
+
): ...
|
|
42
31
|
|
|
43
32
|
|
|
44
33
|
class TestExtensionList(TestExtension):
|
|
@@ -60,11 +49,15 @@ class TestExtensionList(TestExtension):
|
|
|
60
49
|
def setUp(self):
|
|
61
50
|
super().setUp()
|
|
62
51
|
|
|
63
|
-
self.
|
|
52
|
+
self.identity_client.extensions.list.return_value = [
|
|
64
53
|
self.identity_extension
|
|
65
54
|
]
|
|
66
|
-
self.
|
|
67
|
-
|
|
55
|
+
self.compute_sdk_client.extensions.return_value = [
|
|
56
|
+
self.compute_extension
|
|
57
|
+
]
|
|
58
|
+
self.volume_sdk_client.extensions.return_value = [
|
|
59
|
+
self.volume_extension
|
|
60
|
+
]
|
|
68
61
|
self.network_client.extensions.return_value = [self.network_extension]
|
|
69
62
|
|
|
70
63
|
# Get the command object to test
|
|
@@ -112,9 +105,9 @@ class TestExtensionList(TestExtension):
|
|
|
112
105
|
),
|
|
113
106
|
)
|
|
114
107
|
self._test_extension_list_helper(arglist, verifylist, datalist)
|
|
115
|
-
self.
|
|
116
|
-
self.
|
|
117
|
-
self.
|
|
108
|
+
self.identity_client.extensions.list.assert_called_with()
|
|
109
|
+
self.compute_sdk_client.extensions.assert_called_with()
|
|
110
|
+
self.volume_sdk_client.extensions.assert_called_with()
|
|
118
111
|
self.network_client.extensions.assert_called_with()
|
|
119
112
|
|
|
120
113
|
def test_extension_list_long(self):
|
|
@@ -159,9 +152,9 @@ class TestExtensionList(TestExtension):
|
|
|
159
152
|
),
|
|
160
153
|
)
|
|
161
154
|
self._test_extension_list_helper(arglist, verifylist, datalist, True)
|
|
162
|
-
self.
|
|
163
|
-
self.
|
|
164
|
-
self.
|
|
155
|
+
self.identity_client.extensions.list.assert_called_with()
|
|
156
|
+
self.compute_sdk_client.extensions.assert_called_with()
|
|
157
|
+
self.volume_sdk_client.extensions.assert_called_with()
|
|
165
158
|
self.network_client.extensions.assert_called_with()
|
|
166
159
|
|
|
167
160
|
def test_extension_list_identity(self):
|
|
@@ -179,7 +172,7 @@ class TestExtensionList(TestExtension):
|
|
|
179
172
|
),
|
|
180
173
|
)
|
|
181
174
|
self._test_extension_list_helper(arglist, verifylist, datalist)
|
|
182
|
-
self.
|
|
175
|
+
self.identity_client.extensions.list.assert_called_with()
|
|
183
176
|
|
|
184
177
|
def test_extension_list_network(self):
|
|
185
178
|
arglist = [
|
|
@@ -237,7 +230,7 @@ class TestExtensionList(TestExtension):
|
|
|
237
230
|
),
|
|
238
231
|
)
|
|
239
232
|
self._test_extension_list_helper(arglist, verifylist, datalist)
|
|
240
|
-
self.
|
|
233
|
+
self.compute_sdk_client.extensions.assert_called_with()
|
|
241
234
|
|
|
242
235
|
def test_extension_list_compute_and_network(self):
|
|
243
236
|
arglist = [
|
|
@@ -261,7 +254,7 @@ class TestExtensionList(TestExtension):
|
|
|
261
254
|
),
|
|
262
255
|
)
|
|
263
256
|
self._test_extension_list_helper(arglist, verifylist, datalist)
|
|
264
|
-
self.
|
|
257
|
+
self.compute_sdk_client.extensions.assert_called_with()
|
|
265
258
|
self.network_client.extensions.assert_called_with()
|
|
266
259
|
|
|
267
260
|
def test_extension_list_volume(self):
|
|
@@ -279,7 +272,7 @@ class TestExtensionList(TestExtension):
|
|
|
279
272
|
),
|
|
280
273
|
)
|
|
281
274
|
self._test_extension_list_helper(arglist, verifylist, datalist)
|
|
282
|
-
self.
|
|
275
|
+
self.volume_sdk_client.extensions.assert_called_with()
|
|
283
276
|
|
|
284
277
|
|
|
285
278
|
class TestExtensionShow(TestExtension):
|