python-openstackclient 7.4.0__py3-none-any.whl → 8.0.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 (234) hide show
  1. openstackclient/common/availability_zone.py +3 -6
  2. openstackclient/common/clientmanager.py +2 -1
  3. openstackclient/common/envvars.py +57 -0
  4. openstackclient/common/extension.py +3 -11
  5. openstackclient/common/limits.py +1 -1
  6. openstackclient/common/project_cleanup.py +3 -2
  7. openstackclient/common/quota.py +54 -28
  8. openstackclient/compute/client.py +2 -5
  9. openstackclient/compute/v2/agent.py +5 -5
  10. openstackclient/compute/v2/aggregate.py +17 -15
  11. openstackclient/compute/v2/console.py +3 -4
  12. openstackclient/compute/v2/flavor.py +14 -18
  13. openstackclient/compute/v2/host.py +3 -3
  14. openstackclient/compute/v2/hypervisor.py +10 -4
  15. openstackclient/compute/v2/hypervisor_stats.py +1 -1
  16. openstackclient/compute/v2/keypair.py +8 -10
  17. openstackclient/compute/v2/server.py +70 -112
  18. openstackclient/compute/v2/server_backup.py +1 -1
  19. openstackclient/compute/v2/server_event.py +7 -16
  20. openstackclient/compute/v2/server_group.py +6 -6
  21. openstackclient/compute/v2/server_image.py +1 -1
  22. openstackclient/compute/v2/server_migration.py +6 -6
  23. openstackclient/compute/v2/server_volume.py +4 -4
  24. openstackclient/compute/v2/service.py +9 -13
  25. openstackclient/compute/v2/usage.py +4 -6
  26. openstackclient/identity/client.py +2 -4
  27. openstackclient/identity/common.py +16 -17
  28. openstackclient/identity/v2_0/ec2creds.py +4 -3
  29. openstackclient/identity/v2_0/endpoint.py +12 -10
  30. openstackclient/identity/v2_0/project.py +6 -6
  31. openstackclient/identity/v2_0/role.py +1 -1
  32. openstackclient/identity/v2_0/service.py +7 -7
  33. openstackclient/identity/v2_0/user.py +6 -21
  34. openstackclient/identity/v3/access_rule.py +2 -5
  35. openstackclient/identity/v3/consumer.py +4 -3
  36. openstackclient/identity/v3/credential.py +6 -7
  37. openstackclient/identity/v3/domain.py +1 -1
  38. openstackclient/identity/v3/ec2creds.py +4 -3
  39. openstackclient/identity/v3/endpoint.py +104 -88
  40. openstackclient/identity/v3/endpoint_group.py +1 -1
  41. openstackclient/identity/v3/group.py +3 -4
  42. openstackclient/identity/v3/identity_provider.py +1 -2
  43. openstackclient/identity/v3/limit.py +4 -9
  44. openstackclient/identity/v3/mapping.py +4 -3
  45. openstackclient/identity/v3/policy.py +5 -8
  46. openstackclient/identity/v3/project.py +6 -6
  47. openstackclient/identity/v3/region.py +2 -5
  48. openstackclient/identity/v3/registered_limit.py +4 -8
  49. openstackclient/identity/v3/role.py +15 -16
  50. openstackclient/identity/v3/service.py +8 -8
  51. openstackclient/identity/v3/service_provider.py +3 -6
  52. openstackclient/identity/v3/tag.py +2 -2
  53. openstackclient/identity/v3/token.py +1 -2
  54. openstackclient/identity/v3/trust.py +74 -25
  55. openstackclient/identity/v3/user.py +9 -6
  56. openstackclient/image/client.py +2 -5
  57. openstackclient/image/v1/image.py +11 -15
  58. openstackclient/image/v2/cache.py +2 -4
  59. openstackclient/image/v2/image.py +30 -37
  60. openstackclient/image/v2/metadef_namespaces.py +4 -3
  61. openstackclient/image/v2/metadef_resource_type_association.py +1 -2
  62. openstackclient/image/v2/metadef_resource_types.py +1 -2
  63. openstackclient/locale/tr_TR/LC_MESSAGES/openstackclient.po +9 -1370
  64. openstackclient/network/client.py +4 -10
  65. openstackclient/network/common.py +16 -12
  66. openstackclient/network/utils.py +3 -3
  67. openstackclient/network/v2/address_group.py +5 -9
  68. openstackclient/network/v2/address_scope.py +2 -3
  69. openstackclient/network/v2/default_security_group_rule.py +1 -2
  70. openstackclient/network/v2/floating_ip.py +14 -21
  71. openstackclient/network/v2/floating_ip_port_forwarding.py +7 -7
  72. openstackclient/network/v2/ip_availability.py +1 -2
  73. openstackclient/network/v2/l3_conntrack_helper.py +8 -12
  74. openstackclient/network/v2/local_ip.py +24 -26
  75. openstackclient/network/v2/local_ip_association.py +4 -5
  76. openstackclient/network/v2/ndp_proxy.py +9 -10
  77. openstackclient/network/v2/network.py +12 -16
  78. openstackclient/network/v2/network_agent.py +29 -37
  79. openstackclient/network/v2/network_auto_allocated_topology.py +4 -5
  80. openstackclient/network/v2/network_flavor.py +1 -1
  81. openstackclient/network/v2/network_flavor_profile.py +5 -5
  82. openstackclient/network/v2/network_meter.py +3 -3
  83. openstackclient/network/v2/network_meter_rule.py +5 -8
  84. openstackclient/network/v2/network_qos_policy.py +4 -4
  85. openstackclient/network/v2/network_qos_rule.py +4 -5
  86. openstackclient/network/v2/network_rbac.py +4 -4
  87. openstackclient/network/v2/network_segment.py +6 -7
  88. openstackclient/network/v2/network_segment_range.py +16 -20
  89. openstackclient/network/v2/network_trunk.py +24 -16
  90. openstackclient/network/v2/port.py +28 -29
  91. openstackclient/network/v2/router.py +52 -41
  92. openstackclient/network/v2/security_group.py +8 -15
  93. openstackclient/network/v2/security_group_rule.py +9 -10
  94. openstackclient/network/v2/subnet.py +31 -30
  95. openstackclient/network/v2/subnet_pool.py +4 -4
  96. openstackclient/object/client.py +2 -3
  97. openstackclient/object/v1/container.py +2 -3
  98. openstackclient/object/v1/object.py +2 -9
  99. openstackclient/shell.py +22 -5
  100. openstackclient/tests/functional/base.py +2 -2
  101. openstackclient/tests/functional/common/test_quota.py +3 -1
  102. openstackclient/tests/functional/compute/v2/common.py +12 -6
  103. openstackclient/tests/functional/compute/v2/test_server.py +2 -3
  104. openstackclient/tests/functional/compute/v2/test_server_event.py +1 -1
  105. openstackclient/tests/functional/identity/v2/test_user.py +1 -1
  106. openstackclient/tests/functional/identity/v3/common.py +3 -8
  107. openstackclient/tests/functional/identity/v3/test_application_credential.py +10 -10
  108. openstackclient/tests/functional/identity/v3/test_endpoint.py +3 -3
  109. openstackclient/tests/functional/identity/v3/test_group.py +3 -3
  110. openstackclient/tests/functional/identity/v3/test_idp.py +3 -7
  111. openstackclient/tests/functional/identity/v3/test_limit.py +4 -4
  112. openstackclient/tests/functional/identity/v3/test_project.py +5 -14
  113. openstackclient/tests/functional/identity/v3/test_region.py +1 -3
  114. openstackclient/tests/functional/identity/v3/test_registered_limit.py +3 -3
  115. openstackclient/tests/functional/identity/v3/test_role.py +1 -1
  116. openstackclient/tests/functional/identity/v3/test_role_assignment.py +13 -31
  117. openstackclient/tests/functional/identity/v3/test_service_provider.py +3 -7
  118. openstackclient/tests/functional/identity/v3/test_user.py +8 -8
  119. openstackclient/tests/functional/network/v2/common.py +7 -3
  120. openstackclient/tests/functional/network/v2/test_address_group.py +4 -0
  121. openstackclient/tests/functional/network/v2/test_l3_conntrack_helper.py +15 -11
  122. openstackclient/tests/functional/network/v2/test_local_ip.py +4 -0
  123. openstackclient/tests/functional/network/v2/test_network_meter_rule.py +2 -2
  124. openstackclient/tests/functional/network/v2/test_network_ndp_proxy.py +2 -3
  125. openstackclient/tests/functional/network/v2/test_network_rbac.py +2 -2
  126. openstackclient/tests/functional/network/v2/test_network_trunk.py +1 -1
  127. openstackclient/tests/functional/network/v2/test_port.py +17 -7
  128. openstackclient/tests/functional/network/v2/test_router.py +42 -0
  129. openstackclient/tests/functional/network/v2/test_subnet_pool.py +4 -0
  130. openstackclient/tests/unit/api/test_compute_v2.py +67 -87
  131. openstackclient/tests/unit/common/test_availability_zone.py +6 -14
  132. openstackclient/tests/unit/common/test_command.py +1 -1
  133. openstackclient/tests/unit/common/test_extension.py +5 -7
  134. openstackclient/tests/unit/common/test_limits.py +1 -1
  135. openstackclient/tests/unit/common/test_project_cleanup.py +5 -6
  136. openstackclient/tests/unit/common/test_quota.py +51 -28
  137. openstackclient/tests/unit/compute/v2/fakes.py +4 -10
  138. openstackclient/tests/unit/compute/v2/test_agent.py +16 -16
  139. openstackclient/tests/unit/compute/v2/test_aggregate.py +56 -60
  140. openstackclient/tests/unit/compute/v2/test_console.py +16 -16
  141. openstackclient/tests/unit/compute/v2/test_flavor.py +71 -71
  142. openstackclient/tests/unit/compute/v2/test_host.py +8 -8
  143. openstackclient/tests/unit/compute/v2/test_hypervisor.py +22 -30
  144. openstackclient/tests/unit/compute/v2/test_hypervisor_stats.py +2 -2
  145. openstackclient/tests/unit/compute/v2/test_keypair.py +24 -24
  146. openstackclient/tests/unit/compute/v2/test_server.py +524 -560
  147. openstackclient/tests/unit/compute/v2/test_server_backup.py +5 -7
  148. openstackclient/tests/unit/compute/v2/test_server_event.py +16 -18
  149. openstackclient/tests/unit/compute/v2/test_server_group.py +25 -31
  150. openstackclient/tests/unit/compute/v2/test_server_image.py +6 -8
  151. openstackclient/tests/unit/compute/v2/test_server_migration.py +37 -37
  152. openstackclient/tests/unit/compute/v2/test_server_volume.py +12 -12
  153. openstackclient/tests/unit/compute/v2/test_service.py +39 -45
  154. openstackclient/tests/unit/compute/v2/test_usage.py +5 -5
  155. openstackclient/tests/unit/identity/v2_0/fakes.py +1 -1
  156. openstackclient/tests/unit/identity/v3/test_access_rule.py +1 -3
  157. openstackclient/tests/unit/identity/v3/test_application_credential.py +1 -1
  158. openstackclient/tests/unit/identity/v3/test_endpoint.py +167 -172
  159. openstackclient/tests/unit/identity/v3/test_mappings.py +2 -2
  160. openstackclient/tests/unit/identity/v3/test_trust.py +5 -2
  161. openstackclient/tests/unit/identity/v3/test_user.py +16 -0
  162. openstackclient/tests/unit/image/v1/fakes.py +2 -2
  163. openstackclient/tests/unit/image/v2/test_image.py +39 -1
  164. openstackclient/tests/unit/integ/cli/test_shell.py +1 -2
  165. openstackclient/tests/unit/network/test_common.py +2 -2
  166. openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +8 -14
  167. openstackclient/tests/unit/network/v2/test_floating_ip_network.py +49 -35
  168. openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +1 -1
  169. openstackclient/tests/unit/network/v2/test_network_compute.py +11 -11
  170. openstackclient/tests/unit/network/v2/test_network_trunk.py +2 -2
  171. openstackclient/tests/unit/network/v2/test_port.py +4 -5
  172. openstackclient/tests/unit/network/v2/test_router.py +63 -0
  173. openstackclient/tests/unit/network/v2/test_security_group_compute.py +11 -19
  174. openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +14 -14
  175. openstackclient/tests/unit/object/v1/test_object_all.py +4 -3
  176. openstackclient/tests/unit/test_shell.py +16 -13
  177. openstackclient/tests/unit/volume/v2/test_volume.py +1 -1
  178. openstackclient/tests/unit/volume/v2/test_volume_transfer_request.py +1 -1
  179. openstackclient/tests/unit/volume/v3/fakes.py +2 -8
  180. openstackclient/tests/unit/volume/v3/test_volume.py +1 -1
  181. openstackclient/tests/unit/volume/v3/test_volume_attachment.py +3 -3
  182. openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +1 -2
  183. openstackclient/tests/unit/volume/v3/test_volume_transfer_request.py +1 -1
  184. openstackclient/volume/client.py +1 -3
  185. openstackclient/volume/v2/consistency_group.py +4 -8
  186. openstackclient/volume/v2/consistency_group_snapshot.py +1 -2
  187. openstackclient/volume/v2/qos_specs.py +1 -2
  188. openstackclient/volume/v2/volume.py +8 -16
  189. openstackclient/volume/v2/volume_backup.py +6 -7
  190. openstackclient/volume/v2/volume_snapshot.py +8 -9
  191. openstackclient/volume/v2/volume_transfer_request.py +0 -3
  192. openstackclient/volume/v2/volume_type.py +10 -21
  193. openstackclient/volume/v3/block_storage_cluster.py +3 -3
  194. openstackclient/volume/v3/block_storage_manage.py +1 -3
  195. openstackclient/volume/v3/volume.py +18 -19
  196. openstackclient/volume/v3/volume_attachment.py +3 -2
  197. openstackclient/volume/v3/volume_backup.py +7 -8
  198. openstackclient/volume/v3/volume_group.py +2 -1
  199. openstackclient/volume/v3/volume_group_snapshot.py +2 -1
  200. openstackclient/volume/v3/volume_snapshot.py +4 -3
  201. openstackclient/volume/v3/volume_type.py +10 -21
  202. {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.0.0.dist-info}/AUTHORS +3 -0
  203. {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.0.0.dist-info}/METADATA +7 -13
  204. {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.0.0.dist-info}/RECORD +209 -232
  205. {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.0.0.dist-info}/WHEEL +1 -1
  206. {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.0.0.dist-info}/entry_points.txt +0 -41
  207. python_openstackclient-8.0.0.dist-info/pbr.json +1 -0
  208. openstackclient/tests/functional/volume/v1/__init__.py +0 -0
  209. openstackclient/tests/functional/volume/v1/common.py +0 -35
  210. openstackclient/tests/functional/volume/v1/test_qos.py +0 -100
  211. openstackclient/tests/functional/volume/v1/test_service.py +0 -76
  212. openstackclient/tests/functional/volume/v1/test_snapshot.py +0 -232
  213. openstackclient/tests/functional/volume/v1/test_transfer_request.py +0 -111
  214. openstackclient/tests/functional/volume/v1/test_volume.py +0 -228
  215. openstackclient/tests/functional/volume/v1/test_volume_type.py +0 -213
  216. openstackclient/tests/unit/volume/v1/__init__.py +0 -0
  217. openstackclient/tests/unit/volume/v1/fakes.py +0 -615
  218. openstackclient/tests/unit/volume/v1/test_qos_specs.py +0 -471
  219. openstackclient/tests/unit/volume/v1/test_service.py +0 -295
  220. openstackclient/tests/unit/volume/v1/test_transfer_request.py +0 -380
  221. openstackclient/tests/unit/volume/v1/test_type.py +0 -633
  222. openstackclient/tests/unit/volume/v1/test_volume.py +0 -1447
  223. openstackclient/tests/unit/volume/v1/test_volume_backup.py +0 -435
  224. openstackclient/volume/v1/__init__.py +0 -0
  225. openstackclient/volume/v1/qos_specs.py +0 -377
  226. openstackclient/volume/v1/service.py +0 -136
  227. openstackclient/volume/v1/volume.py +0 -734
  228. openstackclient/volume/v1/volume_backup.py +0 -302
  229. openstackclient/volume/v1/volume_snapshot.py +0 -433
  230. openstackclient/volume/v1/volume_transfer_request.py +0 -200
  231. openstackclient/volume/v1/volume_type.py +0 -520
  232. python_openstackclient-7.4.0.dist-info/pbr.json +0 -1
  233. {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.0.0.dist-info}/LICENSE +0 -0
  234. {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.0.0.dist-info}/top_level.txt +0 -0
