python-openstackclient 7.1.2__py3-none-any.whl → 7.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. openstackclient/api/api.py +2 -1
  2. openstackclient/api/image_v2.py +1 -1
  3. openstackclient/api/object_store_v1.py +12 -20
  4. openstackclient/common/clientmanager.py +1 -1
  5. openstackclient/common/module.py +2 -2
  6. openstackclient/common/quota.py +4 -4
  7. openstackclient/compute/v2/flavor.py +1 -1
  8. openstackclient/compute/v2/server.py +123 -60
  9. openstackclient/compute/v2/server_backup.py +1 -1
  10. openstackclient/compute/v2/server_image.py +1 -1
  11. openstackclient/compute/v2/server_migration.py +11 -2
  12. openstackclient/compute/v2/usage.py +3 -3
  13. openstackclient/identity/common.py +4 -1
  14. openstackclient/identity/v2_0/project.py +1 -1
  15. openstackclient/identity/v2_0/role_assignment.py +1 -1
  16. openstackclient/identity/v2_0/user.py +2 -2
  17. openstackclient/identity/v3/access_rule.py +26 -14
  18. openstackclient/identity/v3/identity_provider.py +1 -1
  19. openstackclient/identity/v3/project.py +1 -1
  20. openstackclient/identity/v3/role_assignment.py +24 -3
  21. openstackclient/identity/v3/service.py +2 -1
  22. openstackclient/identity/v3/user.py +35 -15
  23. openstackclient/image/v2/image.py +13 -13
  24. openstackclient/image/v2/metadef_objects.py +6 -4
  25. openstackclient/network/common.py +8 -7
  26. openstackclient/network/v2/floating_ip.py +6 -2
  27. openstackclient/network/v2/floating_ip_port_forwarding.py +2 -2
  28. openstackclient/network/v2/l3_conntrack_helper.py +1 -1
  29. openstackclient/network/v2/ndp_proxy.py +1 -0
  30. openstackclient/network/v2/network_agent.py +2 -6
  31. openstackclient/network/v2/network_qos_rule.py +2 -5
  32. openstackclient/network/v2/network_trunk.py +5 -4
  33. openstackclient/network/v2/port.py +18 -3
  34. openstackclient/network/v2/router.py +7 -4
  35. openstackclient/network/v2/subnet_pool.py +2 -2
  36. openstackclient/shell.py +3 -2
  37. openstackclient/tests/functional/common/test_help.py +3 -9
  38. openstackclient/tests/functional/common/test_module.py +1 -1
  39. openstackclient/tests/functional/common/test_quota.py +2 -4
  40. openstackclient/tests/functional/compute/v2/common.py +1 -3
  41. openstackclient/tests/functional/compute/v2/test_hypervisor.py +3 -3
  42. openstackclient/tests/functional/compute/v2/test_keypair.py +2 -2
  43. openstackclient/tests/functional/compute/v2/test_server.py +1 -1
  44. openstackclient/tests/functional/identity/v2/common.py +31 -48
  45. openstackclient/tests/functional/identity/v2/test_catalog.py +1 -1
  46. openstackclient/tests/functional/identity/v2/test_ec2_credentials.py +2 -2
  47. openstackclient/tests/functional/identity/v2/test_endpoint.py +2 -2
  48. openstackclient/tests/functional/identity/v2/test_project.py +8 -8
  49. openstackclient/tests/functional/identity/v2/test_role.py +14 -34
  50. openstackclient/tests/functional/identity/v2/test_service.py +2 -2
  51. openstackclient/tests/functional/identity/v2/test_token.py +1 -1
  52. openstackclient/tests/functional/identity/v2/test_user.py +7 -9
  53. openstackclient/tests/functional/identity/v3/common.py +69 -110
  54. openstackclient/tests/functional/identity/v3/test_access_rule.py +86 -0
  55. openstackclient/tests/functional/identity/v3/test_application_credential.py +18 -44
  56. openstackclient/tests/functional/identity/v3/test_catalog.py +1 -1
  57. openstackclient/tests/functional/identity/v3/test_domain.py +9 -11
  58. openstackclient/tests/functional/identity/v3/test_endpoint.py +15 -27
  59. openstackclient/tests/functional/identity/v3/test_group.py +32 -93
  60. openstackclient/tests/functional/identity/v3/test_idp.py +3 -3
  61. openstackclient/tests/functional/identity/v3/test_limit.py +32 -32
  62. openstackclient/tests/functional/identity/v3/test_project.py +17 -26
  63. openstackclient/tests/functional/identity/v3/test_region.py +6 -7
  64. openstackclient/tests/functional/identity/v3/test_registered_limit.py +27 -36
  65. openstackclient/tests/functional/identity/v3/test_role.py +30 -60
  66. openstackclient/tests/functional/identity/v3/test_role_assignment.py +33 -80
  67. openstackclient/tests/functional/identity/v3/test_service.py +7 -13
  68. openstackclient/tests/functional/identity/v3/test_service_provider.py +3 -3
  69. openstackclient/tests/functional/identity/v3/test_user.py +17 -34
  70. openstackclient/tests/functional/image/v2/test_image.py +1 -3
  71. openstackclient/tests/functional/network/v2/common.py +1 -3
  72. openstackclient/tests/functional/network/v2/test_default_security_group_rule.py +3 -8
  73. openstackclient/tests/functional/network/v2/test_l3_conntrack_helper.py +27 -31
  74. openstackclient/tests/functional/network/v2/test_network.py +9 -12
  75. openstackclient/tests/functional/network/v2/test_network_agent.py +15 -20
  76. openstackclient/tests/functional/network/v2/test_network_flavor.py +2 -2
  77. openstackclient/tests/functional/network/v2/test_network_ndp_proxy.py +17 -39
  78. openstackclient/tests/functional/network/v2/test_network_qos_rule.py +48 -63
  79. openstackclient/tests/functional/network/v2/test_network_qos_rule_type.py +1 -1
  80. openstackclient/tests/functional/network/v2/test_network_segment_range.py +2 -2
  81. openstackclient/tests/functional/network/v2/test_network_trunk.py +15 -25
  82. openstackclient/tests/functional/network/v2/test_port.py +28 -34
  83. openstackclient/tests/functional/network/v2/test_router.py +13 -19
  84. openstackclient/tests/functional/object/v1/test_object.py +4 -7
  85. openstackclient/tests/functional/volume/base.py +5 -17
  86. openstackclient/tests/functional/volume/v1/test_volume_type.py +11 -11
  87. openstackclient/tests/functional/volume/v2/test_volume_backup.py +1 -1
  88. openstackclient/tests/functional/volume/v2/test_volume_type.py +13 -15
  89. openstackclient/tests/functional/volume/v3/test_volume_type.py +13 -15
  90. openstackclient/tests/unit/api/test_compute_v2.py +0 -5
  91. openstackclient/tests/unit/api/test_object_store_v1.py +6 -4
  92. openstackclient/tests/unit/common/test_extension.py +24 -31
  93. openstackclient/tests/unit/compute/v2/test_host.py +0 -1
  94. openstackclient/tests/unit/compute/v2/test_server.py +124 -116
  95. openstackclient/tests/unit/identity/v3/test_access_rule.py +65 -64
  96. openstackclient/tests/unit/identity/v3/test_group.py +4 -10
  97. openstackclient/tests/unit/identity/v3/test_limit.py +2 -2
  98. openstackclient/tests/unit/identity/v3/test_service.py +0 -3
  99. openstackclient/tests/unit/identity/v3/test_user.py +4 -90
  100. openstackclient/tests/unit/image/v2/test_metadef_objects.py +1 -2
  101. openstackclient/tests/unit/image/v2/test_metadef_resource_type_association.py +2 -6
  102. openstackclient/tests/unit/integ/base.py +1 -1
  103. openstackclient/tests/unit/network/v2/test_default_security_group_rule.py +3 -3
  104. openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +4 -4
  105. openstackclient/tests/unit/network/v2/test_local_ip_association.py +2 -2
  106. openstackclient/tests/unit/network/v2/test_network_qos_rule.py +12 -13
  107. openstackclient/tests/unit/network/v2/test_network_trunk.py +31 -35
  108. openstackclient/tests/unit/network/v2/test_port.py +40 -17
  109. openstackclient/tests/unit/network/v2/test_subnet_pool.py +1 -1
  110. openstackclient/tests/unit/object/v1/test_object.py +1 -1
  111. openstackclient/tests/unit/utils.py +2 -2
  112. openstackclient/volume/client.py +1 -1
  113. openstackclient/volume/v1/volume.py +2 -2
  114. openstackclient/volume/v1/volume_backup.py +2 -2
  115. openstackclient/volume/v1/volume_snapshot.py +2 -2
  116. openstackclient/volume/v2/volume.py +2 -2
  117. openstackclient/volume/v2/volume_backup.py +2 -2
  118. openstackclient/volume/v2/volume_snapshot.py +2 -2
  119. openstackclient/volume/v2/volume_type.py +4 -4
  120. openstackclient/volume/v3/service.py +0 -1
  121. openstackclient/volume/v3/volume.py +3 -3
  122. openstackclient/volume/v3/volume_backup.py +2 -2
  123. openstackclient/volume/v3/volume_group.py +3 -7
  124. openstackclient/volume/v3/volume_type.py +6 -6
  125. {python_openstackclient-7.1.2.dist-info → python_openstackclient-7.2.0.dist-info}/AUTHORS +3 -0
  126. {python_openstackclient-7.1.2.dist-info → python_openstackclient-7.2.0.dist-info}/METADATA +2 -3
  127. {python_openstackclient-7.1.2.dist-info → python_openstackclient-7.2.0.dist-info}/RECORD +132 -131
  128. python_openstackclient-7.2.0.dist-info/pbr.json +1 -0
  129. python_openstackclient-7.1.2.dist-info/pbr.json +0 -1
  130. {python_openstackclient-7.1.2.dist-info → python_openstackclient-7.2.0.dist-info}/LICENSE +0 -0
  131. {python_openstackclient-7.1.2.dist-info → python_openstackclient-7.2.0.dist-info}/WHEEL +0 -0
  132. {python_openstackclient-7.1.2.dist-info → python_openstackclient-7.2.0.dist-info}/entry_points.txt +0 -0
  133. {python_openstackclient-7.1.2.dist-info → python_openstackclient-7.2.0.dist-info}/top_level.txt +0 -0
