From 44406e57a4f5077a36c0ca28e430e158fc3b4d94 Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Wed, 25 Jun 2025 09:00:02 -0400 Subject: [PATCH] mypy: Bump to 1.16.1 Includes changes to pass with mypy 1.16.1. Change-Id: I52f57525f2d59e62a5d5ac08473d4a2bfdc8c94b Signed-off-by: Eric Harney --- cinder/scheduler/host_manager.py | 4 +++- test-requirements.txt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cinder/scheduler/host_manager.py b/cinder/scheduler/host_manager.py index c4cc3edc706..1ddfcacf5e7 100644 --- a/cinder/scheduler/host_manager.py +++ b/cinder/scheduler/host_manager.py @@ -114,7 +114,7 @@ class BackendState(object): self.volume_backend_name = None self.vendor_name = None - self.driver_version = 0 + self.driver_version: Optional[int] = 0 self.storage_protocol = None self.QoS_support = False # Mutable available resources. @@ -259,6 +259,8 @@ class BackendState(object): # To get DEFAULT_POOL_NAME pool_name = volume_utils.extract_host(self.host, 'pool', True) + pool_name = typing.cast(str, pool_name) + if len(self.pools) == 0: # No pool was there single_pool = self.pool_state_cls(self.host, self.cluster_name, diff --git a/test-requirements.txt b/test-requirements.txt index 70e647ed5eb..54d087843ac 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -18,6 +18,6 @@ SQLAlchemy-Utils>=0.37.8 # BSD License testtools>=2.4.0 # MIT doc8>=0.8.1 # Apache-2.0 -mypy>=1.7.0,<1.16.0 # MIT +mypy>=1.7.0,<1.17.0 # MIT moto>=5.0.0 # Apache-2.0 distro>=1.8.0 # Apache-2.0