@@ -28,10 +28,9 @@ LOG = logging.getLogger(__name__)
28
28
 
29
29
 
30
30
  def _get_columns(item):
31
- column_map = {}
32
31
  hidden_columns = ['location', 'name', 'id', 'tenant_id']
33
32
  return utils.get_osc_show_columns_for_sdk_resource(
34
- item, column_map, hidden_columns
33
+ item, {}, hidden_columns
35
34
  )
36
35
 
37
36
 
@@ -44,7 +43,7 @@ class CreateLocalIPAssociation(command.ShowOne):
44
43
  'local_ip',
45
44
  metavar='<local-ip>',
46
45
  help=_(
47
- "Local IP that the port association belongs to " "(Name or ID)"
46
+ "Local IP that the port association belongs to (Name or ID)"
48
47
  ),
49
48
  )
50
49
  parser.add_argument(
@@ -90,7 +89,7 @@ class DeleteLocalIPAssociation(command.Command):
90
89
  'local_ip',
91
90
  metavar="<local-ip>",
92
91
  help=_(
93
- "Local IP that the port association belongs to " "(Name or ID)"
92
+ "Local IP that the port association belongs to (Name or ID)"
94
93
  ),
95
94
  )
96
95
  parser.add_argument(
@@ -151,7 +150,7 @@ class ListLocalIPAssociation(command.Lister):
151
150
  '--fixed-port',
152
151
  metavar='<fixed-port>',
153
152
  help=_(
154
- "Filter the list result by the ID or name of " "the fixed port"
153
+ "Filter the list result by the ID or name of the fixed port"
155
154
  ),
156
155
  )
