Update pre-commit hook, hacking versions

This was done with 'pre-commit autoupdate'. An invalid message is
removed from the requirements.txt files as it no longer applies with
pip's new dependency resolver.

Change-Id: I01c3ece51f81d67c740e6faca6b77df7c9932435
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2022-04-06 11:02:19 +01:00 committed by Takashi Natsume
parent 52cdbd271e
commit c408db2dd9
6 changed files with 26 additions and 26 deletions

View File

@ -4,7 +4,7 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.1.0
hooks:
- id: trailing-whitespace
- id: mixed-line-ending
@ -16,7 +16,7 @@ repos:
- id: check-yaml
files: .*\.(yaml|yml)$
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.10
rev: v1.1.13
hooks:
- id: remove-tabs
exclude: '.*\.(svg)$'
@ -25,7 +25,7 @@ repos:
- id: flake8
name: flake8
additional_dependencies:
- hacking>=3.0.1,<3.1.0
- hacking~=4.1.0
language: python
entry: flake8
files: '^.*\.py$'

View File

@ -3397,7 +3397,8 @@ class ShellTest(utils.TestCase):
def test_services_list_v269_with_down_cells(self):
"""Tests nova service-list at the 2.69 microversion."""
stdout, _stderr = self.run_command('service-list', api_version='2.69')
self.assertEqual('''\
self.assertEqual(
'''\
+--------------------------------------+--------------+-----------+------+----------+-------+---------------------+-----------------+-------------+
| Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason | Forced down |
+--------------------------------------+--------------+-----------+------+----------+-------+---------------------+-----------------+-------------+
@ -3406,7 +3407,8 @@ class ShellTest(utils.TestCase):
| | nova-compute | host-down | | UNKNOWN | | | | |
+--------------------------------------+--------------+-----------+------+----------+-------+---------------------+-----------------+-------------+
''', # noqa
stdout)
stdout,
)
self.assert_called('GET', '/os-services')
def test_services_list_with_host(self):
@ -4779,7 +4781,8 @@ class ShellTest(utils.TestCase):
def test_list_detail_v269_with_down_cells(self):
"""Tests nova list at the 2.69 microversion."""
stdout, _stderr = self.run_command('list', api_version='2.69')
self.assertIn('''\
self.assertIn(
'''\
+------+----------------+---------+------------+-------------+----------------------------------------------+
| ID | Name | Status | Task State | Power State | Networks |
+------+----------------+---------+------------+-------------+----------------------------------------------+
@ -4791,7 +4794,8 @@ class ShellTest(utils.TestCase):
| 9013 | sample-server4 | ACTIVE | N/A | N/A | |
+------+----------------+---------+------------+-------------+----------------------------------------------+
''', # noqa
stdout)
stdout,
)
self.assert_called('GET', '/servers/detail')
def test_list_v269_with_down_cells(self):
@ -4812,7 +4816,8 @@ class ShellTest(utils.TestCase):
def test_show_v269_with_down_cells(self):
stdout, _stderr = self.run_command('show 9015', api_version='2.69')
self.assertEqual('''\
self.assertEqual(
'''\
+-----------------------------+---------------------------------------------------+
| Property | Value |
+-----------------------------+---------------------------------------------------+
@ -4833,7 +4838,8 @@ class ShellTest(utils.TestCase):
| user_id | fake |
+-----------------------------+---------------------------------------------------+
''', # noqa
stdout)
stdout,
)
FAKE_UUID_2 = 'c99d7632-bd66-4be9-aed5-3dd14b223a76'
self.assert_called('GET', '/servers?name=9015', pos=0)
self.assert_called('GET', '/servers?name=9015', pos=1)

View File

@ -116,13 +116,14 @@ def service_type(stype):
return inner
def pretty_choice_list(l):
return ', '.join("'%s'" % i for i in l)
def pretty_choice_list(values):
return ', '.join("'%s'" % x for x in values)
def pretty_choice_dict(d):
def pretty_choice_dict(values):
"""Returns a formatted dict as 'key=value'."""
return pretty_choice_list(['%s=%s' % (k, d[k]) for k in sorted(d.keys())])
return pretty_choice_list(
['%s=%s' % (k, values[k]) for k in sorted(values)])
def print_list(objs, fields, formatters={}, sortby_index=None):

View File

@ -3231,15 +3231,15 @@ def _print_absolute_limits(limits):
other = {}
limit_names = []
columns = ['Name', 'Used', 'Max']
for l in limits:
map = limit_map.get(l.name, {'name': l.name, 'type': 'other'})
for limit in limits:
map = limit_map.get(limit.name, {'name': limit.name, 'type': 'other'})
name = map['name']
if map['type'] == 'max':
max[name] = l.value
max[name] = limit.value
elif map['type'] == 'used':
used[name] = l.value
used[name] = limit.value
else:
other[name] = l.value
other[name] = limit.value
if 'Other' not in columns:
columns.append('Other')
if name not in limit_names:

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.
pbr!=2.1.0,>=2.0.0 # Apache-2.0
keystoneauth1>=3.5.0 # Apache-2.0
iso8601>=0.1.11 # MIT

View File

@ -1,8 +1,4 @@
# 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.
hacking>=3.0.1,<3.1.0 # Apache-2.0
hacking~=4.1.0 # Apache-2.0
bandit>=1.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
ddt>=1.0.1 # MIT