Skip to content

Commit

Permalink
make pylint and spellcheck happy again
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterMocary authored and pirat89 committed Oct 10, 2023
1 parent 4d8ad1c commit 2440854
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 16 deletions.
4 changes: 3 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ disable=
duplicate-string-formatting-argument, # TMP: will be fixed in close future
consider-using-f-string, # sorry, not gonna happen, still have to support py2
use-dict-literal,
redundant-u-string-prefix # still have py2 to support
redundant-u-string-prefix, # still have py2 to support
logging-format-interpolation,
logging-not-lazy

[FORMAT]
# Maximum number of characters on a single line.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def _major_version_check(instance):
return False
return True
except (ValueError, IndexError):
api.current_logger().warn(
api.current_logger().warning(
'Failed to parse manifest release field for instance {}'.format(instance.name), exc_info=True)
return False

Expand Down Expand Up @@ -164,7 +164,7 @@ def _sp_rev_patchlevel_check(instance, patchlevels):
return True
return False
# if not 'len(number) > 2 and number.isdigit()'
api.current_logger().warn(
api.current_logger().warning(
'Invalid rev-number field value `{}` in manifest for instance {}'.format(number, instance.name))
return False

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def perform_target_iso_checks():
return

if next(requested_target_iso_msg_iter, None):
api.current_logger().warn('Received multiple msgs with target ISO to use.')
api.current_logger().warning('Received multiple msgs with target ISO to use.')

# Cascade the inhibiting conditions so that we do not spam the user with inhibitors
is_iso_invalid = inhibit_if_not_valid_iso_file(target_iso)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ ibdmp() {
#
# 1. encode tarball using base64
#
# 2. pre-pend line `chunks=CHUNKS,md5=MD5` where
# 2. prepend line `chunks=CHUNKS,md5=MD5` where
# MD5 is the MD5 digest of original tarball and
# CHUNKS is number of upcoming Base64 chunks
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def produce_repofile_if_iso_used():
return

if next(target_iso_msgs_iter, None):
api.current_logger().warn('Received multiple TargetISInstallationImage messages, using the first one')
api.current_logger().warning('Received multiple TargetISInstallationImage messages, using the first one')

# Mounting was successful, create a repofile to copy into target userspace
repofile_entry_template = ('[{repoid}]\n'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def _inhibit_upgrade(msg):
def _read_repofile(repofile):
# NOTE: what about catch StopActorExecution error when the file cannot be
# obtained -> then check whether old_repomap file exists and in such a case
# inform user they have to provde the new repomap.json file (we have the
# inform user they have to provide the new repomap.json file (we have the
# warning now only which could be potentially overlooked)
repofile_data = load_data_asset(api.current_actor(),
repofile,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def _find_deprecation_data_entries(lscpu):
if is_detected(lscpu, entry)
]

api.current_logger().warn('Unsupported platform could not detect relevant CPU information')
api.current_logger().warning('Unsupported platform could not detect relevant CPU information')
return []


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _decoded(s):
# Most likely an empty line, but we're being permissive here and ignore failures.
# In the end it's all about having the right values available.
if line:
api.current_logger().warn(
api.current_logger().warning(
'Failed to parse line in manifest: {file}. Line was: `{line}`'.format(file=path,
line=line),
exc_info=True)
Expand Down Expand Up @@ -128,6 +128,6 @@ def get_instance_status(instance_number, sapcontrol_path, admin_name):
# In that case there are always more than 7 lines.
return len(output['stdout'].split('\n')) > 7
except CalledProcessError:
api.current_logger().warn(
api.current_logger().warning(
'Failed to retrieve SAP HANA instance status from sapcontrol - Considering it as not running.')
return False
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def is_rh_release_pkg(pkg_name):
return '' # We did not determine anything

if len(redhat_release_pkgs) > 1:
api.current_logger().warn('Multiple packages with name redhat-release* found when '
'determining RHEL version of the supplied installation ISO.')
api.current_logger().warning('Multiple packages with name redhat-release* found when '
'determining RHEL version of the supplied installation ISO.')

redhat_release_pkg = redhat_release_pkgs[0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def _get_files_owned_by_rpms(context, dirpath, pkgs=None, recursive=False):

def _copy_certificates(context, target_userspace):
"""
Copy the needed cetificates into the container, but preserve original ones
Copy the needed certificates into the container, but preserve original ones
Some certificates are already installed in the container and those are
default certificates for the target OS, so we preserve these.
Expand Down Expand Up @@ -378,7 +378,7 @@ def _copy_certificates(context, target_userspace):

# The path original path of the broken symlink in the container
report_path = os.path.join(target_pki, os.path.relpath(src_path, backup_pki))
api.current_logger().warn('File {} is a broken symlink!'.format(report_path))
api.current_logger().warning('File {} is a broken symlink!'.format(report_path))
break

src_path = next_path
Expand Down
2 changes: 1 addition & 1 deletion repos/system_upgrade/common/libraries/rhui.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def gen_rhui_files_map():

def copy_rhui_data(context, provider):
"""
Copy relevant RHUI cerificates and key into the target userspace container
Copy relevant RHUI certificates and key into the target userspace container
"""
rhui_dir = api.get_common_folder_path('rhui')
data_dir = os.path.join(rhui_dir, provider)
Expand Down
2 changes: 1 addition & 1 deletion repos/system_upgrade/common/libraries/tests/test_rhsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def test_get_release_with_release_not_set(monkeypatch, actor_mocked, context_moc

release = rhsm.get_release(context_mocked)

fail_description = 'The release information was obtained, even if "No release set" was repored by rhsm.'
fail_description = 'The release information was obtained, even if "No release set" was reported by rhsm.'
assert not release, fail_description


Expand Down

0 comments on commit 2440854

Please sign in to comment.