python-openstackclient 7.3.1__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 (235) 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 +8 -9
  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 +42 -31
  91. openstackclient/network/v2/router.py +55 -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_credential.py +4 -4
  159. openstackclient/tests/unit/identity/v3/test_endpoint.py +167 -172
  160. openstackclient/tests/unit/identity/v3/test_mappings.py +2 -2
  161. openstackclient/tests/unit/identity/v3/test_trust.py +5 -2
  162. openstackclient/tests/unit/identity/v3/test_user.py +16 -0
  163. openstackclient/tests/unit/image/v1/fakes.py +2 -2
  164. openstackclient/tests/unit/image/v2/test_image.py +39 -1
  165. openstackclient/tests/unit/integ/cli/test_shell.py +1 -2
  166. openstackclient/tests/unit/network/test_common.py +2 -2
  167. openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +8 -14
  168. openstackclient/tests/unit/network/v2/test_floating_ip_network.py +49 -35
  169. openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +1 -1
  170. openstackclient/tests/unit/network/v2/test_network_compute.py +11 -11
  171. openstackclient/tests/unit/network/v2/test_network_trunk.py +2 -2
  172. openstackclient/tests/unit/network/v2/test_port.py +33 -5
  173. openstackclient/tests/unit/network/v2/test_router.py +120 -7
  174. openstackclient/tests/unit/network/v2/test_security_group_compute.py +11 -19
  175. openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +14 -14
  176. openstackclient/tests/unit/object/v1/test_object_all.py +4 -3
  177. openstackclient/tests/unit/test_shell.py +16 -13
  178. openstackclient/tests/unit/volume/v2/test_volume.py +1 -1
  179. openstackclient/tests/unit/volume/v2/test_volume_transfer_request.py +1 -1
  180. openstackclient/tests/unit/volume/v3/fakes.py +2 -8
  181. openstackclient/tests/unit/volume/v3/test_volume.py +1 -1
  182. openstackclient/tests/unit/volume/v3/test_volume_attachment.py +3 -3
  183. openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +1 -2
  184. openstackclient/tests/unit/volume/v3/test_volume_transfer_request.py +1 -1
  185. openstackclient/volume/client.py +1 -3
  186. openstackclient/volume/v2/consistency_group.py +4 -8
  187. openstackclient/volume/v2/consistency_group_snapshot.py +1 -2
  188. openstackclient/volume/v2/qos_specs.py +1 -2
  189. openstackclient/volume/v2/volume.py +8 -16
  190. openstackclient/volume/v2/volume_backup.py +6 -7
  191. openstackclient/volume/v2/volume_snapshot.py +8 -9
  192. openstackclient/volume/v2/volume_transfer_request.py +0 -3
  193. openstackclient/volume/v2/volume_type.py +10 -21
  194. openstackclient/volume/v3/block_storage_cluster.py +3 -3
  195. openstackclient/volume/v3/block_storage_manage.py +1 -3
  196. openstackclient/volume/v3/volume.py +18 -19
  197. openstackclient/volume/v3/volume_attachment.py +3 -2
  198. openstackclient/volume/v3/volume_backup.py +7 -8
  199. openstackclient/volume/v3/volume_group.py +2 -1
  200. openstackclient/volume/v3/volume_group_snapshot.py +2 -1
  201. openstackclient/volume/v3/volume_snapshot.py +4 -3
  202. openstackclient/volume/v3/volume_type.py +10 -21
  203. {python_openstackclient-7.3.1.dist-info → python_openstackclient-8.0.0.dist-info}/AUTHORS +4 -0
  204. {python_openstackclient-7.3.1.dist-info → python_openstackclient-8.0.0.dist-info}/METADATA +7 -13
  205. {python_openstackclient-7.3.1.dist-info → python_openstackclient-8.0.0.dist-info}/RECORD +210 -233
  206. {python_openstackclient-7.3.1.dist-info → python_openstackclient-8.0.0.dist-info}/WHEEL +1 -1
  207. {python_openstackclient-7.3.1.dist-info → python_openstackclient-8.0.0.dist-info}/entry_points.txt +0 -41
  208. python_openstackclient-8.0.0.dist-info/pbr.json +1 -0
  209. openstackclient/tests/functional/volume/v1/__init__.py +0 -0
  210. openstackclient/tests/functional/volume/v1/common.py +0 -35
  211. openstackclient/tests/functional/volume/v1/test_qos.py +0 -100
  212. openstackclient/tests/functional/volume/v1/test_service.py +0 -76
  213. openstackclient/tests/functional/volume/v1/test_snapshot.py +0 -232
  214. openstackclient/tests/functional/volume/v1/test_transfer_request.py +0 -111
  215. openstackclient/tests/functional/volume/v1/test_volume.py +0 -228
  216. openstackclient/tests/functional/volume/v1/test_volume_type.py +0 -213
  217. openstackclient/tests/unit/volume/v1/__init__.py +0 -0
  218. openstackclient/tests/unit/volume/v1/fakes.py +0 -615
  219. openstackclient/tests/unit/volume/v1/test_qos_specs.py +0 -471
  220. openstackclient/tests/unit/volume/v1/test_service.py +0 -295
  221. openstackclient/tests/unit/volume/v1/test_transfer_request.py +0 -380
  222. openstackclient/tests/unit/volume/v1/test_type.py +0 -633
  223. openstackclient/tests/unit/volume/v1/test_volume.py +0 -1447
  224. openstackclient/tests/unit/volume/v1/test_volume_backup.py +0 -435
  225. openstackclient/volume/v1/__init__.py +0 -0
  226. openstackclient/volume/v1/qos_specs.py +0 -377
  227. openstackclient/volume/v1/service.py +0 -136
  228. openstackclient/volume/v1/volume.py +0 -734
  229. openstackclient/volume/v1/volume_backup.py +0 -302
  230. openstackclient/volume/v1/volume_snapshot.py +0 -433
  231. openstackclient/volume/v1/volume_transfer_request.py +0 -200
  232. openstackclient/volume/v1/volume_type.py +0 -520
  233. python_openstackclient-7.3.1.dist-info/pbr.json +0 -1
  234. {python_openstackclient-7.3.1.dist-info → python_openstackclient-8.0.0.dist-info}/LICENSE +0 -0
  235. {python_openstackclient-7.3.1.dist-info → python_openstackclient-8.0.0.dist-info}/top_level.txt +0 -0