157
156
  parser.add_argument(
@@ -29,10 +29,9 @@ LOG = logging.getLogger(__name__)
29
29
 
30
30
 
31
31
  def _get_columns(item):
32
- column_map = {}
33
32
  hidden_columns = ['location']
34
33
  return utils.get_osc_show_columns_for_sdk_resource(
35
- item, column_map, hidden_columns
34
+ item, {}, hidden_columns
36
35
  )
37
36
 
38
37
 
@@ -69,7 +68,7 @@ class CreateNDPProxy(command.ShowOne):
69
68
  '--description',
70
69
  metavar='<description>',
71
70
  help=_(
72
- "A text to describe/contextualize the use of the "
71
+ "Text to describe/contextualize the use of the "
73
72
  "NDP proxy configuration"
74
73
  ),
75
74
  )
@@ -124,13 +123,13 @@ class DeleteNDPProxy(command.Command):
124
123
  except Exception as e:
125
124
  result += 1
126
125
  LOG.error(
127
- _("Failed to delete NDP proxy " "'%(ndp_proxy)s': %(e)s"),
126
+ _("Failed to delete NDP proxy '%(ndp_proxy)s': %(e)s"),
128
127
  {'ndp_proxy': ndp_proxy, 'e': e},
129
128
  )
130
129
  if result > 0:
