Skip to content

Commit

Permalink
fix errors after renaming variables hinted by ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
ctheune committed Nov 8, 2024
1 parent 001045a commit a0223a3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/fc/qemu/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ def _get_maintenance_lock_info(self):
return f"<unknown due to error: {e}>"

@classmethod
def maintenance_enter(cls):
def maintenance_enter(cls) -> None:
"""Prepare the host for maintenance mode.
process exit codes signal success or (temporary) failure
Expand Down Expand Up @@ -501,7 +501,8 @@ def maintenance_enter(cls):
["pgrep", "-f", "qemu-system-x86_64"], stdout=subprocess.PIPE
)
process.wait()
num_procs = len(p.stdout.read().splitlines())
assert process.stdout is not None
num_procs = len(process.stdout.read().splitlines())
log.info(
"evacuation-running",
vms=num_procs,
Expand Down Expand Up @@ -552,7 +553,7 @@ def maintenance_leave(cls):
)

@classmethod
def shutdown_all(cls):
def shutdown_all(cls) -> None:
"""Shut down all VMs cleanly.
Runs the shutdowns in parallel to speed up host reboots.
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 @@ -73,7 +73,7 @@ class MultiOptimisticLogger(object):
def __init__(self, loggers):
self.loggers = loggers

def __repr__(self):
def __repr__(self) -> str:
return "<MultiOptimisticLogger {}>".format(
[repr(logger) for logger in self.loggers]
)
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 @@ -53,7 +53,7 @@ def test_multiple_images_raises_error(ceph_inst):

@pytest.mark.timeout(60)
@pytest.mark.live()
def test_rbd_pool_migration(ceph_inst, patterns):
def test_rbd_pool_migration(ceph_inst, patterns) -> None:
ceph_inst.cfg["tmp_size"] = 50 * 1024 * 1024
ceph_inst.cfg["swap_size"] = 50 * 1024 * 1024
ceph_inst.cfg["root_size"] = 50 * 1024 * 1024
Expand Down

0 comments on commit a0223a3

Please sign in to comment.