@@ -86,7 +86,7 @@ class TestFlavorCreate(TestFlavor):
86
86
 
87
87
  # Return a project
88
88
  self.projects_mock.get.return_value = self.project
89
- self.compute_sdk_client.create_flavor.return_value = self.flavor
89
+ self.compute_client.create_flavor.return_value = self.flavor
90
90
  self.cmd = flavor.CreateFlavor(self.app, None)
91
91
 
92
92
  def test_flavor_create_default_options(self):
@@ -109,7 +109,7 @@ class TestFlavorCreate(TestFlavor):
109
109
  }
110
110
 
111
111
  columns, data = self.cmd.take_action(parsed_args)
112
- self.compute_sdk_client.create_flavor.assert_called_once_with(
112
+ self.compute_client.create_flavor.assert_called_once_with(
113
113
  **default_args
114
114
  )
115
115
 
@@ -180,17 +180,17 @@ class TestFlavorCreate(TestFlavor):
180
180
  # convert expected data tuple to list to be able to modify it
181
181
  cmp_data = list(self.data)
182
182
  cmp_data[7] = format_columns.DictColumn(props)
183
- self.compute_sdk_client.create_flavor.return_value = create_flavor
184
- self.compute_sdk_client.create_flavor_extra_specs.return_value = (
183
+ self.compute_client.create_flavor.return_value = create_flavor
184
+ self.compute_client.create_flavor_extra_specs.return_value = (
185
185
  expected_flavor
186
186
  )
187
187
 
188
188
  columns, data = self.cmd.take_action(parsed_args)
189
- self.compute_sdk_client.create_flavor.assert_called_once_with(**args)
190
- self.compute_sdk_client.create_flavor_extra_specs.assert_called_once_with(
189
+ self.compute_client.create_flavor.assert_called_once_with(**args)
190
+ self.compute_client.create_flavor_extra_specs.assert_called_once_with(
191
191
  create_flavor, props
192
192
  )
193
- self.compute_sdk_client.get_flavor_access.assert_not_called()
193
+ self.compute_client.get_flavor_access.assert_not_called()
194
194
 
195
195
  self.assertEqual(self.columns, columns)
196
196
  self.assertCountEqual(tuple(cmp_data), data)
@@ -265,19 +265,19 @@ class TestFlavorCreate(TestFlavor):
265
265
  # convert expected data tuple to list to be able to modify it
266
266
  cmp_data = list(self.data_private)
267
267
  cmp_data[7] = format_columns.DictColumn(props)
268
- self.compute_sdk_client.create_flavor.return_value = create_flavor
269
- self.compute_sdk_client.create_flavor_extra_specs.return_value = (
268
+ self.compute_client.create_flavor.return_value = create_flavor
269
+ self.compute_client.create_flavor_extra_specs.return_value = (
270
270
  expected_flavor
271
271
  )
272
272
 
273
273
  columns, data = self.cmd.take_action(parsed_args)
274
274
 
275
- self.compute_sdk_client.create_flavor.assert_called_once_with(**args)
276
- self.compute_sdk_client.flavor_add_tenant_access.assert_called_with(
275
+ self.compute_client.create_flavor.assert_called_once_with(**args)
276
+ self.compute_client.flavor_add_tenant_access.assert_called_with(
277
277
  self.flavor.id,
278
278
  self.project.id,
279
279
  )
280
- self.compute_sdk_client.create_flavor_extra_specs.assert_called_with(
280
+ self.compute_client.create_flavor_extra_specs.assert_called_with(
281
281
  create_flavor, props
282
282
  )
283
283
  self.assertEqual(self.columns, columns)
@@ -362,7 +362,7 @@ class TestFlavorCreate(TestFlavor):
362
362
  'description': 'fake description',
363
363
  }
364
364
 
365
- self.compute_sdk_client.create_flavor.assert_called_once_with(**args)
365
+ self.compute_client.create_flavor.assert_called_once_with(**args)
366
366
 
367
367
  self.assertEqual(self.columns, columns)
368
368
  self.assertCountEqual(self.data_private, data)
@@ -400,7 +400,7 @@ class TestFlavorDelete(TestFlavor):
400
400
  def setUp(self):
401
401
  super().setUp()
402
402
 
403
- self.compute_sdk_client.delete_flavor.return_value = None
403
+ self.compute_client.delete_flavor.return_value = None
404
404
 
405
405
  self.cmd = flavor.DeleteFlavor(self.app, None)
406
406
 
@@ -411,14 +411,14 @@ class TestFlavorDelete(TestFlavor):
411
411
  ]
412
412
  parsed_args = self.check_parser(self.cmd, arglist, verifylist)
413
413
 
414
- self.compute_sdk_client.find_flavor.return_value = self.flavors[0]
414
+ self.compute_client.find_flavor.return_value = self.flavors[0]
415
415
 
416
416
  result = self.cmd.take_action(parsed_args)
417
417
 
418
- self.compute_sdk_client.find_flavor.assert_called_with(
418
+ self.compute_client.find_flavor.assert_called_with(
419
419
  self.flavors[0].id, ignore_missing=False
420
420
  )
421
- self.compute_sdk_client.delete_flavor.assert_called_with(
421
+ self.compute_client.delete_flavor.assert_called_with(
422
422
  self.flavors[0].id
423
423
  )
424
424
  self.assertIsNone(result)
@@ -433,7 +433,7 @@ class TestFlavorDelete(TestFlavor):
433
433
 
434
434
  parsed_args = self.check_parser(self.cmd, arglist, verifylist)
435
435
 
436
- self.compute_sdk_client.find_flavor.side_effect = self.flavors
436
+ self.compute_client.find_flavor.side_effect = self.flavors
437
437
 
438
438
  result = self.cmd.take_action(parsed_args)
439
439
 
@@ -441,8 +441,8 @@ class TestFlavorDelete(TestFlavor):
441
441
  mock.call(i.id, ignore_missing=False) for i in self.flavors
442
442
  ]
443
443
  delete_calls = [mock.call(i.id) for i in self.flavors]
444
- self.compute_sdk_client.find_flavor.assert_has_calls(find_calls)
445
- self.compute_sdk_client.delete_flavor.assert_has_calls(delete_calls)
444
+ self.compute_client.find_flavor.assert_has_calls(find_calls)
445
+ self.compute_client.delete_flavor.assert_has_calls(delete_calls)
446
446
  self.assertIsNone(result)
447
447
 
448
448
  def test_multi_flavors_delete_with_exception(self):
@@ -453,7 +453,7 @@ class TestFlavorDelete(TestFlavor):
453
453
  verifylist = [('flavor', [self.flavors[0].id, 'unexist_flavor'])]
454
454
  parsed_args = self.check_parser(self.cmd, arglist, verifylist)
455
455
 
456
- self.compute_sdk_client.find_flavor.side_effect = [
456
+ self.compute_client.find_flavor.side_effect = [
457
457
  self.flavors[0],
458
458
  sdk_exceptions.ResourceNotFound,
459
459
  ]
@@ -469,8 +469,8 @@ class TestFlavorDelete(TestFlavor):
469
469
  mock.call('unexist_flavor', ignore_missing=False),
470
470
  ]
471
471
  delete_calls = [mock.call(self.flavors[0].id)]
472
- self.compute_sdk_client.find_flavor.assert_has_calls(find_calls)
473
- self.compute_sdk_client.delete_flavor.assert_has_calls(delete_calls)
472
+ self.compute_client.find_flavor.assert_has_calls(find_calls)
473
+ self.compute_client.delete_flavor.assert_has_calls(delete_calls)
474
474
 
475
475
 
476
476
  class TestFlavorList(TestFlavor):
@@ -516,7 +516,7 @@ class TestFlavorList(TestFlavor):
516
516
  [],
517
517
  ]
518
518
 
519
- self.compute_sdk_client.flavors = self.api_mock
519
+ self.compute_client.flavors = self.api_mock
520
520
 
521
521
  # Get the command object to test
522
522
  self.cmd = flavor.ListFlavor(self.app, None)
@@ -541,8 +541,8 @@ class TestFlavorList(TestFlavor):
541
541
  'is_public': True,
542
542
  }
543
543
 
544
- self.compute_sdk_client.flavors.assert_called_with(**kwargs)
545
- self.compute_sdk_client.fetch_flavor_extra_specs.assert_not_called()
544
+ self.compute_client.flavors.assert_called_with(**kwargs)
545
+ self.compute_client.fetch_flavor_extra_specs.assert_not_called()
546
546
 
547
547
  self.assertEqual(self.columns, columns)
548
548
  self.assertEqual(self.data, tuple(data))
@@ -567,8 +567,8 @@ class TestFlavorList(TestFlavor):
567
567
  'is_public': None,
568
568
  }
569
569
 
570
- self.compute_sdk_client.flavors.assert_called_with(**kwargs)
571
- self.compute_sdk_client.fetch_flavor_extra_specs.assert_not_called()
570
+ self.compute_client.flavors.assert_called_with(**kwargs)
571
+ self.compute_client.fetch_flavor_extra_specs.assert_not_called()
572
572
 
573
573
  self.assertEqual(self.columns, columns)
574
574
  self.assertEqual(self.data, tuple(data))
@@ -593,8 +593,8 @@ class TestFlavorList(TestFlavor):
593
593
  'is_public': False,
594
594
  }
595
595
 
596
- self.compute_sdk_client.flavors.assert_called_with(**kwargs)
597
- self.compute_sdk_client.fetch_flavor_extra_specs.assert_not_called()
596
+ self.compute_client.flavors.assert_called_with(**kwargs)
597
+ self.compute_client.fetch_flavor_extra_specs.assert_not_called()
598
598
 
599
599
  self.assertEqual(self.columns, columns)
600
600
  self.assertEqual(self.data, tuple(data))
@@ -619,8 +619,8 @@ class TestFlavorList(TestFlavor):
619
619
  'is_public': True,
620
620
  }
