python-openstackclient 8.0.0__py3-none-any.whl → 8.1.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 (85) hide show
  1. openstackclient/compute/client.py +5 -0
  2. openstackclient/compute/v2/console.py +7 -0
  3. openstackclient/compute/v2/console_connection.py +48 -0
  4. openstackclient/compute/v2/keypair.py +10 -3
  5. openstackclient/compute/v2/server.py +75 -10
  6. openstackclient/compute/v2/server_event.py +1 -1
  7. openstackclient/identity/common.py +79 -0
  8. openstackclient/identity/v3/application_credential.py +2 -2
  9. openstackclient/identity/v3/domain.py +62 -43
  10. openstackclient/identity/v3/group.py +113 -68
  11. openstackclient/identity/v3/project.py +17 -0
  12. openstackclient/identity/v3/user.py +38 -5
  13. openstackclient/image/client.py +5 -0
  14. openstackclient/image/v2/image.py +11 -11
  15. openstackclient/network/client.py +0 -6
  16. openstackclient/network/v2/floating_ip.py +58 -29
  17. openstackclient/network/v2/network_qos_rule.py +3 -11
  18. openstackclient/network/v2/router.py +1 -1
  19. openstackclient/network/v2/security_group.py +5 -4
  20. openstackclient/network/v2/security_group_rule.py +1 -1
  21. openstackclient/shell.py +1 -1
  22. openstackclient/tests/functional/base.py +5 -1
  23. openstackclient/tests/functional/compute/v2/test_keypair.py +41 -5
  24. openstackclient/tests/unit/compute/v2/fakes.py +81 -305
  25. openstackclient/tests/unit/compute/v2/test_console.py +18 -1
  26. openstackclient/tests/unit/compute/v2/test_console_connection.py +72 -0
  27. openstackclient/tests/unit/compute/v2/test_flavor.py +1 -1
  28. openstackclient/tests/unit/compute/v2/test_keypair.py +12 -5
  29. openstackclient/tests/unit/compute/v2/test_server.py +169 -46
  30. openstackclient/tests/unit/compute/v2/test_server_backup.py +32 -71
  31. openstackclient/tests/unit/compute/v2/test_server_event.py +2 -2
  32. openstackclient/tests/unit/compute/v2/test_server_image.py +33 -72
  33. openstackclient/tests/unit/compute/v2/test_server_migration.py +4 -4
  34. openstackclient/tests/unit/identity/v3/test_application_credential.py +47 -25
  35. openstackclient/tests/unit/identity/v3/test_domain.py +115 -105
  36. openstackclient/tests/unit/identity/v3/test_group.py +353 -202
  37. openstackclient/tests/unit/identity/v3/test_project.py +16 -0
  38. openstackclient/tests/unit/identity/v3/test_user.py +86 -6
  39. openstackclient/tests/unit/image/v1/test_image.py +8 -9
  40. openstackclient/tests/unit/image/v2/test_image.py +49 -49
  41. openstackclient/tests/unit/network/v2/fakes.py +405 -485
  42. openstackclient/tests/unit/network/v2/test_floating_ip_network.py +13 -19
  43. openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py +2 -2
  44. openstackclient/tests/unit/network/v2/test_ndp_proxy.py +1 -3
  45. openstackclient/tests/unit/network/v2/test_network.py +4 -4
  46. openstackclient/tests/unit/network/v2/test_network_agent.py +15 -29
  47. openstackclient/tests/unit/network/v2/test_network_qos_policy.py +16 -19
  48. openstackclient/tests/unit/network/v2/test_network_qos_rule.py +79 -152
  49. openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py +4 -6
  50. openstackclient/tests/unit/network/v2/test_network_rbac.py +2 -2
  51. openstackclient/tests/unit/network/v2/test_port.py +17 -17
  52. openstackclient/tests/unit/network/v2/test_router.py +73 -57
  53. openstackclient/tests/unit/network/v2/test_security_group_network.py +25 -27
  54. openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +1 -3
  55. openstackclient/tests/unit/network/v2/test_security_group_rule_network.py +33 -39
  56. openstackclient/tests/unit/volume/v2/fakes.py +1 -2
  57. openstackclient/tests/unit/volume/v2/test_service.py +57 -91
  58. openstackclient/tests/unit/volume/v2/test_volume.py +108 -105
  59. openstackclient/tests/unit/volume/v2/test_volume_backup.py +141 -148
  60. openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +293 -283
  61. openstackclient/tests/unit/volume/v3/test_block_storage_log_level.py +61 -71
  62. openstackclient/tests/unit/volume/v3/test_service.py +221 -141
  63. openstackclient/tests/unit/volume/v3/test_volume.py +130 -119
  64. openstackclient/tests/unit/volume/v3/test_volume_attachment.py +1 -1
  65. openstackclient/tests/unit/volume/v3/test_volume_backup.py +198 -203
  66. openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +682 -47
  67. openstackclient/volume/v2/service.py +41 -38
  68. openstackclient/volume/v2/volume.py +63 -37
  69. openstackclient/volume/v2/volume_backup.py +9 -3
  70. openstackclient/volume/v2/volume_snapshot.py +121 -84
  71. openstackclient/volume/v3/block_storage_log_level.py +22 -28
  72. openstackclient/volume/v3/service.py +105 -14
  73. openstackclient/volume/v3/volume.py +200 -39
  74. openstackclient/volume/v3/volume_backup.py +24 -19
  75. openstackclient/volume/v3/volume_snapshot.py +485 -10
  76. {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/AUTHORS +8 -0
  77. python_openstackclient-8.1.0.dist-info/METADATA +264 -0
  78. {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/RECORD +83 -81
  79. {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/entry_points.txt +7 -6
  80. python_openstackclient-8.1.0.dist-info/pbr.json +1 -0
  81. python_openstackclient-8.0.0.dist-info/METADATA +0 -166
  82. python_openstackclient-8.0.0.dist-info/pbr.json +0 -1
  83. {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/LICENSE +0 -0
  84. {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/WHEEL +0 -0
  85. {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/top_level.txt +0 -0
@@ -10,33 +10,32 @@
10
10
  # License for the specific language governing permissions and limitations
11
11
  # under the License.
12
12
 
13
+ from openstack.identity.v3 import domain as _domain
14
+ from openstack.test import fakes as sdk_fakes
13
15
  from openstackclient.identity.v3 import domain
14
16
  from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes
15
17
 
16
18
 
17
- class TestDomain(identity_fakes.TestIdentityv3):
18
- def setUp(self):
19
- super().setUp()
20
-
21
- # Get a shortcut to the DomainManager Mock
22
- self.domains_mock = self.identity_client.domains
23
- self.domains_mock.reset_mock()
24
-
25
-
26
- class TestDomainCreate(TestDomain):
27
- columns = ('description', 'enabled', 'id', 'name', 'tags')
19
+ class TestDomainCreate(identity_fakes.TestIdentityv3):
20
+ columns = (
21
+ 'id',
22
+ 'name',
23
+ 'enabled',
24
+ 'description',
25
+ 'options',
26
+ )
28
27
 
29
28
  def setUp(self):
30
29
  super().setUp()
31
30
 
32
- self.domain = identity_fakes.FakeDomain.create_one_domain()
33
- self.domains_mock.create.return_value = self.domain
31
+ self.domain = sdk_fakes.generate_fake_resource(_domain.Domain)
32
+ self.identity_sdk_client.create_domain.return_value = self.domain
34
33
  self.datalist = (
35
- self.domain.description,
36
- True,
37
34
  self.domain.id,
38
35
  self.domain.name,
39
- self.domain.tags,
36
+ self.domain.is_enabled,
37
+ self.domain.description,
38
+ self.domain.options,
40
39
  )
41
40
 
42
41
  # Get the command object to test
@@ -61,9 +60,9 @@ class TestDomainCreate(TestDomain):
61
60
  'name': self.domain.name,
62
61
  'description': None,
63
62
  'options': {},
64
- 'enabled': True,
63
+ 'is_enabled': True,
65
64
  }
66
- self.domains_mock.create.assert_called_with(**kwargs)
65
+ self.identity_sdk_client.create_domain.assert_called_with(**kwargs)
67
66
 
68
67
  self.assertEqual(self.columns, columns)
69
68
  self.assertEqual(self.datalist, data)
@@ -90,9 +89,9 @@ class TestDomainCreate(TestDomain):
90
89
  'name': self.domain.name,
91
90
  'description': 'new desc',
92
91
  'options': {},
93
- 'enabled': True,
92
+ 'is_enabled': True,
94
93
  }
95
- self.domains_mock.create.assert_called_with(**kwargs)
94
+ self.identity_sdk_client.create_domain.assert_called_with(**kwargs)
96
95
 
97
96
  self.assertEqual(self.columns, columns)
98
97
  self.assertEqual(self.datalist, data)
@@ -103,7 +102,7 @@ class TestDomainCreate(TestDomain):
103
102
  self.domain.name,
104
103
  ]
105
104
  verifylist = [
106
- ('enable', True),
105
+ ('is_enabled', True),
107
106
  ('name', self.domain.name),
108
107
  ]
109
108
  parsed_args = self.check_parser(self.cmd, arglist, verifylist)
@@ -118,9 +117,9 @@ class TestDomainCreate(TestDomain):
118
117
  'name': self.domain.name,
119
118
  'description': None,
120
119
  'options': {},
121
- 'enabled': True,
120
+ 'is_enabled': True,
122
121
  }
123
- self.domains_mock.create.assert_called_with(**kwargs)
122
+ self.identity_sdk_client.create_domain.assert_called_with(**kwargs)
124
123
 
125
124
  self.assertEqual(self.columns, columns)
126
125
  self.assertEqual(self.datalist, data)
@@ -131,7 +130,7 @@ class TestDomainCreate(TestDomain):
131
130
  self.domain.name,
132
131
  ]
133
132
  verifylist = [
134
- ('disable', True),
133
+ ('is_enabled', False),
135
134
  ('name', self.domain.name),
136
135
  ]
137
136
  parsed_args = self.check_parser(self.cmd, arglist, verifylist)
@@ -146,9 +145,9 @@ class TestDomainCreate(TestDomain):
146
145
  'name': self.domain.name,
147
146
  'description': None,
148
147
  'options': {},
149
- 'enabled': False,
148
+ 'is_enabled': False,
150
149
  }
