Skip to content

Commit

Permalink
python: enable ruff "G" (logging) checks
Browse files Browse the repository at this point in the history
  • Loading branch information
allisonkarlitskaya committed May 22, 2023
1 parent 78c0282 commit 21c2ee5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ select = [
"B", # flake8-bugbear
"E", # pycodestyle
"F", # pyflakes
"G", # flake8-logging-format
"I", # isort
]
exclude = [
Expand Down
2 changes: 1 addition & 1 deletion src/cockpit/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def get_os_release():
try:
file = open('/usr/lib/os-release', encoding='utf-8')
except FileNotFoundError:
logger.warn("Neither /etc/os-release nor /usr/lib/os-release exists")
logger.warning("Neither /etc/os-release nor /usr/lib/os-release exists")
return {}

with file:
Expand Down
2 changes: 1 addition & 1 deletion src/cockpit/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def get_u_int(self, section, key, default, maximum, minimum):
try:
int_val = int(value)
except ValueError:
logger.warning(f'cockpit.conf: [{section}] {key} is not an integer')
logger.warning('cockpit.conf: [%s] %s is not an integer', section, key)
return default

return min(max(int_val, minimum), maximum)
Expand Down

0 comments on commit 21c2ee5

Please sign in to comment.