Bump hacking

hacking 3.0.x is quite old. Bump it to the version now commonly used
in multiple repositories.

Change-Id: I16cc59ee5d7e5218b809ba49b2f6e10ebd6f54e4
This commit is contained in:
Takashi Kajinami 2024-09-19 22:22:07 +09:00
parent 90a8bb95ce
commit 355dc12e3a
13 changed files with 20 additions and 36 deletions

View File

@ -1,6 +1,3 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
openstackdocstheme>=2.2.1 # Apache-2.0
osprofiler>=1.4.0 # Apache-2.0
os-api-ref>=1.4.0 # Apache-2.0

View File

@ -184,7 +184,7 @@ class Cluster(base.APIBase):
master_lb_enabled = wsme.wsattr(types.boolean)
"""Indicates whether created clusters should have a load balancer for master
nodes or not.
"""
""" # noqa: E501
def __init__(self, **kwargs):
super(Cluster, self).__init__()

View File

@ -141,7 +141,7 @@ class ClusterTemplate(base.APIBase):
master_lb_enabled = wsme.wsattr(types.boolean, default=False)
"""Indicates whether created clusters should have a load balancer for master
nodes or not.
"""
""" # noqa: E501
floating_ip_enabled = wsme.wsattr(types.boolean, default=True)
"""Indicates whether created clusters should have a floating ip or not."""

View File

@ -86,7 +86,8 @@ def apply_jsonpatch(doc, patch):
p['path'] == '/health_status_reason')):
try:
val = p['value']
dict_val = val if type(val) == dict else ast.literal_eval(val)
dict_val = (val if isinstance(val, dict)
else ast.literal_eval(val))
p['value'] = dict_val
except (SyntaxError, ValueError, AssertionError) as e:
raise exception.PatchError(patch=patch, reason=e)

View File

@ -93,7 +93,7 @@ def assert_equal_in(logical_line):
"""Check for assertEqual(True|False, A in B), assertEqual(A in B, True|False)
M338
"""
""" # noqa: E501
res = (assert_equal_in_start_with_true_or_false_re.search(logical_line) or
assert_equal_in_end_with_true_or_false_re.search(logical_line))
if res:
@ -109,7 +109,7 @@ def no_xrange(logical_line):
M339
"""
if assert_xrange_re.match(logical_line):
yield(0, "M339: Do not use xrange().")
yield (0, "M339: Do not use xrange().")
@core.flake8ext
@ -169,4 +169,4 @@ def check_explicit_underscore_import(logical_line, filename):
UNDERSCORE_IMPORT_FILES.append(filename)
elif (translated_log.match(logical_line) or
string_translation.match(logical_line)):
yield(0, "M340: Found use of _() without explicit import of _ !")
yield (0, "M340: Found use of _() without explicit import of _ !")

View File

@ -94,7 +94,7 @@ class X509KeyPair(base.MagnumPersistentObject, base.MagnumObject):
:param uuid: the uuid of a x509keypair.
:param context: Security context
:returns: a :class:`X509KeyPair` object.
"""
""" # noqa: E501
db_x509keypair = cls.dbapi.get_x509keypair_by_uuid(context, uuid)
x509keypair = X509KeyPair._from_db_object(cls(context), db_x509keypair)
return x509keypair

View File

@ -691,7 +691,7 @@ class TestPost(api_base.FunctionalTest):
# Create mock for db and image data
with mock.patch.object(
self.dbapi, 'create_cluster_template',
wraps=self.dbapi.create_cluster_template) as cc_mock,\
wraps=self.dbapi.create_cluster_template) as cc_mock, \
mock.patch('magnum.api.attr_validator.validate_image')\
as mock_image_data:
mock_image_data.return_value = {'name': 'mock_name',

View File

@ -206,7 +206,7 @@ class TestPatch(api_base.FunctionalTest):
# make sure it was added:
fed = self.get_json('/federations/%s' % f.uuid)
self.assertTrue(new_member.uuid in fed['member_ids'])
self.assertIn(new_member.uuid, fed['member_ids'])
def test_member_unjoin(self):
member = obj_utils.create_test_cluster(self.context)
@ -221,7 +221,7 @@ class TestPatch(api_base.FunctionalTest):
# make sure it was deleted:
fed = self.get_json('/federations/%s' % federation.uuid)
self.assertFalse(member.uuid in fed['member_ids'])
self.assertNotIn(member.uuid, fed['member_ids'])
def test_join_non_existent_cluster(self):
foo_uuid = uuidutils.generate_uuid()

View File

@ -158,11 +158,11 @@ class TestQuota(api_base.FunctionalTest):
expected = [r.project_id for r in quota_list[:2]]
res_proj_ids = [r['project_id'] for r in response['quotas']]
self.assertEqual(sorted(expected), sorted(res_proj_ids))
self.assertTrue('http://localhost/v1/quotas?' in response['next'])
self.assertTrue('sort_key=id' in response['next'])
self.assertTrue('sort_dir=asc' in response['next'])
self.assertTrue('limit=2' in response['next'])
self.assertTrue('marker=%s' % quota_list[1].id in response['next'])
self.assertIn('http://localhost/v1/quotas?', response['next'])
self.assertIn('sort_key=id', response['next'])
self.assertIn('sort_dir=asc', response['next'])
self.assertIn('limit=2', response['next'])
self.assertIn('marker=%s' % quota_list[1].id, response['next'])
@mock.patch("magnum.common.policy.enforce")
@mock.patch("magnum.common.context.make_context")

View File

@ -46,5 +46,5 @@ class TestX509Operations(base.BaseTestCase):
def test_generate_csr_and_key(self):
csr_keys = operations.generate_csr_and_key(u"Test")
self.assertIsNotNone(csr_keys)
self.assertTrue("public_key" in csr_keys)
self.assertTrue("private_key" in csr_keys)
self.assertIn("public_key", csr_keys)
self.assertIn("private_key", csr_keys)

View File

@ -221,7 +221,7 @@ def create_test_magnum_service(**kw):
:param kw: kwargs with overriding values for magnum_service's attributes.
:returns: Test magnum_service DB object.
"""
""" # noqa: E501
magnum_service = get_test_magnum_service(**kw)
# Let DB generate ID if it isn't specified explicitly
if 'id' not in kw:

View File

@ -2,13 +2,6 @@
# date but we do not test them so no guarantee of having them all correct. If
# you find any incorrect lower bounds, let us know or propose a fix.
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
# Despite above warning added by global sync process, please use
# ascii betical order.
PyYAML>=3.13 # MIT
SQLAlchemy>=1.2.0 # MIT
WSME>=0.8.0 # MIT

View File

@ -1,16 +1,9 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
# Despite above warning added by global sync process, please use
# ascii betical order.
bandit!=1.6.0,>=1.1.0 # Apache-2.0
bashate>=2.0.0 # Apache-2.0
coverage>=5.3 # Apache-2.0
doc8>=0.8.1 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
hacking>=3.0.1,<3.1.0 # Apache-2.0
hacking>=6.1.0,<6.2.0 # Apache-2.0
oslotest>=4.4.1 # Apache-2.0
osprofiler>=3.4.0 # Apache-2.0
Pygments>=2.7.2 # BSD license