python-openstackclient 7.1.3__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.
Files changed (128) hide show
  1. openstackclient/api/api.py +2 -1
  2. openstackclient/api/image_v2.py +1 -1
  3. openstackclient/api/object_store_v1.py +12 -20
  4. openstackclient/common/clientmanager.py +1 -1
  5. openstackclient/common/module.py +2 -2
  6. openstackclient/common/quota.py +4 -4
  7. openstackclient/compute/v2/flavor.py +1 -1
  8. openstackclient/compute/v2/server.py +122 -59
  9. openstackclient/compute/v2/server_backup.py +1 -1
  10. openstackclient/compute/v2/server_image.py +1 -1
  11. openstackclient/compute/v2/server_migration.py +11 -2
  12. openstackclient/compute/v2/usage.py +3 -3
  13. openstackclient/identity/common.py +1 -1
  14. openstackclient/identity/v2_0/project.py +1 -1
  15. openstackclient/identity/v2_0/role_assignment.py +1 -1
  16. openstackclient/identity/v2_0/user.py +2 -2
  17. openstackclient/identity/v3/access_rule.py +26 -14
  18. openstackclient/identity/v3/identity_provider.py +1 -1
  19. openstackclient/identity/v3/project.py +1 -1
  20. openstackclient/image/v2/image.py +13 -13
  21. openstackclient/image/v2/metadef_objects.py +6 -4
  22. openstackclient/network/common.py +8 -7
  23. openstackclient/network/v2/floating_ip.py +6 -2
  24. openstackclient/network/v2/floating_ip_port_forwarding.py +2 -2
  25. openstackclient/network/v2/l3_conntrack_helper.py +1 -1
  26. openstackclient/network/v2/ndp_proxy.py +1 -0
  27. openstackclient/network/v2/network_agent.py +2 -6
  28. openstackclient/network/v2/network_qos_rule.py +2 -5
  29. openstackclient/network/v2/network_trunk.py +5 -4
  30. openstackclient/network/v2/port.py +18 -3
  31. openstackclient/network/v2/router.py +7 -4
  32. openstackclient/network/v2/subnet_pool.py +2 -2
  33. openstackclient/shell.py +3 -2
  34. openstackclient/tests/functional/common/test_help.py +3 -9
  35. openstackclient/tests/functional/common/test_module.py +1 -1
  36. openstackclient/tests/functional/common/test_quota.py +2 -4
  37. openstackclient/tests/functional/compute/v2/common.py +1 -3
  38. openstackclient/tests/functional/compute/v2/test_hypervisor.py +3 -3
  39. openstackclient/tests/functional/compute/v2/test_keypair.py +2 -2
  40. openstackclient/tests/functional/compute/v2/test_server.py +1 -1
  41. openstackclient/tests/functional/identity/v2/common.py +31 -48
  42. openstackclient/tests/functional/identity/v2/test_catalog.py +1 -1
  43. openstackclient/tests/functional/identity/v2/test_ec2_credentials.py +2 -2
  44. openstackclient/tests/functional/identity/v2/test_endpoint.py +2 -2
  45. openstackclient/tests/functional/identity/v2/test_project.py +8 -8
  46. openstackclient/tests/functional/identity/v2/test_role.py +14 -34
  47. openstackclient/tests/functional/identity/v2/test_service.py +2 -2
  48. openstackclient/tests/functional/identity/v2/test_token.py +1 -1
  49. openstackclient/tests/functional/identity/v2/test_user.py +7 -9
  50. openstackclient/tests/functional/identity/v3/common.py +69 -110
  51. openstackclient/tests/functional/identity/v3/test_access_rule.py +86 -0
  52. openstackclient/tests/functional/identity/v3/test_application_credential.py +18 -44
  53. openstackclient/tests/functional/identity/v3/test_catalog.py +1 -1
  54. openstackclient/tests/functional/identity/v3/test_domain.py +9 -11
  55. openstackclient/tests/functional/identity/v3/test_endpoint.py +15 -27
  56. openstackclient/tests/functional/identity/v3/test_group.py +32 -93
  57. openstackclient/tests/functional/identity/v3/test_idp.py +3 -3
  58. openstackclient/tests/functional/identity/v3/test_limit.py +32 -32
  59. openstackclient/tests/functional/identity/v3/test_project.py +17 -26
  60. openstackclient/tests/functional/identity/v3/test_region.py +6 -7
  61. openstackclient/tests/functional/identity/v3/test_registered_limit.py +27 -36
  62. openstackclient/tests/functional/identity/v3/test_role.py +30 -60
  63. openstackclient/tests/functional/identity/v3/test_role_assignment.py +33 -80
  64. openstackclient/tests/functional/identity/v3/test_service.py +7 -13
  65. openstackclient/tests/functional/identity/v3/test_service_provider.py +3 -3
  66. openstackclient/tests/functional/identity/v3/test_user.py +17 -34
  67. openstackclient/tests/functional/image/v2/test_image.py +1 -3
  68. openstackclient/tests/functional/network/v2/common.py +1 -3
  69. openstackclient/tests/functional/network/v2/test_default_security_group_rule.py +3 -8
  70. openstackclient/tests/functional/network/v2/test_l3_conntrack_helper.py +27 -31
  71. openstackclient/tests/functional/network/v2/test_network.py +9 -12
  72. openstackclient/tests/functional/network/v2/test_network_agent.py +15 -20
  73. openstackclient/tests/functional/network/v2/test_network_flavor.py +2 -2
  74. openstackclient/tests/functional/network/v2/test_network_ndp_proxy.py +17 -39
  75. openstackclient/tests/functional/network/v2/test_network_qos_rule.py +48 -63
  76. openstackclient/tests/functional/network/v2/test_network_qos_rule_type.py +1 -1
  77. openstackclient/tests/functional/network/v2/test_network_segment_range.py +2 -2
  78. openstackclient/tests/functional/network/v2/test_network_trunk.py +15 -25
  79. openstackclient/tests/functional/network/v2/test_port.py +28 -34
  80. openstackclient/tests/functional/network/v2/test_router.py +13 -19
  81. openstackclient/tests/functional/object/v1/test_object.py +4 -7
  82. openstackclient/tests/functional/volume/base.py +5 -17
  83. openstackclient/tests/functional/volume/v1/test_volume_type.py +11 -11
  84. openstackclient/tests/functional/volume/v2/test_volume_backup.py +1 -1
  85. openstackclient/tests/functional/volume/v2/test_volume_type.py +13 -15
  86. openstackclient/tests/functional/volume/v3/test_volume_type.py +13 -15
  87. openstackclient/tests/unit/api/test_compute_v2.py +0 -5
  88. openstackclient/tests/unit/api/test_object_store_v1.py +6 -4
  89. openstackclient/tests/unit/common/test_extension.py +24 -31
  90. openstackclient/tests/unit/compute/v2/test_host.py +0 -1
  91. openstackclient/tests/unit/compute/v2/test_server.py +123 -115
  92. openstackclient/tests/unit/identity/v3/test_access_rule.py +65 -64
  93. openstackclient/tests/unit/identity/v3/test_group.py +4 -10
  94. openstackclient/tests/unit/identity/v3/test_limit.py +2 -2
  95. openstackclient/tests/unit/image/v2/test_metadef_objects.py +1 -2
  96. openstackclient/tests/unit/image/v2/test_metadef_resource_type_association.py +2 -6
  97. openstackclient/tests/unit/integ/base.py +1 -1
  98. openstackclient/tests/unit/network/v2/test_default_security_group_rule.py +3 -3
  99. openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +4 -4
  100. openstackclient/tests/unit/network/v2/test_local_ip_association.py +2 -2
  101. openstackclient/tests/unit/network/v2/test_network_qos_rule.py +12 -13
  102. openstackclient/tests/unit/network/v2/test_network_trunk.py +31 -35
  103. openstackclient/tests/unit/network/v2/test_port.py +40 -17
  104. openstackclient/tests/unit/network/v2/test_subnet_pool.py +1 -1
  105. openstackclient/tests/unit/object/v1/test_object.py +1 -1
  106. openstackclient/tests/unit/utils.py +2 -2
  107. openstackclient/volume/client.py +1 -1
  108. openstackclient/volume/v1/volume.py +2 -2
  109. openstackclient/volume/v1/volume_backup.py +2 -2
  110. openstackclient/volume/v1/volume_snapshot.py +2 -2
  111. openstackclient/volume/v2/volume.py +2 -2
  112. openstackclient/volume/v2/volume_backup.py +2 -2
  113. openstackclient/volume/v2/volume_snapshot.py +2 -2
  114. openstackclient/volume/v2/volume_type.py +4 -4
  115. openstackclient/volume/v3/service.py +0 -1
  116. openstackclient/volume/v3/volume.py +3 -3
  117. openstackclient/volume/v3/volume_backup.py +2 -2
  118. openstackclient/volume/v3/volume_group.py +3 -7
  119. openstackclient/volume/v3/volume_type.py +6 -6
  120. {python_openstackclient-7.1.3.dist-info → python_openstackclient-7.2.0.dist-info}/AUTHORS +3 -0
  121. {python_openstackclient-7.1.3.dist-info → python_openstackclient-7.2.0.dist-info}/METADATA +2 -3
  122. {python_openstackclient-7.1.3.dist-info → python_openstackclient-7.2.0.dist-info}/RECORD +127 -126
  123. python_openstackclient-7.2.0.dist-info/pbr.json +1 -0
  124. python_openstackclient-7.1.3.dist-info/pbr.json +0 -1
  125. {python_openstackclient-7.1.3.dist-info → python_openstackclient-7.2.0.dist-info}/LICENSE +0 -0
  126. {python_openstackclient-7.1.3.dist-info → python_openstackclient-7.2.0.dist-info}/WHEEL +0 -0
  127. {python_openstackclient-7.1.3.dist-info → python_openstackclient-7.2.0.dist-info}/entry_points.txt +0 -0
  128. {python_openstackclient-7.1.3.dist-info → python_openstackclient-7.2.0.dist-info}/top_level.txt +0 -0