@@ -137,7 +137,7 @@ class TestCreateNetworkQosRuleMinimumBandwidth(TestNetworkQosRule):
137
137
  **{
138
138
  'min_kbps': self.new_rule.min_kbps,
139
139
  'direction': self.new_rule.direction,
140
- }
140
+ },
141
141
  )
142
142
  self.assertEqual(self.columns, columns)
143
143
  self.assertEqual(self.data, data)
@@ -244,7 +244,7 @@ class TestCreateNetworkQosRuleMinimumPacketRate(TestNetworkQosRule):
244
244
  **{
245
245
  'min_kpps': self.new_rule.min_kpps,
246
246
  'direction': self.new_rule.direction,
247
- }
247
+ },
248
248
  )
249
249
  self.assertEqual(self.columns, columns)
250
250
  self.assertEqual(self.data, data)
@@ -473,7 +473,7 @@ class TestCreateNetworkQosRuleBandwidtLimit(TestNetworkQosRule):
473
473
  **{
474
474
  'max_kbps': self.new_rule.max_kbps,
475
475
  'direction': self.new_rule.direction,
476
- }
476
+ },
477
477
  )
478
478
  self.assertEqual(self.columns, columns)
479
479
  self.assertEqual(expected_data, data)
@@ -507,7 +507,7 @@ class TestCreateNetworkQosRuleBandwidtLimit(TestNetworkQosRule):
507
507
  'max_kbps': self.new_rule.max_kbps,
