Bump hacking

hacking 3.0.x is too old.

Change-Id: I1fa5bf30150c4d6fa38d4103f652fb6b82963cf3
This commit is contained in:
Takashi Kajinami 2024-01-27 23:27:29 +09:00
parent 64f58141bb
commit 5a2c000557
11 changed files with 18 additions and 17 deletions

View File

@ -251,8 +251,8 @@ def get_service_type(f):
return getattr(f, 'service_type', None) return getattr(f, 'service_type', None)
def pretty_choice_list(l): def pretty_choice_list(choices):
return ', '.join("'%s'" % i for i in l) return ', '.join("'%s'" % choice for choice in choices)
def exit(msg=''): def exit(msg=''):

View File

@ -98,7 +98,7 @@ class BaseTestCase(base.ClientTestBase):
res["deleted"] = False res["deleted"] = False
if "client" not in res: if "client" not in res:
res["client"] = cls.get_cleanup_client() res["client"] = cls.get_cleanup_client()
if not(res["deleted"]): if not res["deleted"]:
res_id = res["id"] res_id = res["id"]
client = res["client"] client = res["client"]
deletion_params = res.get("deletion_params") deletion_params = res.get("deletion_params")

View File

@ -422,7 +422,7 @@ class OSCClientTestBase(base.ClientTestBase):
if availability_zone: if availability_zone:
cmd += f' --availability-zone {availability_zone}' cmd += f' --availability-zone {availability_zone}'
if restart_check: if restart_check:
cmd += f' --restart-check' cmd += ' --restart-check'
check_result = self.dict_result('share', cmd) check_result = self.dict_result('share', cmd)
return check_result return check_result

View File

@ -109,7 +109,7 @@ class ResourceLockTests(base.OSCClientTestBase):
'lock list --lock-context user ' 'lock list --lock-context user '
f' --resource {self.share["id"]}') f' --resource {self.share["id"]}')
self.assertEqual(2, len(locks)) self.assertEqual(2, len(locks))
self.assertNotIn(lock_3['id'], [l['ID'] for l in locks]) self.assertNotIn(lock_3['id'], [lock['ID'] for lock in locks])
locks = self.listing_result('share', locks = self.listing_result('share',
'lock list --lock-context user' 'lock list --lock-context user'
@ -118,9 +118,9 @@ class ResourceLockTests(base.OSCClientTestBase):
' --sort-dir desc ' ' --sort-dir desc '
' --limit 1') ' --limit 1')
self.assertEqual(1, len(locks)) self.assertEqual(1, len(locks))
self.assertIn(lock_2['id'], [l['ID'] for l in locks]) self.assertIn(lock_2['id'], [lock['ID'] for lock in locks])
self.assertNotIn(lock_1['id'], [l['ID'] for l in locks]) self.assertNotIn(lock_1['id'], [lock['ID'] for lock in locks])
self.assertNotIn(lock_3['id'], [l['ID'] for l in locks]) self.assertNotIn(lock_3['id'], [lock['ID'] for lock in locks])
def test_lock_set_unset_lock_reason(self): def test_lock_set_unset_lock_reason(self):
lock = self.create_resource_lock(self.share['id'], lock = self.create_resource_lock(self.share['id'],

View File

@ -186,7 +186,7 @@ class ListShareAccessRulesTestCase(base.OSCClientTestBase):
output = self.openstack( output = self.openstack(
'share', 'share',
params=f'access list {share["id"]} --access-to {access_to_filter}', params=f'access list {share["id"]} --access-to {access_to_filter}',
flags=f'--os-share-api-version 2.82') flags='--os-share-api-version 2.82')
access_rule_list = self.parser.listing(output) access_rule_list = self.parser.listing(output)
self.assertTrue(len(access_rule_list) == 1) self.assertTrue(len(access_rule_list) == 1)
@ -214,7 +214,7 @@ class ShowShareAccessRulesTestCase(base.OSCClientTestBase):
self.assertEqual(access_rule_show['created_at'], self.assertEqual(access_rule_show['created_at'],
access_rule['created_at']) access_rule['created_at'])
self.assertEqual(access_rule_show['properties'], '') self.assertEqual(access_rule_show['properties'], '')
self.assertTrue('updated_at' in access_rule_show) self.assertIn('updated_at', access_rule_show)
class SetShareAccessTestCase(base.OSCClientTestBase): class SetShareAccessTestCase(base.OSCClientTestBase):

View File

@ -65,7 +65,7 @@ class FakeClient(object):
break break
assert found, 'Expected %s %s; got %s' % ( assert found, 'Expected %s %s; got %s' % (
expected, self.client.callstack) expected[0], expected[1], self.client.callstack)
if body is not None: if body is not None:
try: try:

View File

@ -1087,7 +1087,7 @@ class FakeHTTPClient(fakes.FakeHTTPClient):
return (200, {}, {'extra_specs': {'k': 'v'}}) return (200, {}, {'extra_specs': {'k': 'v'}})
def delete_types_1_extra_specs_k(self, **kw): def delete_types_1_extra_specs_k(self, **kw):
return(204, {}, None) return (204, {}, None)
def delete_types_1(self, **kw): def delete_types_1(self, **kw):
return (202, {}, None) return (202, {}, None)

View File

@ -160,5 +160,5 @@ class TestLimitsManager(utils.TestCase):
api.client.get.assert_called_once_with('/limits') api.client.get.assert_called_once_with('/limits')
self.assertIsInstance(lim, limits.Limits) self.assertIsInstance(lim, limits.Limits)
for l in lim.absolute: for li in lim.absolute:
self.assertEqual(l1, l) self.assertEqual(l1, li)

View File

@ -50,7 +50,7 @@ class ShareNetworkTest(utils.TestCase):
api_version = api_versions.APIVersion(microversion) api_version = api_versions.APIVersion(microversion)
values = self.values.copy() values = self.values.copy()
if (api_version >= api_versions.APIVersion("2.26")): if (api_version >= api_versions.APIVersion("2.26")):
del(values['nova_net_id']) del values['nova_net_id']
body_expected = {share_networks.RESOURCE_NAME: values} body_expected = {share_networks.RESOURCE_NAME: values}
manager = share_networks.ShareNetworkManager( manager = share_networks.ShareNetworkManager(
@ -123,7 +123,7 @@ class ShareNetworkTest(utils.TestCase):
api_version = api_versions.APIVersion(microversion) api_version = api_versions.APIVersion(microversion)
values = self.values.copy() values = self.values.copy()
if (api_version >= api_versions.APIVersion("2.26")): if (api_version >= api_versions.APIVersion("2.26")):
del(values['nova_net_id']) del values['nova_net_id']
body_expected = {share_networks.RESOURCE_NAME: values} body_expected = {share_networks.RESOURCE_NAME: values}
manager = share_networks.ShareNetworkManager( manager = share_networks.ShareNetworkManager(

View File

@ -4884,6 +4884,7 @@ def do_extend(cs, args):
share = _find_share(cs, args.share) share = _find_share(cs, args.share)
_print_share(cs, share) _print_share(cs, share)
@cliutils.arg('share', metavar='<share>', @cliutils.arg('share', metavar='<share>',
help='Name or ID of share to shrink.') help='Name or ID of share to shrink.')
@cliutils.arg('new_size', @cliutils.arg('new_size',

View File

@ -1,4 +1,4 @@
hacking>=3.0.1,<3.1.0 # Apache-2.0 hacking>=6.1.0,<6.2.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0
ddt>=1.0.1 # MIT ddt>=1.0.1 # MIT