131
130
  total = len(parsed_args.ndp_proxy)
132
131
  msg = _(
133
- "%(result)s of %(total)s NDP proxies failed " "to delete."
132
+ "%(result)s of %(total)s NDP proxies failed to delete."
134
133
  ) % {'result': result, 'total': total}
135
134
  raise exceptions.CommandError(msg)
136
135
 
@@ -156,18 +155,18 @@ class ListNDPProxy(command.Lister):
156
155
  )
157
156
  parser.add_argument(
158
157
  '--ip-address',
159
- metavar='ip-address',
160
- help=_("List only NDP proxies according to their IPv6 address"),
158
+ metavar='<ip-address>',
159
+ help=_("List only NDP proxies associated to this IPv6 address"),
161
160
  )
162
161
  parser.add_argument(
163
162
  '--project',
164
163
  metavar='<project>',
165
- help=_("List NDP proxies according to their project (name or ID)"),
164
+ help=_("List only NDP proxies of given project (name or ID)"),
166
165
  )
167
166
  parser.add_argument(
168
167
  '--name',
169
168
  metavar='<name>',
170
- help=_("List NDP proxies according to their name"),
169
+ help=_("List only NDP proxies of given name"),
171
170
  )
172
171
 
173
172
  identity_common.add_project_domain_option_to_parser(parser)
@@ -247,7 +246,7 @@ class SetNDPProxy(command.Command):
247
246
  '--description',
248
247
  metavar='<description>',
249
248
  help=_(
250
- "A text to describe/contextualize the use of "
249
+ "Text to describe/contextualize the use of "
251
250
  "the NDP proxy configuration"
252
251
  ),
253
252
  )
@@ -68,8 +68,7 @@ def _get_columns_network(item):
68
68
 
69
69
 
70
70
  def _get_columns_compute(item):
