Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and update pre-commit ruff check #204

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.6.4
rev: v0.7.1
hooks:
- id: ruff
args: [--fix]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-case-conflict
- id: check-ast
Expand Down
6 changes: 3 additions & 3 deletions rtslib/tcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,9 +1005,9 @@ def __init__(self, name, storage_object_cls, mode, index=None):
with lock_file_path.open('w+') as lkfd:
fcntl.flock(lkfd, fcntl.LOCK_EX)
indexes = set(bs_cache.values())
for index in range(1048576):
if index not in indexes:
self._index = index
for i in range(1048576):
if i not in indexes:
self._index = i
bs_cache[self._lookup_key] = self._index
break
else:
Expand Down
4 changes: 1 addition & 3 deletions rtslib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,8 @@ def is_dev_in_use(path):
except OSError:
return True
else:
try:
with suppress(OSError):
os.close(file_fd)
except OSError:
pass
return False

def _get_size_for_dev(device):
Expand Down
Loading