diff --git a/.pylintrc b/.pylintrc index 2ef31167d0..0adb7dcc73 100644 --- a/.pylintrc +++ b/.pylintrc @@ -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. diff --git a/repos/system_upgrade/common/actors/checksaphana/libraries/checksaphana.py b/repos/system_upgrade/common/actors/checksaphana/libraries/checksaphana.py index 1b08f3d2b8..7cd83de866 100644 --- a/repos/system_upgrade/common/actors/checksaphana/libraries/checksaphana.py +++ b/repos/system_upgrade/common/actors/checksaphana/libraries/checksaphana.py @@ -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 @@ -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 diff --git a/repos/system_upgrade/common/actors/checktargetiso/libraries/check_target_iso.py b/repos/system_upgrade/common/actors/checktargetiso/libraries/check_target_iso.py index b5b66901d4..fcb23028f0 100644 --- a/repos/system_upgrade/common/actors/checktargetiso/libraries/check_target_iso.py +++ b/repos/system_upgrade/common/actors/checktargetiso/libraries/check_target_iso.py @@ -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) diff --git a/repos/system_upgrade/common/actors/createisorepofile/libraries/create_iso_repofile.py b/repos/system_upgrade/common/actors/createisorepofile/libraries/create_iso_repofile.py index b4470b685c..3f4f75e065 100644 --- a/repos/system_upgrade/common/actors/createisorepofile/libraries/create_iso_repofile.py +++ b/repos/system_upgrade/common/actors/createisorepofile/libraries/create_iso_repofile.py @@ -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' diff --git a/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py b/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py index e5555f99c6..9de50fae04 100644 --- a/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py +++ b/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py @@ -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 [] diff --git a/repos/system_upgrade/common/actors/scansaphana/libraries/scansaphana.py b/repos/system_upgrade/common/actors/scansaphana/libraries/scansaphana.py index 04195b5798..994904774a 100644 --- a/repos/system_upgrade/common/actors/scansaphana/libraries/scansaphana.py +++ b/repos/system_upgrade/common/actors/scansaphana/libraries/scansaphana.py @@ -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) @@ -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 diff --git a/repos/system_upgrade/common/actors/scantargetiso/libraries/scan_target_os_iso.py b/repos/system_upgrade/common/actors/scantargetiso/libraries/scan_target_os_iso.py index 281389cf50..a5f0750a69 100644 --- a/repos/system_upgrade/common/actors/scantargetiso/libraries/scan_target_os_iso.py +++ b/repos/system_upgrade/common/actors/scantargetiso/libraries/scan_target_os_iso.py @@ -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] diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py index 9dfa0f14e0..afc78df826 100644 --- a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py +++ b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py @@ -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