151
- self.domains_mock.create.assert_called_with(**kwargs)
150
+ self.identity_sdk_client.create_domain.assert_called_with(**kwargs)
152
151
 
153
152
  self.assertEqual(self.columns, columns)
154
153
  self.assertEqual(self.datalist, data)
@@ -174,9 +173,9 @@ class TestDomainCreate(TestDomain):
174
173
  'name': self.domain.name,
175
174
  'description': None,
176
175
  'options': {'immutable': True},
177
- 'enabled': True,
176
+ 'is_enabled': True,
178
177
  }
179
- self.domains_mock.create.assert_called_with(**kwargs)
178
+ self.identity_sdk_client.create_domain.assert_called_with(**kwargs)
180
179
 
181
180
  self.assertEqual(self.columns, columns)
182
181
  self.assertEqual(self.datalist, data)
@@ -202,23 +201,23 @@ class TestDomainCreate(TestDomain):
202
201
  'name': self.domain.name,
203
202
  'description': None,
204
203
  'options': {'immutable': False},
205
- 'enabled': True,
204
+ 'is_enabled': True,
206
205
  }
207
- self.domains_mock.create.assert_called_with(**kwargs)
206
+ self.identity_sdk_client.create_domain.assert_called_with(**kwargs)
208
207
 
209
208
  self.assertEqual(self.columns, columns)
