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

[6.15.z] [pre-commit.ci] pre-commit autoupdate #16829

Merged
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
Expand Up @@ -12,7 +12,7 @@ repos:
- id: check-yaml
- id: debug-statements
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
rev: v0.7.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand All @@ -28,6 +28,6 @@ repos:
types: [text]
require_serial: true
- repo: https://github.com/gitleaks/gitleaks
rev: v8.20.1
rev: v8.21.2
hooks:
- id: gitleaks
9 changes: 4 additions & 5 deletions robottelo/utils/io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ def get_local_file_data(path):
checksum = hashlib.sha256(file_content).hexdigest()

try:
tarobj = tarfile.open(path, mode='r')
host_counts = get_host_counts(tarobj)
tarobj.close()
extractable = True
json_files_parsable = True
with tarfile.open(path, mode='r') as tarobj:
host_counts = get_host_counts(tarobj)
extractable = True
json_files_parsable = True
except (tarfile.TarError, json.JSONDecodeError):
host_counts = {}
extractable = False
Expand Down
7 changes: 3 additions & 4 deletions tests/robottelo/test_func_locker.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ class TmpCountFile:
def __init__(self):
tmp_root_path = Path(func_locker.get_temp_dir()).joinpath(func_locker.TEMP_ROOT_DIR)
tmp_root_path.mkdir(parents=True, exist_ok=True)
self.file = tempfile.NamedTemporaryFile(delete=False, suffix='.counter', dir=tmp_root_path)
self.file_name = self.file.name
self.file.write(b'0')
self.file.close()
with tempfile.NamedTemporaryFile(delete=False, suffix='.counter', dir=tmp_root_path) as cf:
cf.write(b'0')
self.file_name = cf.name

def read(self):
with open(self.file_name) as cf:
Expand Down
Loading