@@ -30,9 +30,7 @@ class ImageTests(base.BaseImageTests):
30
30
  self.image_tag = 'my_tag'
31
31
  self.image_tag1 = 'random'
32
32
  output = self.openstack(
33
- 'image create --tag {tag} {name}'.format(
34
- tag=self.image_tag, name=self.name
35
- ),
33
+ f'image create --tag {self.image_tag} {self.name}',
36
34
  parse_output=True,
37
35
  )
38
36
  self.image_id = output["id"]
@@ -80,9 +80,7 @@ class NetworkTagTests(NetworkTests):
80
80
 
81
81
  def _list_tag_check(self, project_id, expected):
82
82
  cmd_output = self.openstack(
83
- '{} list --long --project {}'.format(
84
- self.base_command, project_id
85
- ),
83
+ f'{self.base_command} list --long --project {project_id}',
86
84
  parse_output=True,
87
85
  )
88
86
  for name, tags in expected:
@@ -30,14 +30,9 @@ class SecurityGroupRuleTests(common.NetworkTests):
30
30
  # Create the default security group rule.
31
31
  cmd_output = self.openstack(
32
32
  'default security group rule create '
33
- '--protocol %(protocol)s '
34
- '--dst-port %(port)s:%(port)s '
35
- '--%(direction)s --ethertype IPv4 '
36
- % {
37
- 'protocol': self.protocol,
38
- 'port': self.port,
39
- 'direction': self.direction,
40
- },
33
+ f'--protocol {self.protocol} '
34
+ f'--dst-port {self.port}:{self.port} '
35
+ f'--{self.direction} --ethertype IPv4 ',
41
36
  parse_output=True,
42
37
  )