210
209
  self.assertEqual(self.datalist, data)
211
210
 
212
211
 
213
- class TestDomainDelete(TestDomain):
214
- domain = identity_fakes.FakeDomain.create_one_domain()
212
+ class TestDomainDelete(identity_fakes.TestIdentityv3):
213
+ domain = sdk_fakes.generate_fake_resource(_domain.Domain)
215
214
 
216
215
  def setUp(self):
217
216
  super().setUp()
218
217
 
219
218
  # This is the return value for utils.find_resource()
220
- self.domains_mock.get.return_value = self.domain
221
- self.domains_mock.delete.return_value = None
219
+ self.identity_sdk_client.find_domain.return_value = self.domain
220
+ self.identity_sdk_client.delete_domain.return_value = None
222
221
 
223
222
  # Get the command object to test
224
223
  self.cmd = domain.DeleteDomain(self.app, None)
@@ -234,19 +233,35 @@ class TestDomainDelete(TestDomain):
234
233
 
235
234
  result = self.cmd.take_action(parsed_args)
236
235
 
237
- self.domains_mock.delete.assert_called_with(
236
+ self.identity_sdk_client.delete_domain.assert_called_with(
238
237
  self.domain.id,
239
238
  )
240
239
  self.assertIsNone(result)
241
240
 
242
241
 
243
- class TestDomainList(TestDomain):
244
- domain = identity_fakes.FakeDomain.create_one_domain()
242
+ class TestDomainList(identity_fakes.TestIdentityv3):
243
+ domain = sdk_fakes.generate_fake_resource(
244
+ resource_type=_domain.Domain, is_enabled=True
245
+ )
246
+ columns = (
247
+ 'ID',
248
+ 'Name',
249
+ 'Enabled',
250
+ 'Description',
251
+ )
245
252
 
246
253
  def setUp(self):
247
254
  super().setUp()
248
255
 
249
- self.domains_mock.list.return_value = [self.domain]
256
+ self.identity_sdk_client.domains.return_value = [self.domain]
257
+ self.datalist = (
258
+ (
259
+ self.domain.id,
260
+ self.domain.name,
261
+ self.domain.is_enabled,
262
+ self.domain.description,
263
+ ),
264
+ )
250
265
 
251
266
  # Get the command object to test
252
267
  self.cmd = domain.ListDomain(self.app, None)
@@ -260,19 +275,10 @@ class TestDomainList(TestDomain):
260
275
  # returns a tuple containing the column names and an iterable
261
276
  # containing the data to be listed.
262
277
  columns, data = self.cmd.take_action(parsed_args)
263
- self.domains_mock.list.assert_called_with()
278
+ self.identity_sdk_client.domains.assert_called_with()
264
279
 
265
- collist = ('ID', 'Name', 'Enabled', 'Description')
266
- self.assertEqual(collist, columns)
267
- datalist = (
268
- (
269
- self.domain.id,
270
- self.domain.name,
271
- True,
272
- self.domain.description,
273
- ),
274
- )
275
- self.assertEqual(datalist, tuple(data))
280
+ self.assertEqual(self.columns, columns)
281
+ self.assertEqual(self.datalist, tuple(data))
276
282
 
277
283
  def test_domain_list_with_option_name(self):
278
284
  arglist = ['--name', self.domain.name]
@@ -285,23 +291,14 @@ class TestDomainList(TestDomain):
285
291
  columns, data = self.cmd.take_action(parsed_args)
286
292
 
287
293
  kwargs = {'name': self.domain.name}
288
- self.domains_mock.list.assert_called_with(**kwargs)
294
+ self.identity_sdk_client.domains.assert_called_with(**kwargs)
289
295
 
290
- collist = ('ID', 'Name', 'Enabled', 'Description')
291
- self.assertEqual(collist, columns)
292
- datalist = (
293
- (
294
- self.domain.id,
295
- self.domain.name,
296
- True,
297
- self.domain.description,
298
- ),
299
- )
300
- self.assertEqual(datalist, tuple(data))
296
+ self.assertEqual(self.columns, columns)
297
+ self.assertEqual(self.datalist, tuple(data))
301
298
 
302
299
  def test_domain_list_with_option_enabled(self):
303
300
  arglist = ['--enabled']
304
- verifylist = [('enabled', True)]
301
+ verifylist = [('is_enabled', True)]
305
302
  parsed_args = self.check_parser(self.cmd, arglist, verifylist)
306
303
 
307
304
  # In base command class Lister in cliff, abstract method take_action()
@@ -309,31 +306,22 @@ class TestDomainList(TestDomain):
309
306
  # containing the data to be listed.
310
307
  columns, data = self.cmd.take_action(parsed_args)
311
308
 
312
- kwargs = {'enabled': True}
313
- self.domains_mock.list.assert_called_with(**kwargs)
309
+ kwargs = {'is_enabled': True}
310
+ self.identity_sdk_client.domains.assert_called_with(**kwargs)
314
311
 
315
- collist = ('ID', 'Name', 'Enabled', 'Description')
316
- self.assertEqual(collist, columns)
317
- datalist = (
318
- (
319
- self.domain.id,
320
- self.domain.name,
321
- True,
322
- self.domain.description,
323
- ),
324
- )
325
- self.assertEqual(datalist, tuple(data))
312
+ self.assertEqual(self.columns, columns)
313
+ self.assertEqual(self.datalist, tuple(data))
326
314
 
327
315
 
328
- class TestDomainSet(TestDomain):
329
- domain = identity_fakes.FakeDomain.create_one_domain()
316
+ class TestDomainSet(identity_fakes.TestIdentityv3):
317
+ domain = sdk_fakes.generate_fake_resource(_domain.Domain)
330
318
 
331
319
  def setUp(self):
332
320
  super().setUp()
333
321
 
334
- self.domains_mock.get.return_value = self.domain
322
+ self.identity_sdk_client.find_domain.return_value = self.domain
335
323
 
336
- self.domains_mock.update.return_value = self.domain
324
+ self.identity_sdk_client.update_domain.return_value = self.domain
337
325
 
338
326
  # Get the command object to test
339
327
  self.cmd = domain.SetDomain(self.app, None)
@@ -350,7 +338,9 @@ class TestDomainSet(TestDomain):
350
338
  result = self.cmd.take_action(parsed_args)
351
339
 
352
340
  kwargs = {}
353
- self.domains_mock.update.assert_called_with(self.domain.id, **kwargs)
341
+ self.identity_sdk_client.update_domain.assert_called_with(
342
+ self.domain.id, **kwargs
343
+ )
354
344
  self.assertIsNone(result)
355
345
 
356
346
  def test_domain_set_name(self):
@@ -371,7 +361,9 @@ class TestDomainSet(TestDomain):
371
361
  kwargs = {
372
362
  'name': 'qwerty',
373
363
  }
374
- self.domains_mock.update.assert_called_with(self.domain.id, **kwargs)
364
+ self.identity_sdk_client.update_domain.assert_called_with(
365
+ self.domain.id, **kwargs
366
+ )
375
367
  self.assertIsNone(result)
376
368
 
377
369
  def test_domain_set_description(self):
@@ -392,7 +384,9 @@ class TestDomainSet(TestDomain):
392
384
  kwargs = {
393
385
  'description': 'new desc',
394
386
  }
395
- self.domains_mock.update.assert_called_with(self.domain.id, **kwargs)
387
+ self.identity_sdk_client.update_domain.assert_called_with(
388
+ self.domain.id, **kwargs
389
+ )
396
390
  self.assertIsNone(result)
397
391
 
398
392
  def test_domain_set_enable(self):
@@ -401,7 +395,7 @@ class TestDomainSet(TestDomain):
401
395
  self.domain.id,
402
396
  ]