508
508
  'max_burst_kbps': self.new_rule.max_burst_kbits,
509
509
  'direction': self.new_rule.direction,
510
- }
510
+ },
511
511
  )
512
512
  self.assertEqual(self.columns, columns)
513
513
  self.assertEqual(self.data, data)
@@ -903,9 +903,9 @@ class TestSetNetworkQosRuleMinimumBandwidth(TestNetworkQosRule):
903
903
  self.cmd.take_action(parsed_args)
904
904
  except exceptions.CommandError as e:
905
905
  msg = (
906
- 'Failed to set Network QoS rule ID "%(rule)s": Rule type '
906
+ f'Failed to set Network QoS rule ID "{self.new_rule.id}": Rule type '
907
907
  '"minimum-bandwidth" only requires arguments: direction, '
908
- 'min_kbps' % {'rule': self.new_rule.id}
908
+ 'min_kbps'
909
909
  )
910
910
  self.assertEqual(msg, str(e))
911
911
 
@@ -1007,9 +1007,9 @@ class TestSetNetworkQosRuleMinimumPacketRate(TestNetworkQosRule):
1007
1007
  self.cmd.take_action(parsed_args)
1008
1008
  except exceptions.CommandError as e:
1009
1009
  msg = (
1010
- 'Failed to set Network QoS rule ID "%(rule)s": Rule type '
1010
+ f'Failed to set Network QoS rule ID "{self.new_rule.id}": Rule type '
1011
1011
  '"minimum-packet-rate" only requires arguments: direction, '
1012
- 'min_kpps' % {'rule': self.new_rule.id}
1012
+ 'min_kpps'
1013
1013
  )
1014
1014
  self.assertEqual(msg, str(e))
1015
1015
 
@@ -1111,9 +1111,8 @@ class TestSetNetworkQosRuleDSCPMarking(TestNetworkQosRule):
1111
1111
  self.cmd.take_action(parsed_args)
1112
1112
  except exceptions.CommandError as e:
1113
1113
  msg = (
1114
- 'Failed to set Network QoS rule ID "%(rule)s": Rule type '
1114
+ f'Failed to set Network QoS rule ID "{self.new_rule.id}": Rule type '
1115
1115
  '"dscp-marking" only requires arguments: dscp_mark'
1116
- % {'rule': self.new_rule.id}
1117
1116
  )
1118
1117
  self.assertEqual(msg, str(e))
1119
1118
 
@@ -1249,7 +1248,7 @@ class TestSetNetworkQosRuleBandwidthLimit(TestNetworkQosRule):
1249
1248
  self.addCleanup(self._reset_direction, self.new_rule.direction)
1250
1249
 
1251
1250
  arglist = [
1252
- '--%s' % direction,
1251
+ f'--{direction}',
1253
1252
  self.new_rule.qos_policy_id,
1254
1253
  self.new_rule.id,
1255
1254
  ]
@@ -1288,9 +1287,9 @@ class TestSetNetworkQosRuleBandwidthLimit(TestNetworkQosRule):
1288
1287
  self.cmd.take_action(parsed_args)
1289
1288
  except exceptions.CommandError as e:
1290
1289
  msg = (
1291
- 'Failed to set Network QoS rule ID "%(rule)s": Rule type '
1290
+ f'Failed to set Network QoS rule ID "{self.new_rule.id}": Rule type '
1292
1291
  '"bandwidth-limit" only requires arguments: direction, '
1293
- 'max_burst_kbps, max_kbps' % {'rule': self.new_rule.id}
1292
+ 'max_burst_kbps, max_kbps'
1294
1293
  )
1295
1294
  self.assertEqual(msg, str(e))
1296
1295
 