43
38
  self.addCleanup(
@@ -41,15 +41,14 @@ class L3ConntrackHelperTests(common.NetworkTests):
41
41
  created_helpers = []
42
42
  for helper in helpers:
43
43
  output = self.openstack(
44
- 'network l3 conntrack helper create %(router)s '
45
- '--helper %(helper)s --protocol %(protocol)s '
46
- '--port %(port)s '
47
- % {
48
- 'router': router_id,
49
- 'helper': helper['helper'],
50
- 'protocol': helper['protocol'],
51
- 'port': helper['port'],
52
- },
44
+ 'network l3 conntrack helper create {router} '
45
+ '--helper {helper} --protocol {protocol} '
46
+ '--port {port} '.format(
47
+ router=router_id,
48
+ helper=helper['helper'],
49
+ protocol=helper['protocol'],
50
+ port=helper['port'],
51
+ ),
53
52
  parse_output=True,
54
53
  )
55
54
  self.assertEqual(helper['helper'], output['helper'])
@@ -70,8 +69,8 @@ class L3ConntrackHelperTests(common.NetworkTests):
70
69
  ct_ids = " ".join([ct['id'] for ct in created_helpers])
71
70
 
72
71
  raw_output = self.openstack(
73
- '--debug network l3 conntrack helper delete %(router)s '
74
- '%(ct_ids)s' % {'router': router_id, 'ct_ids': ct_ids}
72
+ f'--debug network l3 conntrack helper delete {router_id} '
73
+ f'{ct_ids}'
75
74
  )
76
75
  self.assertOutput('', raw_output)
77
76
 
@@ -87,7 +86,7 @@ class L3ConntrackHelperTests(common.NetworkTests):
87
86
  router_id = self._create_router()
88
87
  self._create_helpers(router_id, helpers)
89
88
  output = self.openstack(
90
- 'network l3 conntrack helper list %s ' % router_id,
89
+ f'network l3 conntrack helper list {router_id} ',
91
90
  parse_output=True,
92
91
  )
93
92
  for ct in output:
@@ -100,12 +99,11 @@ class L3ConntrackHelperTests(common.NetworkTests):
100
99
  router_id = self._create_router()
101
100
  created_helper = self._create_helpers(router_id, [helper])[0]
102
101
  output = self.openstack(
103
- 'network l3 conntrack helper show %(router_id)s %(ct_id)s '
104
- '-f json'
105
- % {
106
- 'router_id': router_id,
107
- 'ct_id': created_helper['id'],
108
- },
102
+ 'network l3 conntrack helper show {router_id} {ct_id} '
103
+ '-f json'.format(
104
+ router_id=router_id,
105
+ ct_id=created_helper['id'],
106
+ ),
109
107
  parse_output=True,
110
108
  )
111
109
  self.assertEqual(helper['helper'], output['helper'])
@@ -113,23 +111,21 @@ class L3ConntrackHelperTests(common.NetworkTests):
113
111
  self.assertEqual(helper['port'], output['port'])
114
112
 
115
113
  raw_output = self.openstack(
116
- 'network l3 conntrack helper set %(router_id)s %(ct_id)s '
117
- '--port %(port)s '
118
- % {
119
- 'router_id': router_id,
120
- 'ct_id': created_helper['id'],
121
- 'port': helper['port'] + 1,
122
- }
114
+ 'network l3 conntrack helper set {router_id} {ct_id} '
115
+ '--port {port} '.format(
116
+ router_id=router_id,
117
+ ct_id=created_helper['id'],
118
+ port=helper['port'] + 1,
119
+ )
123
120
  )
124
121
  self.assertOutput('', raw_output)
125
122
 
126
123
  output = self.openstack(
127
- 'network l3 conntrack helper show %(router_id)s %(ct_id)s '
128
- '-f json'
129
- % {
130
- 'router_id': router_id,
131
- 'ct_id': created_helper['id'],
132
- },
124
+ 'network l3 conntrack helper show {router_id} {ct_id} '
125
+ '-f json'.format(
126
+ router_id=router_id,
127
+ ct_id=created_helper['id'],
128
+ ),
133
129
  parse_output=True,
134
130
  )
135
131
  self.assertEqual(helper['port'] + 1, output['port'])
@@ -206,7 +206,7 @@ class NetworkTests(common.NetworkTagTests):
206
206
  'network create ' + network_options + name1,
207
207
  parse_output=True,
208
208
  )