403
397
  verifylist = [
404
- ('enable', True),
398
+ ('is_enabled', True),
405
399
  ('domain', self.domain.id),
406
400
  ]
407
401
  parsed_args = self.check_parser(self.cmd, arglist, verifylist)
@@ -410,9 +404,11 @@ class TestDomainSet(TestDomain):
410
404
 
411
405
  # Set expected values
412
406
  kwargs = {
413
- 'enabled': True,
407
+ 'is_enabled': True,
414
408
  }
415
- self.domains_mock.update.assert_called_with(self.domain.id, **kwargs)
409
+ self.identity_sdk_client.update_domain.assert_called_with(
410
+ self.domain.id, **kwargs
411
+ )
416
412
  self.assertIsNone(result)
417
413
 
418
414
  def test_domain_set_disable(self):
@@ -421,7 +417,7 @@ class TestDomainSet(TestDomain):
421
417
  self.domain.id,
422
418
  ]
423
419
  verifylist = [
424
- ('disable', True),
420
+ ('is_enabled', False),
425
421
  ('domain', self.domain.id),
426
422
  ]
427
423
  parsed_args = self.check_parser(self.cmd, arglist, verifylist)
@@ -430,9 +426,11 @@ class TestDomainSet(TestDomain):
430
426
 
431
427
  # Set expected values