621
621
 
622
- self.compute_sdk_client.flavors.assert_called_with(**kwargs)
623
- self.compute_sdk_client.fetch_flavor_extra_specs.assert_not_called()
622
+ self.compute_client.flavors.assert_called_with(**kwargs)
623
+ self.compute_client.fetch_flavor_extra_specs.assert_not_called()
624
624
 
625
625
  self.assertEqual(self.columns, columns)
626
626
  self.assertEqual(self.data, tuple(data))
@@ -645,8 +645,8 @@ class TestFlavorList(TestFlavor):
645
645
  'is_public': True,
646
646
  }
647
647
 
648
- self.compute_sdk_client.flavors.assert_called_with(**kwargs)
649
- self.compute_sdk_client.fetch_flavor_extra_specs.assert_not_called()
648
+ self.compute_client.flavors.assert_called_with(**kwargs)
649
+ self.compute_client.fetch_flavor_extra_specs.assert_not_called()
650
650
 
651
651
  self.assertEqual(self.columns_long, columns)
652
652
  self.assertCountEqual(self.data_long, tuple(data))
@@ -678,8 +678,8 @@ class TestFlavorList(TestFlavor):
678
678
  [],
679
679
  ]
680
680
 
681
- self.compute_sdk_client.flavors = self.api_mock
682
- self.compute_sdk_client.fetch_flavor_extra_specs = mock.Mock(
681
+ self.compute_client.flavors = self.api_mock
682
+ self.compute_client.fetch_flavor_extra_specs = mock.Mock(
683
683
  return_value=None
684
684
  )
685
685
 
@@ -702,8 +702,8 @@ class TestFlavorList(TestFlavor):
702
702
  'is_public': True,
703
703
  }