@@ -143,13 +143,12 @@ class TestCreateNetworkTrunk(TestNetworkTrunk):
143
143
  "--parent-port",
144
144
  self.new_trunk.port_id,
145
145
  "--subport",
146
- 'port=%(port)s,segmentation-type=%(seg_type)s,'
147
- 'segmentation-id=%(seg_id)s'
148
- % {
149
- 'seg_id': subport['segmentation_id'],
150
- 'seg_type': subport['segmentation_type'],
151
- 'port': subport['port_id'],
152
- },
146
+ 'port={port},segmentation-type={seg_type},'
147
+ 'segmentation-id={seg_id}'.format(
148
+ seg_id=subport['segmentation_id'],
149
+ seg_type=subport['segmentation_type'],
150
+ port=subport['port_id'],
151
+ ),
153
152
  self.new_trunk.name,
154
153
  ]
155
154
  verifylist = [
@@ -194,12 +193,11 @@ class TestCreateNetworkTrunk(TestNetworkTrunk):
194
193
  "--parent-port",
195
194
  self.new_trunk.port_id,
196
195
  "--subport",
197
- "port=%(port)s,segmentation-type=%(seg_type)s,"
198
- "segmentation-id=boom"
199
- % {
200
- 'seg_type': subport['segmentation_type'],
201
- 'port': subport['port_id'],
202
- },
196
+ "port={port},segmentation-type={seg_type},"
197
+ "segmentation-id=boom".format(
198
+ seg_type=subport['segmentation_type'],
199
+ port=subport['port_id'],
200
+ ),
203
201
  self.new_trunk.name,
204
202
  ]
205
203
  verifylist = [
@@ -265,12 +263,10 @@ class TestCreateNetworkTrunk(TestNetworkTrunk):
265
263
  '--parent-port',
266
264
  self.new_trunk.port_id,
267
265
  '--subport',
268
- 'segmentation-type=%(seg_type)s,'
269
- 'segmentation-id=%(seg_id)s'
270
- % {
271
- 'seg_id': subport['segmentation_id'],
272
- 'seg_type': subport['segmentation_type'],
273
- },
266
+ 'segmentation-type={seg_type},' 'segmentation-id={seg_id}'.format(
267
+ seg_id=subport['segmentation_id'],
268
+ seg_type=subport['segmentation_type'],
269
+ ),
274
270
  self.new_trunk.name,
275
271
  ]