432
428
  kwargs = {
433
- 'enabled': False,
429
+ 'is_enabled': False,
434
430
  }
435
- self.domains_mock.update.assert_called_with(self.domain.id, **kwargs)
431
+ self.identity_sdk_client.update_domain.assert_called_with(
432
+ self.domain.id, **kwargs
433
+ )
436
434
  self.assertIsNone(result)
437
435
 
438
436
  def test_domain_set_immutable_option(self):
@@ -452,7 +450,9 @@ class TestDomainSet(TestDomain):
452
450
  kwargs = {
453
451
  'options': {'immutable': True},
454
452
  }
455
- self.domains_mock.update.assert_called_with(self.domain.id, **kwargs)
453
+ self.identity_sdk_client.update_domain.assert_called_with(
454
+ self.domain.id, **kwargs
455
+ )
456
456
  self.assertIsNone(result)
457
457
 
458
458
  def test_domain_set_no_immutable_option(self):
@@ -472,16 +472,34 @@ class TestDomainSet(TestDomain):
472
472
  kwargs = {
473
473
  'options': {'immutable': False},
474
474
  }
475
- self.domains_mock.update.assert_called_with(self.domain.id, **kwargs)
475
+ self.identity_sdk_client.update_domain.assert_called_with(
476
+ self.domain.id, **kwargs
477
+ )
476
478
  self.assertIsNone(result)