704
704
 
705
- self.compute_sdk_client.flavors.assert_called_with(**kwargs)
706
- self.compute_sdk_client.fetch_flavor_extra_specs.assert_called_once_with(
705
+ self.compute_client.flavors.assert_called_with(**kwargs)
706
+ self.compute_client.fetch_flavor_extra_specs.assert_called_once_with(
707
707
  flavor
708
708
  )
709
709
 
@@ -736,15 +736,15 @@ class TestFlavorList(TestFlavor):
736
736
  'min_ram': 2048,
737
737
  }
738
738
 
739
- self.compute_sdk_client.flavors.assert_called_with(**kwargs)
740
- self.compute_sdk_client.fetch_flavor_extra_specs.assert_not_called()
739
+ self.compute_client.flavors.assert_called_with(**kwargs)
740
+ self.compute_client.fetch_flavor_extra_specs.assert_not_called()
741
741
 
742
742
  self.assertEqual(self.columns, columns)
743
743
  self.assertEqual(tuple(self.data), tuple(data))
744
744
 
745
745
 
746
746
  class TestFlavorSet(TestFlavor):
747
- # Return value of self.compute_sdk_client.find_flavor().
747
+ # Return value of self.compute_client.find_flavor().
748
748
  flavor = compute_fakes.create_one_flavor(
749
749
  attrs={'os-flavor-access:is_public': False}
750
750
  )