276
272
  verifylist = [
@@ -585,7 +581,7 @@ class TestSetNetworkTrunk(TestNetworkTrunk):
585
581
 
586
582
  def _test_set_network_trunk_attr(self, attr, value):
587
583
  arglist = [
588
- '--%s' % attr,
584
+ f'--{attr}',
589
585
  value,
590
586
  self._trunk[attr],
591
587
  ]
@@ -674,13 +670,12 @@ class TestSetNetworkTrunk(TestNetworkTrunk):
674
670
  subport = self._trunk['sub_ports'][0]
675
671
  arglist = [
676
672
  '--subport',
677
- 'port=%(port)s,segmentation-type=%(seg_type)s,'
678
- 'segmentation-id=%(seg_id)s'
679
- % {
680
- 'seg_id': subport['segmentation_id'],
681
- 'seg_type': subport['segmentation_type'],
682
- 'port': subport['port_id'],
683
- },
673
+ 'port={port},segmentation-type={seg_type},'
674
+ 'segmentation-id={seg_id}'.format(
675
+ seg_id=subport['segmentation_id'],
676
+ seg_type=subport['segmentation_type'],
677
+ port=subport['port_id'],
678
+ ),
684
679
  self._trunk['name'],
685
680
  ]
686
681
  verifylist = [
@@ -732,12 +727,10 @@ class TestSetNetworkTrunk(TestNetworkTrunk):
732
727
  subport = self._trunk['sub_ports'][0]
733
728
  arglist = [
734
729
  '--subport',
735
- 'segmentation-type=%(seg_type)s,'
736
- 'segmentation-id=%(seg_id)s'
737
- % {
738
- 'seg_id': subport['segmentation_id'],
739
- 'seg_type': subport['segmentation_type'],
740
- },
730
+ 'segmentation-type={seg_type},' 'segmentation-id={seg_id}'.format(
731
+ seg_id=subport['segmentation_id'],
732
+ seg_type=subport['segmentation_type'],
733
+ ),
741
734
  self._trunk['name'],
742
735
  ]
743
736
  verifylist = [
@@ -776,7 +769,8 @@ class TestSetNetworkTrunk(TestNetworkTrunk):
776
769
  with testtools.ExpectedException(exceptions.CommandError) as e:
777
770
  self.cmd.take_action(parsed_args)
778
771
  self.assertEqual(
779
- "Failed to set trunk '%s': " % self._trunk['name'], str(e)
772
+ "Failed to set trunk '{}': ".format(self._trunk['name']),
773
+ str(e),
780
774
  )
781
775
  attrs = {'name': 'reallylongname'}
782
776
  self.network_client.update_trunk.assert_called_once_with(
@@ -805,7 +799,9 @@ class TestSetNetworkTrunk(TestNetworkTrunk):
805
799
  with testtools.ExpectedException(exceptions.CommandError) as e:
806
800
  self.cmd.take_action(parsed_args)
807
801
  self.assertEqual(
808
- "Failed to add subports to trunk '%s': " % self._trunk['name'],
802
+ "Failed to add subports to trunk '{}': ".format(
803
+ self._trunk['name']
804
+ ),
809
805
  str(e),
810
806
  )
811
807
  self.network_client.update_trunk.assert_called_once_with(self._trunk)
@@ -179,7 +179,7 @@ class TestCreatePort(TestPort):
179
179
  '--mac-address',
180
180
  'aa:aa:aa:aa:aa:aa',
181
181
  '--fixed-ip',
182
- 'subnet=%s,ip-address=10.0.0.2' % self.fake_subnet.id,
182
+ f'subnet={self.fake_subnet.id},ip-address=10.0.0.2',
183
183
  '--description',
184
184
  self._port.description,
185
185
  '--device',
@@ -866,7 +866,7 @@ class TestCreatePort(TestPort):
866
866
  'test-port',
867
867
  ]
868
868
  if policy:
869
- arglist += ['--numa-policy-%s' % policy]
869
+ arglist += [f'--numa-policy-{policy}']
870
870
 
871
871
  numa_affinity_policy = None if not policy else policy
872
872
  verifylist = [
@@ -877,7 +877,7 @@ class TestCreatePort(TestPort):
877
877
  ('name', 'test-port'),
878
878
  ]
879
879
  if policy:
880
- verifylist.append(('numa_policy_%s' % policy, True))
880
+ verifylist.append((f'numa_policy_{policy}', True))
881
881
 
882
882
  parsed_args = self.check_parser(self.cmd, arglist, verifylist)
883
883
 
@@ -1418,7 +1418,7 @@ class TestListPort(compute_fakes.FakeClientMixin, TestPort):
1418
1418
  ip_address = self._ports[0].fixed_ips[0]['ip_address']
1419
1419
  arglist = [
1420
1420
  '--fixed-ip',
1421
- "ip-address=%s" % ip_address,
1421
+ f"ip-address={ip_address}",
1422
1422
  ]
1423
1423
  verifylist = [('fixed_ip', [{'ip-address': ip_address}])]
1424
1424
 
@@ -1428,7 +1428,7 @@ class TestListPort(compute_fakes.FakeClientMixin, TestPort):
1428
1428
 
1429
1429
  self.network_client.ports.assert_called_once_with(
1430
1430
  **{
1431
- 'fixed_ips': ['ip_address=%s' % ip_address],
1431
+ 'fixed_ips': [f'ip_address={ip_address}'],
1432
1432
  'fields': LIST_FIELDS_TO_RETRIEVE,
1433
1433
  }
1434
1434
  )
@@ -1439,7 +1439,7 @@ class TestListPort(compute_fakes.FakeClientMixin, TestPort):
1439
1439
  ip_address_ss = self._ports[0].fixed_ips[0]['ip_address'][:-1]
1440
1440
  arglist = [
1441
1441
  '--fixed-ip',
1442
- "ip-substring=%s" % ip_address_ss,
1442
+ f"ip-substring={ip_address_ss}",
1443
1443
  ]
1444
1444
  verifylist = [('fixed_ip', [{'ip-substring': ip_address_ss}])]
1445
1445
 
@@ -1449,7 +1449,7 @@ class TestListPort(compute_fakes.FakeClientMixin, TestPort):
1449
1449
 
1450
1450
  self.network_client.ports.assert_called_once_with(
1451
1451
  **{
1452
- 'fixed_ips': ['ip_address_substr=%s' % ip_address_ss],
1452
+ 'fixed_ips': [f'ip_address_substr={ip_address_ss}'],
1453
1453
  'fields': LIST_FIELDS_TO_RETRIEVE,
1454
1454
  }
1455
1455
  )
@@ -1460,7 +1460,7 @@ class TestListPort(compute_fakes.FakeClientMixin, TestPort):
1460
1460
  subnet_id = self._ports[0].fixed_ips[0]['subnet_id']
1461
1461
  arglist = [
1462
1462
  '--fixed-ip',
1463
- "subnet=%s" % subnet_id,
1463
+ f"subnet={subnet_id}",
1464
1464
  ]
1465
1465
  verifylist = [('fixed_ip', [{'subnet': subnet_id}])]
1466
1466
 
@@ -1475,7 +1475,7 @@ class TestListPort(compute_fakes.FakeClientMixin, TestPort):
1475
1475
 
1476
1476
  self.network_client.ports.assert_called_once_with(
1477
1477
  **{
1478
- 'fixed_ips': ['subnet_id=%s' % subnet_id],
1478
+ 'fixed_ips': [f'subnet_id={subnet_id}'],
1479
1479
  'fields': LIST_FIELDS_TO_RETRIEVE,
1480
1480
  }
1481
1481
  )
@@ -1505,8 +1505,8 @@ class TestListPort(compute_fakes.FakeClientMixin, TestPort):
1505
1505
  self.network_client.ports.assert_called_once_with(
1506
1506
  **{
1507
1507
  'fixed_ips': [
1508
- 'subnet_id=%s' % subnet_id,
1509
- 'ip_address=%s' % ip_address,
1508
+ f'subnet_id={subnet_id}',
1509
+ f'ip_address={ip_address}',
1510
1510
  ],
1511
1511
  'fields': LIST_FIELDS_TO_RETRIEVE,
1512
1512
  }
@@ -1519,9 +1519,9 @@ class TestListPort(compute_fakes.FakeClientMixin, TestPort):
1519
1519
  ip_address = self._ports[0].fixed_ips[0]['ip_address']
1520
1520
  arglist = [
1521
1521
  '--fixed-ip',
1522
- "subnet=%s" % subnet_id,
1522
+ f"subnet={subnet_id}",
1523
1523
  '--fixed-ip',
1524
- "ip-address=%s" % ip_address,
1524
+ f"ip-address={ip_address}",
1525
1525
  ]
1526
1526
  verifylist = [
1527
1527
  ('fixed_ip', [{'subnet': subnet_id}, {'ip-address': ip_address}])
@@ -1542,8 +1542,8 @@ class TestListPort(compute_fakes.FakeClientMixin, TestPort):
1542
1542
  self.network_client.ports.assert_called_once_with(
1543
1543
  **{
1544
1544
  'fixed_ips': [
1545
- 'subnet_id=%s' % subnet_id,
1546
- 'ip_address=%s' % ip_address,
1545
+ f'subnet_id={subnet_id}',
1546
+ f'ip_address={ip_address}',
1547
1547
  ],
1548
1548
  'fields': LIST_FIELDS_TO_RETRIEVE,
1549
1549
  }
@@ -1712,6 +1712,29 @@ class TestListPort(compute_fakes.FakeClientMixin, TestPort):
1712
1712
  self.assertEqual(self.columns, columns)
1713
1713
  self.assertCountEqual(self.data, list(data))
1714
1714
 
1715
+ def test_port_list_status(self):
1716
+ arglist = [
1717
+ '--status',
1718
+ 'ACTIVE',
1719
+ ]
1720
+ verifylist = [
1721
+ ('status', 'ACTIVE'),
1722
+ ]
1723
+ parsed_args = self.check_parser(self.cmd, arglist, verifylist)
1724
+
1725
+ columns, data = self.cmd.take_action(parsed_args)
1726
+ filters = {
1727
+ 'status': 'ACTIVE',
1728
+ 'fields': LIST_FIELDS_TO_RETRIEVE,
1729
+ }
1730
+
1731
+ self.network_client.ports.assert_called_once_with(**filters)
1732
+ self.assertEqual(self.columns, columns)
1733
+ self.assertEqual(
1734
+ self.data,
1735
+ list(data),
1736
+ )
1737
+
1715
1738
 
1716
1739
  class TestSetPort(TestPort):
1717
1740
  _port = network_fakes.create_one_port({'tags': ['green', 'red']})
@@ -2360,11 +2383,11 @@ class TestSetPort(TestPort):
2360
2383
 
2361
2384
  def _test_create_with_numa_affinity_policy(self, policy):
2362
2385
  arglist = [
2363
- '--numa-policy-%s' % policy,
2386
+ f'--numa-policy-{policy}',
2364
2387
  self._port.id,
2365
2388
  ]
2366
2389
  verifylist = [
2367
- ('numa_policy_%s' % policy, True),
2390
+ (f'numa_policy_{policy}', True),
2368
2391
  (
2369
2392
  'port',
2370
2393
  self._port.id,
@@ -1006,7 +1006,7 @@ class TestSetSubnetPool(TestSubnetPool):
1006
1006
  self._subnet_pool,
1007
1007
  **{
1008
1008
  'default_quota': 20,
1009
- }
1009
+ },
1010
1010
  )
1011
1011
  self.assertIsNone(result)
1012
1012
 
@@ -352,7 +352,7 @@ class TestObjectShow(TestObject):
352
352
  c_mock.assert_called_with(
353
353
  container=object_fakes.container_name,
354
354
  object=object_fakes.object_name_1,
355
- **kwargs
355
+ **kwargs,
356
356
  )
357
357
 
358
358
  collist = ('bytes', 'content_type', 'hash', 'last_modified', 'name')
@@ -62,7 +62,7 @@ class TestCase(testtools.TestCase):
62
62
 
63
63
  if m.called:
64
64
  if not msg:
65
- msg = 'method %s should not have been called' % m
65
+ msg = f'method {m} should not have been called'
66
66
  self.fail(msg)
67
67
 
68
68
 
@@ -90,7 +90,7 @@ class TestCommand(TestCase):
90
90
  argparse.ArgumentError,
91
91
  ):
92
92
  raise ParserException(
93
- "Argument parse failed: %s" % stderr.getvalue()
93
+ f"Argument parse failed: {stderr.getvalue()}"
94
94
  )
95
95
  for av in verify_args:
96
96
  attr, value = av
@@ -93,7 +93,7 @@ def make_client(instance):
93
93
  region_name=instance.region_name,
94
94
  endpoint_override=endpoint_override,
95
95
  api_version=version,
96
- **kwargs
96
+ **kwargs,
97
97
  )
98
98
 
99
99
  return client
@@ -422,9 +422,9 @@ class ListVolume(command.Lister):
422
422
  compute_client = self.app.client_manager.sdk_connection.compute
423
423
  for s in compute_client.servers():
424
424
  server_cache[s.id] = s
425
- except Exception:
425
+ except Exception: # noqa: S110
426
426
  # Just forget it if there's any trouble
427
- pass # nosec: B110
427
+ pass
428
428
  AttachmentsColumnWithCache = functools.partial(
429
429
  AttachmentsColumn, server_cache=server_cache
430
430
  )
@@ -215,9 +215,9 @@ class ListVolumeBackup(command.Lister):
215
215
  try:
216
216
  for s in volume_client.volumes.list():
217
217
  volume_cache[s.id] = s
218
- except Exception:
218
+ except Exception: # noqa: S110
219
219
  # Just forget it if there's any trouble
220
- pass # nosec: B110
220
+ pass
221
221
  VolumeIdColumnWithCache = functools.partial(
222
222
  VolumeIdColumn, volume_cache=volume_cache
223
223
  )
@@ -242,9 +242,9 @@ class ListVolumeSnapshot(command.Lister):
242
242
  try:
243
243
  for s in volume_client.volumes.list():
244
244
  volume_cache[s.id] = s
245
- except Exception:
245
+ except Exception: # noqa: S110
246
246
  # Just forget it if there's any trouble
247
- pass # nosec: B110
247
+ pass
248
248
  VolumeIdColumnWithCache = functools.partial(
249
249
  VolumeIdColumn, volume_cache=volume_cache
250
250
  )
@@ -511,9 +511,9 @@ class ListVolume(command.Lister):
511
511
  compute_client = self.app.client_manager.sdk_connection.compute
512
512
  for s in compute_client.servers():
513
513
  server_cache[s.id] = s
514
- except sdk_exceptions.SDKException:
514
+ except sdk_exceptions.SDKException: # noqa: S110
515
515
  # Just forget it if there's any trouble
516
- pass # nosec: B110
516
+ pass
517
517
  AttachmentsColumnWithCache = functools.partial(
518
518
  AttachmentsColumn, server_cache=server_cache
519
519
  )
@@ -267,9 +267,9 @@ class ListVolumeBackup(command.Lister):
267
267
  try:
268
268
  for s in volume_client.volumes():
269
269
  volume_cache[s.id] = s
270
- except Exception:
270
+ except Exception: # noqa: S110
271
271
  # Just forget it if there's any trouble
272
- pass # nosec: B110
272
+ pass
273
273
 
274
274
  _VolumeIdColumn = functools.partial(
275
275
  VolumeIdColumn, volume_cache=volume_cache
@@ -287,9 +287,9 @@ class ListVolumeSnapshot(command.Lister):
287
287
  try:
288
288
  for s in volume_client.volumes.list():
289
289
  volume_cache[s.id] = s
290
- except Exception:
290
+ except Exception: # noqa: S110
291
291
  # Just forget it if there's any trouble
292
- pass # nosec: B110
292
+ pass
293
293
  _VolumeIdColumn = functools.partial(
294
294
  VolumeIdColumn, volume_cache=volume_cache
295
295
  )
@@ -171,7 +171,7 @@ class CreateVolumeType(command.ShowOne):
171
171
  default=False,
172
172
  help=_(
173
173
  "Enabled replication for this volume type "
174
- "(this is an alias for '--property replication_enabled=<is> True') " # noqa: E501
174
+ "(this is an alias for '--property replication_enabled=<is> True') "
175
175
  "(requires driver support)"
176
176
  ),
177
177
  )
@@ -181,7 +181,7 @@ class CreateVolumeType(command.ShowOne):
181
181
  dest='availability_zones',
182
182
  help=_(
183
183
  "Set an availability zone for this volume type "
184
- "(this is an alias for '--property RESKEY:availability_zones:<az>') " # noqa: E501
184
+ "(this is an alias for '--property RESKEY:availability_zones:<az>') "
185
185
  "(repeat option to set multiple availability zones)"
186
186
  ),
187
187
  )
@@ -535,7 +535,7 @@ class SetVolumeType(command.Command):
535
535
  default=False,
536
536
  help=_(
537
537
  "Enabled replication for this volume type "
538
- "(this is an alias for '--property replication_enabled=<is> True') " # noqa: E501
538
+ "(this is an alias for '--property replication_enabled=<is> True') "
539
539
  "(requires driver support)"
540
540
  ),
541
541
  )
@@ -545,7 +545,7 @@ class SetVolumeType(command.Command):
545
545
  dest='availability_zones',
546
546
  help=_(
547
547
  "Set an availability zone for this volume type "
548
- "(this is an alias for '--property RESKEY:availability_zones:<az>') " # noqa: E501
548
+ "(this is an alias for '--property RESKEY:availability_zones:<az>') "
549
549
  "(repeat option to set multiple availability zones)"
550
550
  ),
551
551
  )
@@ -21,7 +21,6 @@ from openstackclient.volume.v2 import service as service_v2
21
21
 
22
22
 
23
23
  class ListService(service_v2.ListService):
24
-
25
24
  def take_action(self, parsed_args):
26
25
  service_client = self.app.client_manager.volume
27
26
 
@@ -154,7 +154,7 @@ class CreateVolume(volume_v2.CreateVolume):
154
154
  "Cinder cluster on which the existing volume resides; "
155
155
  "takes the form: cluster@backend-name#pool. This is only "
156
156
  "used along with the --remote-source option. "
157
- "(supported by --os-volume-api-version 3.16 or above)",
157
+ "(supported by --os-volume-api-version 3.16 or above)"
158
158
  ),
