Bump hacking
We also bump the other linters, although these don't change anything. Change-Id: I07ddb8743804172a4e81a70b1ee4aa897e48dfca Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
@@ -30,7 +30,7 @@ repos:
|
|||||||
exclude: 'nova/virt/ironic/ironic_states.py'
|
exclude: 'nova/virt/ironic/ironic_states.py'
|
||||||
|
|
||||||
- repo: https://github.com/Lucas-C/pre-commit-hooks
|
- repo: https://github.com/Lucas-C/pre-commit-hooks
|
||||||
rev: v1.5.5
|
rev: v1.5.6
|
||||||
hooks:
|
hooks:
|
||||||
- id: remove-tabs
|
- id: remove-tabs
|
||||||
exclude: '.*\.(svg)$'
|
exclude: '.*\.(svg)$'
|
||||||
@@ -46,7 +46,7 @@ repos:
|
|||||||
# fixing an issue changes the code and that should
|
# fixing an issue changes the code and that should
|
||||||
# not happen in ci.
|
# not happen in ci.
|
||||||
- repo: https://opendev.org/openstack/hacking
|
- repo: https://opendev.org/openstack/hacking
|
||||||
rev: 7.0.0
|
rev: 8.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: hacking
|
- id: hacking
|
||||||
additional_dependencies: []
|
additional_dependencies: []
|
||||||
@@ -59,7 +59,7 @@ repos:
|
|||||||
args: ['--ignore-words=doc/dictionary.txt']
|
args: ['--ignore-words=doc/dictionary.txt']
|
||||||
|
|
||||||
- repo: https://github.com/sphinx-contrib/sphinx-lint
|
- repo: https://github.com/sphinx-contrib/sphinx-lint
|
||||||
rev: v1.0.1
|
rev: v1.0.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: sphinx-lint
|
- id: sphinx-lint
|
||||||
args: [--enable=default-role]
|
args: [--enable=default-role]
|
||||||
|
|||||||
@@ -64,8 +64,6 @@ def validate(name: str, value: str):
|
|||||||
|
|
||||||
|
|
||||||
def load_validators():
|
def load_validators():
|
||||||
global VALIDATORS
|
|
||||||
|
|
||||||
def _report_load_failure(mgr, ep, err):
|
def _report_load_failure(mgr, ep, err):
|
||||||
LOG.warning(u'Failed to load %s: %s', ep.module_name, err)
|
LOG.warning(u'Failed to load %s: %s', ep.module_name, err)
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ _REGEX_RANGE_CACHE = {}
|
|||||||
def memorize(func):
|
def memorize(func):
|
||||||
@functools.wraps(func)
|
@functools.wraps(func)
|
||||||
def memorizer(*args, **kwargs):
|
def memorizer(*args, **kwargs):
|
||||||
global _REGEX_RANGE_CACHE
|
|
||||||
key = "%s:%s:%s" % (func.__name__, hash(str(args)), hash(str(kwargs)))
|
key = "%s:%s:%s" % (func.__name__, hash(str(args)), hash(str(kwargs)))
|
||||||
value = _REGEX_RANGE_CACHE.get(key)
|
value = _REGEX_RANGE_CACHE.get(key)
|
||||||
if value is None:
|
if value is None:
|
||||||
|
|||||||
@@ -335,7 +335,6 @@ def set_target_cell(context, cell_mapping):
|
|||||||
:param context: The RequestContext to add connection information
|
:param context: The RequestContext to add connection information
|
||||||
:param cell_mapping: An objects.CellMapping object or None
|
:param cell_mapping: An objects.CellMapping object or None
|
||||||
"""
|
"""
|
||||||
global CELL_CACHE
|
|
||||||
if cell_mapping is not None:
|
if cell_mapping is not None:
|
||||||
# avoid circular import
|
# avoid circular import
|
||||||
from nova.db.main import api as db
|
from nova.db.main import api as db
|
||||||
|
|||||||
@@ -261,7 +261,6 @@ _DEFAULT_FS_BY_OSTYPE = {'linux': FS_FORMAT_EXT4,
|
|||||||
|
|
||||||
|
|
||||||
def load_mkfs_command(os_type, command):
|
def load_mkfs_command(os_type, command):
|
||||||
global _MKFS_COMMAND
|
|
||||||
global _DEFAULT_MKFS_COMMAND
|
global _DEFAULT_MKFS_COMMAND
|
||||||
|
|
||||||
_MKFS_COMMAND[os_type] = command
|
_MKFS_COMMAND[os_type] = command
|
||||||
@@ -270,8 +269,6 @@ def load_mkfs_command(os_type, command):
|
|||||||
|
|
||||||
|
|
||||||
def get_fs_type_for_os_type(os_type):
|
def get_fs_type_for_os_type(os_type):
|
||||||
global _MKFS_COMMAND
|
|
||||||
|
|
||||||
return os_type if _MKFS_COMMAND.get(os_type) else 'default'
|
return os_type if _MKFS_COMMAND.get(os_type) else 'default'
|
||||||
|
|
||||||
|
|
||||||
@@ -289,9 +286,6 @@ def _get_hash_str(base_str):
|
|||||||
|
|
||||||
def get_file_extension_for_os_type(os_type, default_ephemeral_format,
|
def get_file_extension_for_os_type(os_type, default_ephemeral_format,
|
||||||
specified_fs=None):
|
specified_fs=None):
|
||||||
global _MKFS_COMMAND
|
|
||||||
global _DEFAULT_MKFS_COMMAND
|
|
||||||
|
|
||||||
mkfs_command = _MKFS_COMMAND.get(os_type, _DEFAULT_MKFS_COMMAND)
|
mkfs_command = _MKFS_COMMAND.get(os_type, _DEFAULT_MKFS_COMMAND)
|
||||||
if mkfs_command:
|
if mkfs_command:
|
||||||
extension = mkfs_command
|
extension = mkfs_command
|
||||||
@@ -352,9 +346,6 @@ def configurable_mkfs(os_type, fs_label, target, run_as_root,
|
|||||||
# os type. If user has not provided any configuration, format type will
|
# os type. If user has not provided any configuration, format type will
|
||||||
# be used according to a default_ephemeral_format configuration or a
|
# be used according to a default_ephemeral_format configuration or a
|
||||||
# system default.
|
# system default.
|
||||||
global _MKFS_COMMAND
|
|
||||||
global _DEFAULT_MKFS_COMMAND
|
|
||||||
|
|
||||||
mkfs_command = (_MKFS_COMMAND.get(os_type, _DEFAULT_MKFS_COMMAND) or
|
mkfs_command = (_MKFS_COMMAND.get(os_type, _DEFAULT_MKFS_COMMAND) or
|
||||||
'') % {'fs_label': fs_label, 'target': target}
|
'') % {'fs_label': fs_label, 'target': target}
|
||||||
if mkfs_command:
|
if mkfs_command:
|
||||||
|
|||||||
@@ -1376,7 +1376,6 @@ def _instances_cores_ram_count(context, project_id, user_id=None):
|
|||||||
'cores': <count across user>,
|
'cores': <count across user>,
|
||||||
'ram': <count across user>}}
|
'ram': <count across user>}}
|
||||||
"""
|
"""
|
||||||
global UID_QFD_POPULATED_CACHE_BY_PROJECT
|
|
||||||
if CONF.quota.count_usage_from_placement:
|
if CONF.quota.count_usage_from_placement:
|
||||||
# If a project has all user_id and queued_for_delete data populated,
|
# If a project has all user_id and queued_for_delete data populated,
|
||||||
# cache the result to avoid needless database checking in the future.
|
# cache the result to avoid needless database checking in the future.
|
||||||
|
|||||||
Vendored
-2
@@ -420,7 +420,6 @@ class CellDatabases(fixtures.Fixture):
|
|||||||
def _cache_schema(self, connection_str):
|
def _cache_schema(self, connection_str):
|
||||||
# NOTE(melwitt): See the regular Database fixture for why
|
# NOTE(melwitt): See the regular Database fixture for why
|
||||||
# we do this.
|
# we do this.
|
||||||
global DB_SCHEMA
|
|
||||||
if not DB_SCHEMA[('main', None)]:
|
if not DB_SCHEMA[('main', None)]:
|
||||||
ctxt_mgr = self._ctxt_mgrs[connection_str]
|
ctxt_mgr = self._ctxt_mgrs[connection_str]
|
||||||
engine = ctxt_mgr.writer.get_engine()
|
engine = ctxt_mgr.writer.get_engine()
|
||||||
@@ -706,7 +705,6 @@ class Database(fixtures.Fixture):
|
|||||||
self.addCleanup(self.cleanup)
|
self.addCleanup(self.cleanup)
|
||||||
|
|
||||||
def _apply_schema(self):
|
def _apply_schema(self):
|
||||||
global DB_SCHEMA
|
|
||||||
if not DB_SCHEMA[(self.database, self.version)]:
|
if not DB_SCHEMA[(self.database, self.version)]:
|
||||||
# apply and cache schema
|
# apply and cache schema
|
||||||
engine = self.get_engine()
|
engine = self.get_engine()
|
||||||
|
|||||||
@@ -7399,9 +7399,6 @@ class ComputeTestCase(BaseTestCase,
|
|||||||
raised_exc = None
|
raised_exc = None
|
||||||
|
|
||||||
def fake_db_fault_create(ctxt, values):
|
def fake_db_fault_create(ctxt, values):
|
||||||
global exc_info
|
|
||||||
global raised_exc
|
|
||||||
|
|
||||||
self.assertIn('raise messaging.RemoteError', values['details'])
|
self.assertIn('raise messaging.RemoteError', values['details'])
|
||||||
self.assertIn('Remote error: test My Test Message\nNone.',
|
self.assertIn('Remote error: test My Test Message\nNone.',
|
||||||
values['details'])
|
values['details'])
|
||||||
|
|||||||
@@ -154,11 +154,12 @@ def set_stub_network_methods(test):
|
|||||||
|
|
||||||
|
|
||||||
def unset_stub_network_methods(test):
|
def unset_stub_network_methods(test):
|
||||||
global _real_functions
|
if not _real_functions:
|
||||||
if _real_functions:
|
return
|
||||||
for name in _real_functions:
|
|
||||||
test.stub_out('nova.compute.manager.ComputeManager.' + name,
|
for name in _real_functions:
|
||||||
_real_functions[name])
|
test.stub_out('nova.compute.manager.ComputeManager.' + name,
|
||||||
|
_real_functions[name])
|
||||||
|
|
||||||
|
|
||||||
def _get_fake_cache():
|
def _get_fake_cache():
|
||||||
|
|||||||
@@ -57,8 +57,6 @@ def fake_execute(*cmd_parts, **kwargs):
|
|||||||
It optionally executes a preconfigured function to return expected data.
|
It optionally executes a preconfigured function to return expected data.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
global _fake_execute_repliers
|
|
||||||
|
|
||||||
process_input = kwargs.get('process_input', None)
|
process_input = kwargs.get('process_input', None)
|
||||||
check_exit_code = kwargs.get('check_exit_code', 0)
|
check_exit_code = kwargs.get('check_exit_code', 0)
|
||||||
delay_on_retry = kwargs.get('delay_on_retry', True)
|
delay_on_retry = kwargs.get('delay_on_retry', True)
|
||||||
|
|||||||
@@ -765,8 +765,6 @@ def read_cached_file(filename, force_reload=False):
|
|||||||
:returns: A tuple with a boolean specifying if the data is fresh
|
:returns: A tuple with a boolean specifying if the data is fresh
|
||||||
or not.
|
or not.
|
||||||
"""
|
"""
|
||||||
global _FILE_CACHE
|
|
||||||
|
|
||||||
if force_reload:
|
if force_reload:
|
||||||
delete_cached_file(filename)
|
delete_cached_file(filename)
|
||||||
|
|
||||||
@@ -788,8 +786,6 @@ def delete_cached_file(filename):
|
|||||||
|
|
||||||
:param filename: filename to delete
|
:param filename: filename to delete
|
||||||
"""
|
"""
|
||||||
global _FILE_CACHE
|
|
||||||
|
|
||||||
if filename in _FILE_CACHE:
|
if filename in _FILE_CACHE:
|
||||||
del _FILE_CACHE[filename]
|
del _FILE_CACHE[filename]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user