@@ -753,7 +753,7 @@ class TestFlavorSet(TestFlavor):
753
753
  def setUp(self):
754
754
  super().setUp()
755
755
 
756
- self.compute_sdk_client.find_flavor.return_value = self.flavor
756
+ self.compute_client.find_flavor.return_value = self.flavor
757
757
  # Return a project
758
758
  self.projects_mock.get.return_value = self.project
759
759
  self.cmd = flavor.SetFlavor(self.app, None)
@@ -767,10 +767,10 @@ class TestFlavorSet(TestFlavor):
767
767
  parsed_args = self.check_parser(self.cmd, arglist, verifylist)
768
768
 
769
769
  result = self.cmd.take_action(parsed_args)
770
- self.compute_sdk_client.find_flavor.assert_called_with(
770
+ self.compute_client.find_flavor.assert_called_with(
771
771
  parsed_args.flavor, get_extra_specs=True, ignore_missing=False
772
772
  )
773
- self.compute_sdk_client.create_flavor_extra_specs.assert_called_with(
773
+ self.compute_client.create_flavor_extra_specs.assert_called_with(
774
774
  self.flavor.id, {'FOO': '"B A R"'}
775
775
  )
776
776
  self.assertIsNone(result)
@@ -781,10 +781,10 @@ class TestFlavorSet(TestFlavor):
781
781
  parsed_args = self.check_parser(self.cmd, arglist, verifylist)
782
782
 
783
783
  result = self.cmd.take_action(parsed_args)
784
- self.compute_sdk_client.find_flavor.assert_called_with(
784
+ self.compute_client.find_flavor.assert_called_with(
785
785
  parsed_args.flavor, get_extra_specs=True, ignore_missing=False
786
786
  )
787
- self.compute_sdk_client.delete_flavor_extra_specs_property.assert_called_with(
787
+ self.compute_client.delete_flavor_extra_specs_property.assert_called_with(
788
788
  self.flavor.id, 'property'
789
789
  )
790
790
  self.assertIsNone(result)
@@ -803,14 +803,14 @@ class TestFlavorSet(TestFlavor):
803
803
 
804
804
  result = self.cmd.take_action(parsed_args)
805
805
 
806
- self.compute_sdk_client.find_flavor.assert_called_with(
806
+ self.compute_client.find_flavor.assert_called_with(
807
807
  parsed_args.flavor, get_extra_specs=True, ignore_missing=False
808
808
  )
809
- self.compute_sdk_client.flavor_add_tenant_access.assert_called_with(
809
+ self.compute_client.flavor_add_tenant_access.assert_called_with(
810
810
  self.flavor.id,
811
811
  self.project.id,
812
812
  )
813
- self.compute_sdk_client.create_flavor_extra_specs.assert_not_called()
813
+ self.compute_client.create_flavor_extra_specs.assert_not_called()
814
814
  self.assertIsNone(result)
815
815
 
816
816
  def test_flavor_set_no_project(self):
@@ -847,7 +847,7 @@ class TestFlavorSet(TestFlavor):
847
847
  )
848
848
 
849
849
  def test_flavor_set_with_unexist_flavor(self):
850
- self.compute_sdk_client.find_flavor.side_effect = [
850
+ self.compute_client.find_flavor.side_effect = [
851
851
  sdk_exceptions.ResourceNotFound()
852
852
  ]
853
853
 
@@ -876,10 +876,10 @@ class TestFlavorSet(TestFlavor):
876
876
  parsed_args = self.check_parser(self.cmd, arglist, verifylist)
877
877
  result = self.cmd.take_action(parsed_args)
878
878
 
879
- self.compute_sdk_client.find_flavor.assert_called_with(
879
+ self.compute_client.find_flavor.assert_called_with(
880
880
  parsed_args.flavor, get_extra_specs=True, ignore_missing=False
881
881
  )
882
- self.compute_sdk_client.flavor_add_tenant_access.assert_not_called()
882
+ self.compute_client.flavor_add_tenant_access.assert_not_called()
883
883
  self.assertIsNone(result)
884
884
 
885
885
  def test_flavor_set_description(self):
@@ -897,7 +897,7 @@ class TestFlavorSet(TestFlavor):
897
897
  parsed_args = self.check_parser(self.cmd, arglist, verifylist)
898
898
 
899
899
  result = self.cmd.take_action(parsed_args)
900
- self.compute_sdk_client.update_flavor.assert_called_with(
900
+ self.compute_client.update_flavor.assert_called_with(
901
901
  flavor=self.flavor.id, description='description'
902
902
  )
903
903
  self.assertIsNone(result)
@@ -935,7 +935,7 @@ class TestFlavorSet(TestFlavor):
935
935
  parsed_args = self.check_parser(self.cmd, arglist, verifylist)
936
936
 
937
937
  result = self.cmd.take_action(parsed_args)
938
- self.compute_sdk_client.update_flavor.assert_called_with(
938
+ self.compute_client.update_flavor.assert_called_with(
939
939
  flavor=self.flavor.id, description='description'
940
940
  )
941
941
  self.assertIsNone(result)
@@ -960,7 +960,7 @@ class TestFlavorSet(TestFlavor):
960
960
 
961
961
 
962
962
  class TestFlavorShow(TestFlavor):
963
- # Return value of self.compute_sdk_client.find_flavor().
963
+ # Return value of self.compute_client.find_flavor().
964
964
  flavor_access = compute_fakes.create_one_flavor_access()
965
965
  flavor = compute_fakes.create_one_flavor()
966
966
 
@@ -1000,8 +1000,8 @@ class TestFlavorShow(TestFlavor):
1000
1000
  super().setUp()
1001
1001
 
1002
1002
  # Return value of _find_resource()
1003
- self.compute_sdk_client.find_flavor.return_value = self.flavor
1004
- self.compute_sdk_client.get_flavor_access.return_value = [
1003
+ self.compute_client.find_flavor.return_value = self.flavor
1004
+ self.compute_client.get_flavor_access.return_value = [
1005
1005
  self.flavor_access
1006
1006
  ]
1007
1007
  self.cmd = flavor.ShowFlavor(self.app, None)
@@ -1040,7 +1040,7 @@ class TestFlavorShow(TestFlavor):
1040
1040
  'os-flavor-access:is_public': False,
1041
1041
  }
1042
1042
  )
1043
- self.compute_sdk_client.find_flavor.return_value = private_flavor
1043
+ self.compute_client.find_flavor.return_value = private_flavor
1044
1044
 
1045
1045
  arglist = [
1046
1046
  private_flavor.name,
@@ -1069,7 +1069,7 @@ class TestFlavorShow(TestFlavor):
1069
1069
 
1070
1070
  columns, data = self.cmd.take_action(parsed_args)
1071
1071
 
1072
- self.compute_sdk_client.get_flavor_access.assert_called_with(
1072
+ self.compute_client.get_flavor_access.assert_called_with(
1073
1073
  flavor=private_flavor.id
1074
1074
  )
1075
1075
  self.assertEqual(self.columns, columns)
@@ -1077,7 +1077,7 @@ class TestFlavorShow(TestFlavor):
1077
1077
 
1078
1078
 
1079
1079
  class TestFlavorUnset(TestFlavor):
1080
- # Return value of self.compute_sdk_client.find_flavor().
1080
+ # Return value of self.compute_client.find_flavor().
1081
1081
  flavor = compute_fakes.create_one_flavor(
1082
1082
  attrs={'os-flavor-access:is_public': False}
1083
1083
  )
@@ -1086,13 +1086,13 @@ class TestFlavorUnset(TestFlavor):
1086
1086
  def setUp(self):
1087
1087
  super().setUp()
1088
1088
 
1089
- self.compute_sdk_client.find_flavor.return_value = self.flavor
1089
+ self.compute_client.find_flavor.return_value = self.flavor
1090
1090
  # Return a project
1091
1091
  self.projects_mock.get.return_value = self.project
1092
1092
  self.cmd = flavor.UnsetFlavor(self.app, None)
1093
1093
 
1094
1094
  self.mock_shortcut = (
1095
- self.compute_sdk_client.delete_flavor_extra_specs_property
1095
+ self.compute_client.delete_flavor_extra_specs_property
1096
1096
  )
1097
1097
 
1098
1098
  def test_flavor_unset_property(self):
@@ -1104,11 +1104,11 @@ class TestFlavorUnset(TestFlavor):
1104
1104
  parsed_args = self.check_parser(self.cmd, arglist, verifylist)
1105
1105
 
1106
1106
  result = self.cmd.take_action(parsed_args)
1107
- self.compute_sdk_client.find_flavor.assert_called_with(
1107
+ self.compute_client.find_flavor.assert_called_with(
1108
1108
  parsed_args.flavor, get_extra_specs=True, ignore_missing=False
1109
1109
  )
1110
1110
  self.mock_shortcut.assert_called_with(self.flavor.id, 'property')
1111
- self.compute_sdk_client.flavor_remove_tenant_access.assert_not_called()
1111
+ self.compute_client.flavor_remove_tenant_access.assert_not_called()
1112
1112
  self.assertIsNone(result)
1113
1113
 
1114
1114
  def test_flavor_unset_properties(self):
@@ -1126,7 +1126,7 @@ class TestFlavorUnset(TestFlavor):
1126
1126
  parsed_args = self.check_parser(self.cmd, arglist, verifylist)
1127
1127
 
1128
1128
  self.cmd.take_action(parsed_args)
1129
- self.compute_sdk_client.find_flavor.assert_called_with(
1129
+ self.compute_client.find_flavor.assert_called_with(
1130
1130
  parsed_args.flavor, get_extra_specs=True, ignore_missing=False
1131
1131
  )
1132
1132
  calls = [
@@ -1141,7 +1141,7 @@ class TestFlavorUnset(TestFlavor):
1141
1141
  AssertionError, self.mock_shortcut.assert_has_calls, calls
1142
1142
  )
1143
1143
 
1144
- self.compute_sdk_client.flavor_remove_tenant_access.assert_not_called()
1144
+ self.compute_client.flavor_remove_tenant_access.assert_not_called()
1145
1145
 
1146
1146
  def test_flavor_unset_project(self):
1147
1147
  arglist = [
@@ -1158,14 +1158,14 @@ class TestFlavorUnset(TestFlavor):
1158
1158
  result = self.cmd.take_action(parsed_args)
1159
1159
  self.assertIsNone(result)
1160
1160
 
1161
- self.compute_sdk_client.find_flavor.assert_called_with(
1161
+ self.compute_client.find_flavor.assert_called_with(
1162
1162
  parsed_args.flavor, get_extra_specs=True, ignore_missing=False
1163
1163
  )
1164
- self.compute_sdk_client.flavor_remove_tenant_access.assert_called_with(
1164
+ self.compute_client.flavor_remove_tenant_access.assert_called_with(
1165
1165
  self.flavor.id,
1166
1166
  self.project.id,
1167
1167
  )
1168
- self.compute_sdk_client.delete_flavor_extra_specs_property.assert_not_called()
1168
+ self.compute_client.delete_flavor_extra_specs_property.assert_not_called()
1169
1169
  self.assertIsNone(result)
1170
1170
 
1171
1171
  def test_flavor_unset_no_project(self):
@@ -1202,7 +1202,7 @@ class TestFlavorUnset(TestFlavor):
1202
1202
  )
1203
1203
 
1204
1204
  def test_flavor_unset_with_unexist_flavor(self):
1205
- self.compute_sdk_client.find_flavor.side_effect = [
1205
+ self.compute_client.find_flavor.side_effect = [
1206
1206
  sdk_exceptions.ResourceNotFound
1207
1207
  ]
1208
1208
 
@@ -1232,4 +1232,4 @@ class TestFlavorUnset(TestFlavor):
1232
1232
  result = self.cmd.take_action(parsed_args)
1233
1233
  self.assertIsNone(result)
1234
1234
 
1235
- self.compute_sdk_client.flavor_remove_tenant_access.assert_not_called()
1235
+ self.compute_client.flavor_remove_tenant_access.assert_not_called()
@@ -72,7 +72,7 @@ class TestHostList(compute_fakes.TestComputev2):
72
72
  )
73
73
  ]
74
74
 
75
- self.compute_sdk_client.get.return_value = fakes.FakeResponse(
75
+ self.compute_client.get.return_value = fakes.FakeResponse(
76
76
  data={'hosts': [self._host]}
77
77
  )
78
78
  self.cmd = host.ListHost(self.app, None)
@@ -85,7 +85,7 @@ class TestHostList(compute_fakes.TestComputev2):
85
85
 
86
86
  columns, data = self.cmd.take_action(parsed_args)
87
87
 
88
- self.compute_sdk_client.get.assert_called_with(
88
+ self.compute_client.get.assert_called_with(
89
89
  '/os-hosts', microversion='2.1'
90
90
  )
91
91
  self.assertEqual(self.columns, columns)
@@ -104,7 +104,7 @@ class TestHostList(compute_fakes.TestComputev2):
104
104
 
105
105
  columns, data = self.cmd.take_action(parsed_args)
106
106
 
107
- self.compute_sdk_client.get.assert_called_with(
107
+ self.compute_client.get.assert_called_with(
108
108
  '/os-hosts', microversion='2.1'
109
109
  )
110
110
  self.assertEqual(self.columns, columns)
@@ -116,7 +116,7 @@ class TestHostSet(compute_fakes.TestComputev2):
116
116
  super().setUp()
117
117
 
118
118
  self._host = _generate_fake_host()
119
- self.compute_sdk_client.put.return_value = fakes.FakeResponse()
119
+ self.compute_client.put.return_value = fakes.FakeResponse()
120
120
 
121
121
  self.cmd = host.SetHost(self.app, None)
122
122
 
@@ -132,7 +132,7 @@ class TestHostSet(compute_fakes.TestComputev2):
132
132
 
133
133
  result = self.cmd.take_action(parsed_args)
134
134
  self.assertIsNone(result)
135
- self.compute_sdk_client.put.assert_not_called()
135
+ self.compute_client.put.assert_not_called()
136
136
 
137
137
  def test_host_set(self):
138
138
  arglist = [
@@ -150,7 +150,7 @@ class TestHostSet(compute_fakes.TestComputev2):
150
150
 
151
151
  result = self.cmd.take_action(parsed_args)
152
152
  self.assertIsNone(result)
153
- self.compute_sdk_client.put.assert_called_with(
153
+ self.compute_client.put.assert_called_with(
154
154
  f'/os-hosts/{self._host["host"]}',
155
155
  json={
156
156
  'maintenance_mode': 'disable',
@@ -183,7 +183,7 @@ class TestHostShow(compute_fakes.TestComputev2):
183
183
  )
184
184
  ]
185
185
 
186
- self.compute_sdk_client.get.return_value = fakes.FakeResponse(
186
+ self.compute_client.get.return_value = fakes.FakeResponse(
187
187
  data={
188
188
  'host': [
189
189
  {
@@ -226,7 +226,7 @@ class TestHostShow(compute_fakes.TestComputev2):
226
226
 
227
227
  columns, data = self.cmd.take_action(parsed_args)
228
228
 
229
- self.compute_sdk_client.get.assert_called_with(
229
+ self.compute_client.get.assert_called_with(
230
230
  '/os-hosts/' + self._host['host_name'], microversion='2.1'
231
231
  )
232
232
  self.assertEqual(self.columns, columns)