159
159
  )
160
160
  return parser
@@ -526,9 +526,9 @@ class ListVolume(command.Lister):
526
526
  compute_client = self.app.client_manager.sdk_connection.compute
527
527
  for s in compute_client.servers():
528
528
  server_cache[s.id] = s
529
- except sdk_exceptions.SDKException:
529
+ except sdk_exceptions.SDKException: # noqa: S110
530
530
  # Just forget it if there's any trouble
531
- pass # nosec: B110
531
+ pass
532
532
  AttachmentsColumnWithCache = functools.partial(
533
533
  AttachmentsColumn, server_cache=server_cache
534
534
  )
@@ -323,9 +323,9 @@ class ListVolumeBackup(command.Lister):
323
323
  try:
324
324
  for s in volume_client.volumes():
325
325
  volume_cache[s.id] = s
326
- except Exception:
326
+ except Exception: # noqa: S110
327
327
  # Just forget it if there's any trouble
328
- pass # nosec: B110
328
+ pass
329
329
 
330
330
  _VolumeIdColumn = functools.partial(
331
331
  VolumeIdColumn, volume_cache=volume_cache
@@ -288,7 +288,7 @@ class DeleteVolumeGroup(command.Command):
288
288
  default=False,
289
289
  help=_(
290
290
  'Delete the volume group even if it contains volumes. '
291
- 'This will delete any remaining volumes in the group.',
291
+ 'This will delete any remaining volumes in the group.'
292
292
  ),
293
293
  )
