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'
|
||||
|
||||
- repo: https://github.com/Lucas-C/pre-commit-hooks
|
||||
rev: v1.5.5
|
||||
rev: v1.5.6
|
||||
hooks:
|
||||
- id: remove-tabs
|
||||
exclude: '.*\.(svg)$'
|
||||
@@ -46,7 +46,7 @@ repos:
|
||||
# fixing an issue changes the code and that should
|
||||
# not happen in ci.
|
||||
- repo: https://opendev.org/openstack/hacking
|
||||
rev: 7.0.0
|
||||
rev: 8.0.0
|
||||
hooks:
|
||||
- id: hacking
|
||||
additional_dependencies: []
|
||||
@@ -59,7 +59,7 @@ repos:
|
||||
args: ['--ignore-words=doc/dictionary.txt']
|
||||
|
||||
- repo: https://github.com/sphinx-contrib/sphinx-lint
|
||||
rev: v1.0.1
|
||||
rev: v1.0.2
|
||||
hooks:
|
||||
- id: sphinx-lint
|
||||
args: [--enable=default-role]
|
||||
|
||||
@@ -64,8 +64,6 @@ def validate(name: str, value: str):
|
||||
|
||||
|
||||
def load_validators():
|
||||
global VALIDATORS
|
||||
|
||||
def _report_load_failure(mgr, ep, err):
|
||||
LOG.warning(u'Failed to load %s: %s', ep.module_name, err)
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ _REGEX_RANGE_CACHE = {}
|
||||
def memorize(func):
|
||||
@functools.wraps(func)
|
||||
def memorizer(*args, **kwargs):
|
||||
global _REGEX_RANGE_CACHE
|
||||
key = "%s:%s:%s" % (func.__name__, hash(str(args)), hash(str(kwargs)))
|
||||
value = _REGEX_RANGE_CACHE.get(key)
|
||||
if value is None:
|
||||
|
||||
@@ -335,7 +335,6 @@ def set_target_cell(context, cell_mapping):
|
||||
:param context: The RequestContext to add connection information
|
||||
:param cell_mapping: An objects.CellMapping object or None
|
||||
"""
|
||||
global CELL_CACHE
|
||||
if cell_mapping is not None:
|
||||
# avoid circular import
|
||||
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):
|
||||
global _MKFS_COMMAND
|
||||
global _DEFAULT_MKFS_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):
|
||||
global _MKFS_COMMAND
|
||||
|
||||
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,
|
||||
specified_fs=None):
|
||||
global _MKFS_COMMAND
|
||||
global _DEFAULT_MKFS_COMMAND
|
||||
|
||||
mkfs_command = _MKFS_COMMAND.get(os_type, _DEFAULT_MKFS_COMMAND)
|
||||
if 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
|
||||
# be used according to a default_ephemeral_format configuration or a
|
||||
# system default.
|
||||
global _MKFS_COMMAND
|
||||
global _DEFAULT_MKFS_COMMAND
|
||||
|
||||
mkfs_command = (_MKFS_COMMAND.get(os_type, _DEFAULT_MKFS_COMMAND) or
|
||||
'') % {'fs_label': fs_label, 'target': target}
|
||||
if mkfs_command:
|
||||
|
||||
@@ -1376,7 +1376,6 @@ def _instances_cores_ram_count(context, project_id, user_id=None):
|
||||
'cores': <count across user>,
|
||||
'ram': <count across user>}}
|
||||
"""
|
||||
global UID_QFD_POPULATED_CACHE_BY_PROJECT
|
||||
if CONF.quota.count_usage_from_placement:
|
||||
# If a project has all user_id and queued_for_delete data populated,
|
||||
# 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):
|
||||
# NOTE(melwitt): See the regular Database fixture for why
|
||||
# we do this.
|
||||
global DB_SCHEMA
|
||||
if not DB_SCHEMA[('main', None)]:
|
||||
ctxt_mgr = self._ctxt_mgrs[connection_str]
|
||||
engine = ctxt_mgr.writer.get_engine()
|
||||
@@ -706,7 +705,6 @@ class Database(fixtures.Fixture):
|
||||
self.addCleanup(self.cleanup)
|
||||
|
||||
def _apply_schema(self):
|
||||
global DB_SCHEMA
|
||||
if not DB_SCHEMA[(self.database, self.version)]:
|
||||
# apply and cache schema
|
||||
engine = self.get_engine()
|
||||
|
||||
@@ -7399,9 +7399,6 @@ class ComputeTestCase(BaseTestCase,
|
||||
raised_exc = None
|
||||
|
||||
def fake_db_fault_create(ctxt, values):
|
||||
global exc_info
|
||||
global raised_exc
|
||||
|
||||
self.assertIn('raise messaging.RemoteError', values['details'])
|
||||
self.assertIn('Remote error: test My Test Message\nNone.',
|
||||
values['details'])
|
||||
|
||||
@@ -154,8 +154,9 @@ def set_stub_network_methods(test):
|
||||
|
||||
|
||||
def unset_stub_network_methods(test):
|
||||
global _real_functions
|
||||
if _real_functions:
|
||||
if not _real_functions:
|
||||
return
|
||||
|
||||
for name in _real_functions:
|
||||
test.stub_out('nova.compute.manager.ComputeManager.' + name,
|
||||
_real_functions[name])
|
||||
|
||||
@@ -57,8 +57,6 @@ def fake_execute(*cmd_parts, **kwargs):
|
||||
It optionally executes a preconfigured function to return expected data.
|
||||
|
||||
"""
|
||||
global _fake_execute_repliers
|
||||
|
||||
process_input = kwargs.get('process_input', None)
|
||||
check_exit_code = kwargs.get('check_exit_code', 0)
|
||||
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
|
||||
or not.
|
||||
"""
|
||||
global _FILE_CACHE
|
||||
|
||||
if force_reload:
|
||||
delete_cached_file(filename)
|
||||
|
||||
@@ -788,8 +786,6 @@ def delete_cached_file(filename):
|
||||
|
||||
:param filename: filename to delete
|
||||
"""
|
||||
global _FILE_CACHE
|
||||
|
||||
if filename in _FILE_CACHE:
|
||||
del _FILE_CACHE[filename]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user