summaryrefslogtreecommitdiffstats
path: root/glances/password_list.py
diff options
context:
space:
mode:
authorBharath Vignesh J K <52282402+RazCrimson@users.noreply.github.com>2024-05-17 03:05:33 +0530
committerBharath Vignesh J K <52282402+RazCrimson@users.noreply.github.com>2024-05-17 03:37:22 +0530
commit108ffcdfb637e288479f49ec083f601a1e88f51c (patch)
treec3483200a43d20c5432804326b7ff08a16e64bd8 /glances/password_list.py
parentf9a06a31f063ce0db66ba54a1d576b4c0ea94466 (diff)
chg: ruff - pyupgrade
Diffstat (limited to 'glances/password_list.py')
-rw-r--r--glances/password_list.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/glances/password_list.py b/glances/password_list.py
index 1f3973fa..5b8fa078 100644
--- a/glances/password_list.py
+++ b/glances/password_list.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# This file is part of Glances.
#
@@ -19,7 +18,7 @@ class GlancesPasswordList(GlancesPassword):
_section = "passwords"
def __init__(self, config=None, args=None):
- super(GlancesPasswordList, self).__init__()
+ super().__init__()
# password_dict is a dict (JSON compliant)
# {'host': 'password', ... }
# Load the configuration file
@@ -32,14 +31,14 @@ class GlancesPasswordList(GlancesPassword):
if config is None:
logger.warning("No configuration file available. Cannot load password list.")
elif not config.has_section(self._section):
- logger.warning("No [%s] section in the configuration file. Cannot load password list." % self._section)
+ logger.warning(f"No [{self._section}] section in the configuration file. Cannot load password list.")
else:
- logger.info("Start reading the [%s] section in the configuration file" % self._section)
+ logger.info(f"Start reading the [{self._section}] section in the configuration file")
password_dict = dict(config.items(self._section))
# Password list loaded
- logger.info("%s password(s) loaded from the configuration file" % len(password_dict))
+ logger.info(f"{len(password_dict)} password(s) loaded from the configuration file")
return password_dict