294
294
  return parser
@@ -582,18 +582,14 @@ class FailoverVolumeGroup(command.Command):
582
582
  action='store_true',
583
583
  dest='allow_attached_volume',
584
584
  default=False,
585
- help=_(
586
- 'Allow group with attached volumes to be failed over.',
587
- ),
585
+ help=_('Allow group with attached volumes to be failed over.'),
588
586
  )
589
587
  parser.add_argument(
590
588
  '--disallow-attached-volume',
591
589
  action='store_false',
592
590
  dest='allow_attached_volume',
593
591
  default=False,
594
- help=_(
595
- 'Disallow group with attached volumes to be failed over.',
596
- ),
592
+ help=_('Disallow group with attached volumes to be failed over.'),
597
593
  )
598
594
  parser.add_argument(
599
595
  '--secondary-backend-id',
@@ -172,7 +172,7 @@ class CreateVolumeType(command.ShowOne):
172
172
  default=False,
173
173
  help=_(
174
174
  "Enabled replication for this volume type "
175
- "(this is an alias for '--property replication_enabled=<is> True') " # noqa: E501
175
+ "(this is an alias for '--property replication_enabled=<is> True') "
176
176
  "(requires driver support)"
177
177
  ),
178
178
  )
@@ -182,7 +182,7 @@ class CreateVolumeType(command.ShowOne):
182
182
  dest='availability_zones',