209
- self.addCleanup(self.openstack, 'network delete %s' % name1)
209
+ self.addCleanup(self.openstack, f'network delete {name1}')
210
210
  self.assertIsNotNone(cmd_output["id"])
211
211
  if self.haz_network:
212
212
  self.assertEqual(
@@ -342,33 +342,30 @@ class NetworkTests(common.NetworkTagTests):
342
342
 
343
343
  name1 = uuid.uuid4().hex
344
344
  cmd_output = self.openstack(
345
- 'network create --description aaaa %s' % name1,
345
+ f'network create --description aaaa {name1}',
346
346
  parse_output=True,
347
347
  )
348
348
 
349
- self.addCleanup(self.openstack, 'network delete %s' % name1)
349
+ self.addCleanup(self.openstack, f'network delete {name1}')
350
350
 
351
351
  # Get network ID
352
352
  network_id = cmd_output['id']
353
353
 
354
354
  # Add Agent to Network
355
355
  self.openstack(
356
- 'network agent add network --dhcp {} {}'.format(
357
- agent_id, network_id
358
- )
356
+ f'network agent add network --dhcp {agent_id} {network_id}'
359
357
  )
360
358
 
361
359
  # Test network list --agent
362
360
  cmd_output = self.openstack(
363
- 'network list --agent %s' % agent_id,
361
+ f'network list --agent {agent_id}',
364
362
  parse_output=True,
365
363
  )
366
364
 
367
365
  # Cleanup
368
366
  # Remove Agent from Network
369
367
  self.openstack(
370
- 'network agent remove network --dhcp %s %s'
371
- % (agent_id, network_id)
368
+ f'network agent remove network --dhcp {agent_id} {network_id}'
372
369
  )
373
370
 
374
371
  # Assert
@@ -388,10 +385,10 @@ class NetworkTests(common.NetworkTagTests):
388
385
  '--no-share '
389
386
  '--internal '
390
387
  '--no-default '
391
- '--enable-port-security %s' % name,
388
+ f'--enable-port-security {name}',
392
389
  parse_output=True,
393
390
  )
