Skip to content

Commit

Permalink
[6.13.z] [pre-commit.ci] pre-commit autoupdate (#16826)
Browse files Browse the repository at this point in the history
  • Loading branch information
Satellite-QE authored Oct 31, 2024
1 parent d96c61e commit 5d67f8c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
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

0 comments on commit 5d67f8c

Please sign in to comment.