183
183
  help=_(
184
184
  "Set an availability zone for this volume type "
185
- "(this is an alias for '--property RESKEY:availability_zones:<az>') " # noqa: E501
185
+ "(this is an alias for '--property RESKEY:availability_zones:<az>') "
186
186
  "(repeat option to set multiple availability zones)"
187
187
  ),
188
188
  )
@@ -448,7 +448,7 @@ class ListVolumeType(command.Lister):
448
448
  default=False,
449
449
  help=_(
450
450
  "List only volume types with replication enabled "
451
- "(this is an alias for '--property replication_enabled=<is> True') " # noqa: E501
451
+ "(this is an alias for '--property replication_enabled=<is> True') "
452
452
  "(supported by --os-volume-api-version 3.52 or above)"
453
453
  ),
454
454
  )
@@ -458,7 +458,7 @@ class ListVolumeType(command.Lister):
458
458
  dest='availability_zones',
459
459
  help=_(
460
460
  "List only volume types with this availability configured "
461
- "(this is an alias for '--property RESKEY:availability_zones:<az>') " # noqa: E501
461
+ "(this is an alias for '--property RESKEY:availability_zones:<az>') "
462
462
  "(repeat option to filter on multiple availability zones)"
463
463
  ),
464
464
  )
@@ -617,7 +617,7 @@ class SetVolumeType(command.Command):
617
617
  default=False,
618
618
  help=_(
619
619
  "Enabled replication for this volume type "
620
- "(this is an alias for '--property replication_enabled=<is> True') " # noqa: E501
620
+ "(this is an alias for '--property replication_enabled=<is> True') "
621
621
  "(requires driver support)"
622
622
  ),
623
623
  )
@@ -627,7 +627,7 @@ class SetVolumeType(command.Command):
627
627
  dest='availability_zones',
628
628
  help=_(
629
629
  "Set an availability zone for this volume type "
630
- "(this is an alias for '--property RESKEY:availability_zones:<az>') " # noqa: E501
630
+ "(this is an alias for '--property RESKEY:availability_zones:<az>') "
631
631
  "(repeat option to set multiple availability zones)"
632
632
  ),
633
633
  )