Skip to content

Commit

Permalink
update pre-commit environment
Browse files Browse the repository at this point in the history
  • Loading branch information
ctheune committed Nov 7, 2024
1 parent 91fe054 commit b3344e4
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.3
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: pre-commit/action@v3.0.0
31 changes: 22 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
exclude: ^secrets/|^appenv$
repos:
- hooks:
- id: detect-private-key
- id: check-added-large-files
- exclude: "(?x)^(\n secrets/|environments/.*/secret.*|\n .*\\.patch\n)$\n"
id: trailing-whitespace
- exclude: "(?x)^(\n environments/.*/secret.*|\n .*\\.patch\n)$\n"
id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-json
- id: check-xml
- id: check-toml
- id: detect-private-key
- exclude: "(?x)^(\n environments/.*/secret.*|\n .*\\.patch\n)$\n"
id: check-yaml
- exclude: "(?x)^(\n environments/.*/secret.*|\n .*\\.patch\n)$\n"
id: check-json
- exclude: "(?x)^(\n environments/.*/secret.*|\n .*\\.patch\n)$\n"
id: check-xml
- exclude: "(?x)^(\n environments/.*/secret.*|\n .*\\.patch\n)$\n"
id: check-toml
repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v5.0.0
- hooks:
- args:
- --profile
Expand All @@ -21,8 +25,17 @@ repos:
id: isort
name: isort (python)
repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
- hooks:
- id: black
repo: https://github.com/psf/black
rev: 22.3.0
rev: 24.10.0
- hooks:
- args:
- --ignore
- E501
- --ignore
- F401
id: ruff
repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[tool.black]
line-length = 80
target-version = ['py36', 'py37', 'py38']

[tool.isort]
profile = "black"
Expand Down
8 changes: 4 additions & 4 deletions src/fc/qemu/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,10 +497,10 @@ def maintenance_enter(cls):
# Monitor whether there are still VMs running.
timeout = TimeOut(300, interval=3)
while timeout.tick():
p = subprocess.Popen(
process = subprocess.Popen(
["pgrep", "-f", "qemu-system-x86_64"], stdout=subprocess.PIPE
)
p.wait()
process.wait()
num_procs = len(p.stdout.read().splitlines())
log.info(
"evacuation-running",
Expand Down Expand Up @@ -598,8 +598,8 @@ def stop_vm(vm):
# Isolate the stop call into separate fc-qemu
# processes to ensure reliability.
log.info("shutdown", vm=vm.name)
p = subprocess.Popen([EXECUTABLE, "stop", vm.name])
p.wait()
process = subprocess.Popen([EXECUTABLE, "stop", vm.name])
process.wait()

pool = ThreadPool(5)
for vm in vms:
Expand Down
2 changes: 1 addition & 1 deletion src/fc/qemu/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __init__(self, loggers):

def __repr__(self):
return "<MultiOptimisticLogger {}>".format(
[repr(l) for l in self.loggers]
[repr(logger) for logger in self.loggers]
)

def msg(self, **event_dict):
Expand Down
1 change: 0 additions & 1 deletion src/fc/qemu/util.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Global helper functions and utilites for fc.qemu."""


import contextlib
import datetime
import os
Expand Down
2 changes: 1 addition & 1 deletion tests/hazmat/test_ceph.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def test_rbd_pool_migration(ceph_inst, patterns):

assert get_log() == first_ensure

while "status=executed" not in (log := get_log()):
while "status=executed" not in get_log():
ceph_inst.status()

ceph_inst.ensure()
Expand Down

0 comments on commit b3344e4

Please sign in to comment.