394
- self.addCleanup(self.openstack, 'network delete %s' % name)
391
+ self.addCleanup(self.openstack, f'network delete {name}')
395
392
  self.assertIsNotNone(cmd_output["id"])
396
393
  self.assertEqual(
397
394
  'aaaa',
@@ -416,7 +413,7 @@ class NetworkTests(common.NetworkTagTests):
416
413
  '--disable '
417
414
  '--share '
418
415
  '--external '
419
- '--disable-port-security %s' % name
416
+ f'--disable-port-security {name}'
420
417
  )
421
418
  self.assertOutput('', raw_output)
422
419
 
@@ -42,7 +42,7 @@ class TestAgent(common.NetworkTests):
42
42
 
43
43
  # agent show
44
44
  cmd_output = self.openstack(
45
- 'network agent show %s' % agent_ids[0],
45
+ f'network agent show {agent_ids[0]}',
46
46
  parse_output=True,
47
47
  )
48
48
  self.assertEqual(
@@ -57,12 +57,12 @@ class TestAgent(common.NetworkTests):
57
57
 
58
58
  # agent set
59
59
  raw_output = self.openstack(
60
- 'network agent set --disable %s' % agent_ids[0]
60
+ f'network agent set --disable {agent_ids[0]}'
61
61
  )
62
62
  self.assertOutput('', raw_output)
63
63
 
64
64
  cmd_output = self.openstack(
65
- 'network agent show %s' % agent_ids[0],
65
+ f'network agent show {agent_ids[0]}',
66
66
  parse_output=True,
67
67
  )
68
68
  self.assertEqual(
@@ -71,12 +71,12 @@ class TestAgent(common.NetworkTests):
71
71
  )
72
72
 
73
73
  raw_output = self.openstack(
74
- 'network agent set --enable %s' % agent_ids[0]
74
+ f'network agent set --enable {agent_ids[0]}'
75
75
  )
76
76
  self.assertOutput('', raw_output)
77
77
 
78
78
  cmd_output = self.openstack(
79
- 'network agent show %s' % agent_ids[0],
79
+ f'network agent show {agent_ids[0]}',
80
80
  parse_output=True,
81
81
  )
82
82
  self.assertEqual(
@@ -112,33 +112,30 @@ class TestAgentList(common.NetworkTests):
112
112
 
113
113
  name1 = uuid.uuid4().hex
114
114
  cmd_output = self.openstack(
115
- 'network create --description aaaa %s' % name1,
115
+ f'network create --description aaaa {name1}',
116
116
  parse_output=True,
117
117
  )
118
118
 
119
- self.addCleanup(self.openstack, 'network delete %s' % name1)
119
+ self.addCleanup(self.openstack, f'network delete {name1}')
120
120
 
121
121
  # Get network ID
122
122
  network_id = cmd_output['id']
123
123
 
124
124
  # Add Agent to Network
125
125
  self.openstack(
126
- 'network agent add network --dhcp {} {}'.format(
127
- agent_id, network_id
128
- )
126
+ f'network agent add network --dhcp {agent_id} {network_id}'
129
127
  )
130
128
 
131
129
  # Test network agent list --network
132
130
  cmd_output = self.openstack(
133
- 'network agent list --network %s' % network_id,
131
+ f'network agent list --network {network_id}',
134
132
  parse_output=True,
135
133
  )
136
134
 
137
135
  # Cleanup
138
136
  # Remove Agent from Network
139
137
  self.openstack(
140
- 'network agent remove network --dhcp %s %s'
141
- % (agent_id, network_id)
138
+ f'network agent remove network --dhcp {agent_id} {network_id}'
142
139
  )
143
140
 
144
141
  # Assert
@@ -153,11 +150,11 @@ class TestAgentList(common.NetworkTests):
153
150
 
154
151
  name = uuid.uuid4().hex
155
152
  cmd_output = self.openstack(
156
- 'router create %s' % name,
153
+ f'router create {name}',
157
154
  parse_output=True,
158
155
  )
159
156
 
160
- self.addCleanup(self.openstack, 'router delete %s' % name)
157
+ self.addCleanup(self.openstack, f'router delete {name}')
161
158
  # Get router ID
162
159
  router_id = cmd_output['id']
163
160
  # Get l3 agent id
@@ -175,7 +172,7 @@ class TestAgentList(common.NetworkTests):
175
172
 
176
173
  # Test router list --agent
177
174
  cmd_output = self.openstack(
178
- 'network agent list --router %s' % router_id,
175
+ f'network agent list --router {router_id}',
179
176
  parse_output=True,
180
177
  )
181
178
 
@@ -184,12 +181,10 @@ class TestAgentList(common.NetworkTests):
184
181
 
185
182
  # Remove router from agent
186
183
  self.openstack(
187
- 'network agent remove router --l3 {} {}'.format(
188
- agent_id, router_id
189
- )
184
+ f'network agent remove router --l3 {agent_id} {router_id}'
190
185
  )
191
186
  cmd_output = self.openstack(
192
- 'network agent list --router %s' % router_id,
187
+ f'network agent list --router {router_id}',
193
188
  parse_output=True,
194
189
  )
195
190
  agent_ids = [x['ID'] for x in cmd_output]
@@ -37,10 +37,10 @@ class NetworkFlavorTests(common.NetworkTests):
37
37
  )
38
38
  service_profile_id = cmd_output2.get('id')
39
39
 
40
- self.addCleanup(self.openstack, 'network flavor delete %s' % flavor_id)
40
+ self.addCleanup(self.openstack, f'network flavor delete {flavor_id}')
41
41
  self.addCleanup(
42
42
  self.openstack,
43
- 'network flavor profile delete %s' % service_profile_id,
43
+ f'network flavor profile delete {service_profile_id}',
44
44
  )
45
45
  # Add flavor to service profile
46
46
  self.openstack(
@@ -31,20 +31,15 @@ class L3NDPProxyTests(common.NetworkTests):
31
31
  self.created_ndp_proxies = []
32
32
 
33
33
  json_output = self.openstack(
34
- 'address scope create --ip-version 6 '
35
- '%(address_s_name)s' % {'address_s_name': self.ADDR_SCOPE_NAME},
34
+ 'address scope create --ip-version 6 ' f'{self.ADDR_SCOPE_NAME}',
36
35
  parse_output=True,
37
36
  )
38
37
  self.assertIsNotNone(json_output['id'])
39
38
  self.ADDRESS_SCOPE_ID = json_output['id']
40
39
  json_output = self.openstack(
41
- 'subnet pool create %(subnet_p_name)s '
42
- '--address-scope %(address_scope)s '
43
- '--pool-prefix 2001:db8::/96 --default-prefix-length 112'
44
- % {
45
- 'subnet_p_name': self.SUBNET_P_NAME,
46
- 'address_scope': self.ADDRESS_SCOPE_ID,
47
- },
40
+ f'subnet pool create {self.SUBNET_P_NAME} '
41
+ f'--address-scope {self.ADDRESS_SCOPE_ID} '
42
+ '--pool-prefix 2001:db8::/96 --default-prefix-length 112',
48
43
  parse_output=True,
49
44
  )
50
45
  self.assertIsNotNone(json_output['id'])
@@ -57,12 +52,7 @@ class L3NDPProxyTests(common.NetworkTests):
57
52
  self.EXT_NET_ID = json_output['id']
58
53
  json_output = self.openstack(
59
54
  'subnet create --ip-version 6 --subnet-pool '
60
- '%(subnet_pool)s --network %(net_id)s %(sub_name)s'
61
- % {
62
- 'subnet_pool': self.SUBNET_POOL_ID,
63
- 'net_id': self.EXT_NET_ID,
64
- 'sub_name': self.EXT_SUB_NAME,
65
- },
55
+ f'{self.SUBNET_POOL_ID} --network {self.EXT_NET_ID} {self.EXT_SUB_NAME}',
66
56
  parse_output=True,
67
57
  )
68
58
  self.assertIsNotNone(json_output['id'])
@@ -74,8 +64,7 @@ class L3NDPProxyTests(common.NetworkTests):
74
64
  self.assertIsNotNone(json_output['id'])
75
65
  self.ROT_ID = json_output['id']
76
66
  output = self.openstack(
77
- 'router set %(router_id)s --external-gateway %(net_id)s'
78
- % {'router_id': self.ROT_ID, 'net_id': self.EXT_NET_ID}
67
+ f'router set {self.ROT_ID} --external-gateway {self.EXT_NET_ID}'
79
68
  )
80
69
  self.assertEqual('', output)
81
70
  output = self.openstack('router set --enable-ndp-proxy ' + self.ROT_ID)
@@ -93,23 +82,14 @@ class L3NDPProxyTests(common.NetworkTests):
93
82
  self.INT_NET_ID = json_output['id']
94
83
  json_output = self.openstack(
95
84
  'subnet create --ip-version 6 --subnet-pool '
96
- '%(subnet_pool)s --network %(net_id)s %(sub_name)s'
97
- % {
98
- 'subnet_pool': self.SUBNET_POOL_ID,
99
- 'net_id': self.INT_NET_ID,
100
- 'sub_name': self.INT_SUB_NAME,
101
- },
85
+ f'{self.SUBNET_POOL_ID} --network {self.INT_NET_ID} {self.INT_SUB_NAME}',
102
86
  parse_output=True,
103
87
  )
104
88
  self.assertIsNotNone(json_output['id'])
105
89
  self.INT_SUB_ID = json_output['id']
106
90
  json_output = self.openstack(
107
- 'port create --network %(net_id)s '
108
- '%(port_name)s'
109
- % {
110
- 'net_id': self.INT_NET_ID,
111
- 'port_name': self.INT_PORT_NAME,
112
- },
91
+ f'port create --network {self.INT_NET_ID} '
92
+ f'{self.INT_PORT_NAME}',
113
93
  parse_output=True,
114
94
  )
115
95
  self.assertIsNotNone(json_output['id'])
@@ -161,14 +141,13 @@ class L3NDPProxyTests(common.NetworkTests):
161
141
  def _create_ndp_proxies(self, ndp_proxies):
162
142
  for ndp_proxy in ndp_proxies:
163
143
  output = self.openstack(
164
- 'router ndp proxy create %(router)s --name %(name)s '
165
- '--port %(port)s --ip-address %(address)s'
166
- % {
167
- 'router': ndp_proxy['router_id'],
168
- 'name': ndp_proxy['name'],
169
- 'port': ndp_proxy['port_id'],
170
- 'address': ndp_proxy['address'],
171
- },
144
+ 'router ndp proxy create {router} --name {name} '
145
+ '--port {port} --ip-address {address}'.format(
146
+ router=ndp_proxy['router_id'],
147
+ name=ndp_proxy['name'],
148
+ port=ndp_proxy['port_id'],
149
+ address=ndp_proxy['address'],
150
+ ),
172
151
  parse_output=True,
173
152
  )
174
153
  self.assertEqual(ndp_proxy['router_id'], output['router_id'])
@@ -214,8 +193,7 @@ class L3NDPProxyTests(common.NetworkTests):
214
193
  self._create_ndp_proxies([ndp_proxies])
215
194
  ndp_proxy_id = self.created_ndp_proxies[0]['id']
216
195
  output = self.openstack(
217
- 'router ndp proxy set --description %s %s'
218
- % (description, ndp_proxy_id)
196
+ f'router ndp proxy set --description {description} {ndp_proxy_id}'
219
197
  )
220
198
  self.assertEqual('', output)
221
199
  json_output = self.openstack(