477
479
 
478
480
 
479
- class TestDomainShow(TestDomain):
481
+ class TestDomainShow(identity_fakes.TestIdentityv3):
482
+ columns = (
483
+ 'id',
484
+ 'name',
485
+ 'enabled',
486
+ 'description',
487
+ 'options',
488
+ )
489
+
480
490
  def setUp(self):
481
491
  super().setUp()
482
492
 
483
- self.domain = identity_fakes.FakeDomain.create_one_domain()
484
- self.domains_mock.get.return_value = self.domain
493
+ self.domain = sdk_fakes.generate_fake_resource(_domain.Domain)
494
+ self.identity_sdk_client.find_domain.return_value = self.domain
495
+ self.datalist = (
496
+ self.domain.id,
497
+ self.domain.name,
498
+ self.domain.is_enabled,
499
+ self.domain.description,
500
+ self.domain.options,
501
+ )
502
+
485
503
  # Get the command object to test
486
504
  self.cmd = domain.ShowDomain(self.app, None)
487
505
 
@@ -501,17 +519,9 @@ class TestDomainShow(TestDomain):
501
519
  # returns a two-part tuple with a tuple of column names and a tuple of
502
520
  # data to be shown.
503
521
  columns, data = self.cmd.take_action(parsed_args)
504
- self.domains_mock.get.assert_called_with(
522
+ self.identity_sdk_client.find_domain.assert_called_with(
505
523
  self.domain.id,
506
524
  )
507
525
 
508
- collist = ('description', 'enabled', 'id', 'name', 'tags')
509
- self.assertEqual(collist, columns)
510
- datalist = (
511
- self.domain.description,
512
- True,
513
- self.domain.id,
514
- self.domain.name,
515
- self.domain.tags,
516
- )
517
- self.assertEqual(datalist, data)
526
+ self.assertEqual(self.columns, columns)
527
+ self.assertEqual(self.datalist, data)