71
- column_map = {}
72
- return utils.get_osc_show_columns_for_sdk_resource(item, column_map)
71
+ return utils.get_osc_show_columns_for_sdk_resource(item, {})
73
72
 
74
73
 
75
74
  def _get_attrs_network(client_manager, parsed_args):
@@ -166,7 +165,7 @@ def _add_additional_network_options(parser):
166
165
  help=_(
167
166
  "The physical mechanism by which the virtual network "
168
167
  "is implemented. For example: "
169
- "flat, geneve, gre, local, vlan, vxlan."
168
+ "flat, geneve, gre, local, vlan or vxlan."
170
169
  ),
171
170
  )
172
171
  parser.add_argument(
@@ -292,8 +291,8 @@ class CreateNetwork(
292
291
  action='store_true',
293
292
  help=self.enhance_help_neutron(
294
293
  _(
295
- "The network has an external routing facility that's not "
296
- "managed by Neutron and can be used as in: "
294
+ "The network has an external routing facility that is not "
295
+ "managed by Neutron and can be used. For example: "
297
296
  "openstack router set --external-gateway NETWORK "
298
297
  "(external-net extension required)"
299
298
  )
@@ -355,17 +354,14 @@ class CreateNetwork(
355
354
  '--qinq-vlan',
356
355
  action='store_true',
357
356
  help=self.enhance_help_neutron(
358
- _("Enable VLAN QinQ (S-Tag ethtype 0x8a88) " "for the network")
357
+ _("Enable VLAN QinQ (S-Tag ethtype 0x8a88) for the network")
359
358
  ),
360
359
  )
361
360
  vlan_qinq_grp.add_argument(
362
361
  '--no-qinq-vlan',
363
362
  action='store_true',
364
363
  help=self.enhance_help_neutron(
365
- _(
366
- "Disable VLAN QinQ (S-Tag ethtype 0x8a88) "
367
- "for the network"
368
- )
364
+ _("Disable VLAN QinQ (S-Tag ethtype 0x8a88) for the network")
369
365
  ),
370
366
  )
371
367
 
@@ -537,7 +533,7 @@ class ListNetwork(common.NetworkAndComputeLister):
537
533
  _(
538
534
  "List networks according to their physical mechanisms. "
539
535
  "The supported options are: flat, geneve, gre, local, "
540
- "vlan, vxlan."
536
+ "vlan and vxlan."
541
537
  )
542
538
  ),
543
539
  )
@@ -576,7 +572,7 @@ class ListNetwork(common.NetworkAndComputeLister):
576
572
  def take_action_network(self, client, parsed_args):
577
573
  identity_client = self.app.client_manager.identity
578
574
  if parsed_args.long:
579
- columns = (
575
+ columns: tuple[str, ...] = (
580
576
  'id',
581
577
  'name',
582
578
  'status',
@@ -589,7 +585,7 @@ class ListNetwork(common.NetworkAndComputeLister):
589
585
  'availability_zones',
590
586
  'tags',
591
587
  )
592
- column_headers = (
588
+ column_headers: tuple[str, ...] = (
593
589
  'ID',
594
590
  'Name',
595
591
  'Status',
@@ -789,10 +785,10 @@ class SetNetwork(common.NeutronCommandWithExtraArgs):
789
785
  '--external',
790
786
  action='store_true',
791
787
  help=_(
792
- "The network has an external routing facility that's not "
793
- "managed by Neutron and can be used as in: "
788
+ "The network has an external routing facility that is not "
789
+ "managed by Neutron and can be used. For example: "
794
790
  "openstack router set --external-gateway NETWORK "
795
- "(external-net extension required)"
791
+ "(external-net extension required)."
796
792
  ),
797
793
  )
798
794
  external_router_grp.add_argument(
@@ -155,7 +155,7 @@ class DeleteNetworkAgent(command.Command):
155
155
  if result > 0:
156
156
  total = len(parsed_args.network_agent)
157
157
  msg = _(
158
- "%(result)s of %(total)s network agents failed " "to delete."
158
+ "%(result)s of %(total)s network agents failed to delete."
159
159
  ) % {'result': result, 'total': total}
160
160
  raise exceptions.CommandError(msg)
161
161
 
@@ -164,32 +164,37 @@ class DeleteNetworkAgent(command.Command):
164
164
  # OSC minimum requirements include SDK 1.0.
165
165
  class ListNetworkAgent(command.Lister):
166
166
  _description = _("List network agents")
167
+ _supported_agents = {
168
+ 'bgp': 'BGP dynamic routing agent',
169
+ 'dhcp': 'DHCP agent',
170
+ 'open-vswitch': 'Open vSwitch agent',
171
+ 'linux-bridge': 'Linux bridge agent',
172
+ 'ofa': 'OFA driver agent',
173
+ 'l3': 'L3 agent',
174
+ 'loadbalancer': 'Loadbalancer agent',
175
+ 'metering': 'Metering agent',
176
+ 'metadata': 'Metadata agent',
177
+ 'macvtap': 'Macvtap agent',
178
+ 'nic': 'NIC Switch agent',
179
+ 'baremetal': 'Baremetal Node',
180
+ 'ovn-controller': 'OVN Controller agent',
181
+ 'ovn-controller-gateway': 'OVN Controller Gateway agent',
182
+ 'ovn-metadata': 'OVN Metadata agent',
183
+ 'ovn-agent': 'OVN Neutron agent',
184
+ }
167
185
 
168
186
  def get_parser(self, prog_name):
169
187
  parser = super().get_parser(prog_name)
188
+ supported_agents = ','.join(self._supported_agents.keys())
170
189
  parser.add_argument(
171
190
  '--agent-type',
172
191
  metavar='<agent-type>',
173
- choices=[
174
- "bgp",
175
- "dhcp",
176
- "open-vswitch",
177
- "linux-bridge",
178
- "ofa",
179
- "l3",
180
- "loadbalancer",
181
- "metering",
182
- "metadata",
183
- "macvtap",
184
- "nic",
185
- "baremetal",
186
- ],
192
+ choices=list(self._supported_agents.keys()),
187
193
  help=_(
188
194
  "List only agents with the specified agent type. "
189
- "The supported agent types are: bgp, dhcp, open-vswitch, "
190
- "linux-bridge, ofa, l3, loadbalancer, metering, "
191
- "metadata, macvtap, nic, baremetal."
192
- ),
195
+ "The supported agent types are: %(supported_agents)s."
196
+ )
197
+ % {'supported_agents': supported_agents},
193
198
  )
194
199
  parser.add_argument(
195
200
  '--host',
@@ -218,7 +223,7 @@ class ListNetworkAgent(command.Lister):
218
223
 
219
224
  def take_action(self, parsed_args):
220
225
  client = self.app.client_manager.network
221
- columns = (
226
+ columns: tuple[str, ...] = (
222
227
  'id',
223
228
  'agent_type',
224
229
  'host',
@@ -227,7 +232,7 @@ class ListNetworkAgent(command.Lister):
227
232
  'is_admin_state_up',
228
233
  'binary',
229
234
  )
230
- column_headers = (
235
+ column_headers: tuple[str, ...] = (
231
236
  'ID',
232
237
  'Agent Type',
233
238
  'Host',
@@ -237,21 +242,6 @@ class ListNetworkAgent(command.Lister):
237
242
  'Binary',
238
243
  )
239
244
 
240
- key_value = {
241
- 'bgp': 'BGP dynamic routing agent',
242
- 'dhcp': 'DHCP agent',
243
- 'open-vswitch': 'Open vSwitch agent',
244
- 'linux-bridge': 'Linux bridge agent',
245
- 'ofa': 'OFA driver agent',
246
- 'l3': 'L3 agent',
247
- 'loadbalancer': 'Loadbalancer agent',
248
- 'metering': 'Metering agent',
249
- 'metadata': 'Metadata agent',
250
- 'macvtap': 'Macvtap agent',
251
- 'nic': 'NIC Switch agent',
252
- 'baremetal': 'Baremetal Node',
253
- }
254
-
255
245
  filters = {}
256
246
 
257
247
  if parsed_args.network is not None:
@@ -269,7 +259,9 @@ class ListNetworkAgent(command.Lister):
269
259
  data = client.routers_hosting_l3_agents(router)
270
260
  else:
271
261
  if parsed_args.agent_type is not None:
272
- filters['agent_type'] = key_value[parsed_args.agent_type]
262
+ filters['agent_type'] = self._supported_agents[
263
+ parsed_args.agent_type
264
+ ]
273
265
  if parsed_args.host is not None:
274
266
  filters['host'] = parsed_args.host
275
267
 
@@ -25,10 +25,9 @@ LOG = logging.getLogger(__name__)
25
25
 
26
26
 
27
27
  def _get_columns(item):
28
- column_map = {}
29
28
  hidden_columns = ['name', 'location', 'tenant_id']
30
29
  return utils.get_osc_show_columns_for_sdk_resource(
31
- item, column_map, hidden_columns
30
+ item, {}, hidden_columns
32
31
  )
33
32
 
34
33
 
@@ -71,7 +70,7 @@ class CreateAutoAllocatedTopology(command.ShowOne):
71
70
  metavar='<project>',
72
71
  help=_(
73
72
  "Return the auto allocated topology for a given project. "
74
- "Default is current project"
73
+ "Default is current project."
75
74
  ),
76
75
  )
77
76
  identity_common.add_project_domain_option_to_parser(parser)
@@ -89,7 +88,7 @@ class CreateAutoAllocatedTopology(command.ShowOne):
89
88
  default=True,
90
89
  help=_(
91
90
  "If topology exists returns the topology's "
92
- "information (Default)"
91
+ "information (default)"
93
92
  ),
94
93
  )
95
94
 
@@ -132,7 +131,7 @@ class DeleteAutoAllocatedTopology(command.Command):
132
131
  metavar='<project>',
133
132
  help=_(
134
133
  'Delete auto allocated topology for a given project. '
135
- 'Default is the current project'
134
+ 'Default is the current project.'
136
135
  ),
137
136
  )
138
137
  identity_common.add_project_domain_option_to_parser(parser)
@@ -102,7 +102,7 @@ class CreateNetworkFlavor(command.ShowOne, common.NeutronCommandWithExtraArgs):
102
102
  metavar="<service-type>",
103
103
  required=True,
104
104
  help=_(
105
- 'Service type to which the flavor applies to: e.g. VPN '
105
+ 'Service type to which the flavor applies. For example: VPN '
106
106
  '(See openstack network service provider list for loaded '
107
107
  'examples.)'
108
108
  ),
@@ -79,14 +79,14 @@ class CreateNetworkFlavorProfile(
79
79
  '--driver',
80
80
  help=_(
81
81
  "Python module path to driver. This becomes "
82
- "required if --metainfo is missing and vice versa"
82
+ "required if --metainfo is missing and vice-versa."
83
83
  ),
84
84
  )
85
85
  parser.add_argument(
86
86
  '--metainfo',
87
87
  help=_(
88
88
  "Metainfo for the flavor profile. This becomes "
89
- "required if --driver is missing and vice versa"
89
+ "required if --driver is missing and vice-versa."
90
90
  ),
91
91
  )
92
92
 
@@ -146,7 +146,7 @@ class DeleteNetworkFlavorProfile(command.Command):
146
146
  if result > 0:
147
147
  total = len(parsed_args.flavor_profile)
148
148
  msg = _(
149
- "%(result)s of %(total)s flavor_profiles failed " "to delete."
149
+ "%(result)s of %(total)s flavor_profiles failed to delete."
150
150
  ) % {"result": result, "total": total}
151
151
  raise exceptions.CommandError(msg)
152
152
 
@@ -217,14 +217,14 @@ class SetNetworkFlavorProfile(common.NeutronCommandWithExtraArgs):
217
217
  '--driver',
218
218
  help=_(
219
219
  "Python module path to driver. This becomes "
220
- "required if --metainfo is missing and vice versa"
220
+ "required if --metainfo is missing and vice-versa."
221
221
  ),
222
222
  )
223
223
  parser.add_argument(
224
224
  '--metainfo',
225
225
  help=_(
226
226
  "Metainfo for the flavor profile. This becomes "
227
- "required if --driver is missing and vice versa"
227
+ "required if --driver is missing and vice-versa."
228
228
  ),
229
229
  )
230
230
 
@@ -70,7 +70,7 @@ class CreateMeter(command.ShowOne, common.NeutronCommandWithExtraArgs):
70
70
  parser.add_argument(
71
71
  '--description',
72
72
  metavar='<description>',
73
- help=_("Create description for meter"),
73
+ help=_("Description for meter"),
74
74
  )
75
75
  parser.add_argument(
76
76
  '--project',
@@ -139,12 +139,12 @@ class DeleteMeter(command.Command):
139
139
  except Exception as e:
140
140
  result += 1
141
141
  LOG.error(
142
- _("Failed to delete meter with " "ID '%(meter)s': %(e)s"),
142
+ _("Failed to delete meter with ID '%(meter)s': %(e)s"),
143
143
  {"meter": meter, "e": e},
144
144
  )
145
145
  if result > 0:
146
146
  total = len(parsed_args.meter)
147
- msg = _("%(result)s of %(total)s meters failed " "to delete.") % {
147
+ msg = _("%(result)s of %(total)s meters failed to delete.") % {
148
148
  "result": result,
149
149
  "total": total,
150
150
  }
@@ -14,6 +14,7 @@
14
14
  """Meter Rule Implementations"""
15
15
 
16
16
  import logging
17
+ import typing as ty
17
18
 
18
19
  from osc_lib.command import command
19
20
  from osc_lib import exceptions
@@ -27,15 +28,14 @@ LOG = logging.getLogger(__name__)
27
28
 
28
29
 
29
30
  def _get_columns(item):
30
- column_map = {}
31
31
  hidden_columns = ['location', 'tenant_id']
32
32
  return utils.get_osc_show_columns_for_sdk_resource(
33
- item, column_map, hidden_columns
33
+ item, {}, hidden_columns
34
34
  )
35
35
 
36
36
 
37
37
  def _get_attrs(client_manager, parsed_args):
38
- attrs = {}
38
+ attrs: dict[str, ty.Any] = {}
39
39
 
40
40
  if parsed_args.exclude:
41
41
  attrs['excluded'] = True
@@ -168,17 +168,14 @@ class DeleteMeterRule(command.Command):
168
168
  except Exception as e:
169
169
  result += 1
170
170
  LOG.error(
171
- _(
172
- "Failed to delete meter rule with "
173
- "ID '%(id)s': %(e)s"
174
- ),
171
+ _("Failed to delete meter rule with ID '%(id)s': %(e)s"),
175
172
  {"id": id, "e": e},
176
173
  )
177
174
 
178
175
  if result > 0:
179
176
  total = len(parsed_args.meter_rule_id)
180
177
  msg = _(
181
- "%(result)s of %(total)s meter rules failed " "to delete."
178
+ "%(result)s of %(total)s meter rules failed to delete."
182
179
  ) % {"result": result, "total": total}
183
180
  raise exceptions.CommandError(msg)
184
181
 
@@ -174,7 +174,7 @@ class DeleteNetworkQosPolicy(command.Command):
174
174
  if result > 0:
175
175
  total = len(parsed_args.policy)
176
176
  msg = _(
177
- "%(result)s of %(total)s QoS policies failed " "to delete."
177
+ "%(result)s of %(total)s QoS policies failed to delete."
178
178
  ) % {'result': result, 'total': total}
179
179
  raise exceptions.CommandError(msg)
180
180
 
@@ -190,7 +190,7 @@ class ListNetworkQosPolicy(command.Lister):
190
190
  '--project',
191
191
  metavar='<project>',
192
192
  help=_(
193
- "List qos policies according to their project (name or ID)"
193
+ "List QoS policies according to their project (name or ID)"
194
194
  ),
195
195
  )
196
196
  identity_common.add_project_domain_option_to_parser(parser)
@@ -198,12 +198,12 @@ class ListNetworkQosPolicy(command.Lister):
198
198
  shared_group.add_argument(
199
199
  '--share',
200
200
  action='store_true',
201
- help=_("List qos policies shared between projects"),
201
+ help=_("List QoS policies shared between projects"),
202
202
  )
203
203
  shared_group.add_argument(
204
204
  '--no-share',
205
205
  action='store_true',
206
- help=_("List qos policies not shared between projects"),
206
+ help=_("List QoS policies not shared between projects"),
207
207
  )
208
208
  return parser
209
209
 
@@ -73,10 +73,9 @@ ACTION_SHOW = 'get'
73
73
 
74
74
 
75
75
  def _get_columns(item):
76
- column_map = {}
77
76
  hidden_columns = ['location', 'tenant_id']
78
77
  return utils.get_osc_show_columns_for_sdk_resource(
79
- item, column_map, hidden_columns
78
+ item, {}, hidden_columns
80
79
  )
81
80
 
82
81
 
@@ -378,7 +377,7 @@ class SetNetworkQosRule(common.NeutronCommandWithExtraArgs):
378
377
  parser.add_argument(
379
378
  'id',
380
379
  metavar='<rule-id>',
381
- help=_('Network QoS rule to delete (ID)'),
380
+ help=_('Network QoS rule to set (ID)'),
382
381
  )
383
382
  _add_rule_arguments(parser)
384
383
  return parser
@@ -424,7 +423,7 @@ class ShowNetworkQosRule(command.ShowOne):
424
423
  parser.add_argument(
425
424
  'id',
426
425
  metavar='<rule-id>',
427
- help=_('Network QoS rule to delete (ID)'),
426
+ help=_('Network QoS rule to show (ID)'),
428
427
  )
429
428
  return parser
430
429
 
@@ -442,7 +441,7 @@ class ShowNetworkQosRule(command.ShowOne):
442
441
  rule_id, qos.id
443
442
  )
444
443
  except Exception as e:
445
- msg = _('Failed to set Network QoS rule ID "%(rule)s": %(e)s') % {
444
+ msg = _('Failed to show Network QoS rule ID "%(rule)s": %(e)s') % {
446
445
  'rule': rule_id,
447
446
  'e': e,
448
447
  }
@@ -147,7 +147,7 @@ class CreateNetworkRBAC(command.ShowOne, common.NeutronCommandWithExtraArgs):
147
147
  target_project_group.add_argument(
148
148
  '--target-all-projects',
149
149
  action='store_true',
150
- help=_('Allow creating RBAC policy for all projects.'),
150
+ help=_('Allow creating RBAC policy for all projects'),
151
151
  )
152
152
  parser.add_argument(
153
153
  '--target-project-domain',
@@ -212,7 +212,7 @@ class DeleteNetworkRBAC(command.Command):
212
212
  if result > 0:
213
213
  total = len(parsed_args.rbac_policy)
214
214
  msg = _(
215
- "%(result)s of %(total)s RBAC policies failed " "to delete."
215
+ "%(result)s of %(total)s RBAC policies failed to delete."
216
216
  ) % {'result': result, 'total': total}
217
217
  raise exceptions.CommandError(msg)
218
218
 
@@ -265,12 +265,12 @@ class ListNetworkRBAC(command.Lister):
265
265
  def take_action(self, parsed_args):
266
266
  client = self.app.client_manager.network
267
267
 
268
- columns = (
268
+ columns: tuple[str, ...] = (
269
269
  'id',
270
270
  'object_type',
271
271
  'object_id',
272
272
  )
273
- column_headers = (
273
+ column_headers: tuple[str, ...] = (
274
274
  'ID',
275
275
  'Object Type',
276
276
  'Object ID',
@@ -26,10 +26,9 @@ LOG = logging.getLogger(__name__)
26
26
 
27
27
 
28
28
  def _get_columns(item):
29
- column_map = {}
30
29
  hidden_columns = ['location', 'tenant_id']
31
30
  return utils.get_osc_show_columns_for_sdk_resource(
32
- item, column_map, hidden_columns
31
+ item, {}, hidden_columns
33
32
  )
34
33
 
35
34
 
@@ -141,7 +140,7 @@ class DeleteNetworkSegment(command.Command):
141
140
  if result > 0:
142
141
  total = len(parsed_args.network_segment)
143
142
  msg = _(
144
- "%(result)s of %(total)s network segments failed " "to delete."
143
+ "%(result)s of %(total)s network segments failed to delete."
145
144
  ) % {'result': result, 'total': total}
146
145
  raise exceptions.CommandError(msg)
147
146
 
@@ -178,14 +177,14 @@ class ListNetworkSegment(command.Lister):
178
177
  filters = {'network_id': _network.id}
179
178
  data = network_client.segments(**filters)
180
179
 
181
- headers = (
180
+ headers: tuple[str, ...] = (
182
181
  'ID',
183
182
  'Name',
184
183
  'Network',
185
184
  'Network Type',
186
185
  'Segment',
187
186
  )
188
- columns = (
187
+ columns: tuple[str, ...] = (
189
188
  'id',
190
189
  'name',
191
190
  'network_id',
@@ -193,8 +192,8 @@ class ListNetworkSegment(command.Lister):
193
192
  'segmentation_id',
194
193
  )
195
194
  if parsed_args.long:
196
- headers = headers + ('Physical Network',)
197
- columns = columns + ('physical_network',)
195
+ headers += ('Physical Network',)
196
+ columns += ('physical_network',)
198
197
 
199
198
  return (
200
199
  headers,