From f988ac3136943f229788b456a62d2373c2fc1523 Mon Sep 17 00:00:00 2001 From: Eric Harney <eharney@redhat.com> Date: Thu, 6 Feb 2025 10:38:59 -0500 Subject: [PATCH] mypy: Support mypy 1.15.0 Change-Id: I46ad60a060a3310a3d2a762fc99bec701249b7d9 --- cinder/backup/manager.py | 1 + cinder/volume/volume_utils.py | 2 +- test-requirements.txt | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cinder/backup/manager.py b/cinder/backup/manager.py index 7e700d4024a..897acd2fe1c 100644 --- a/cinder/backup/manager.py +++ b/cinder/backup/manager.py @@ -439,6 +439,7 @@ class BackupManager(manager.SchedulerDependentManager): except Exception as err: with excutils.save_and_reraise_exception(): if snapshot_id: + assert snapshot is not None snapshot.status = fields.SnapshotStatus.AVAILABLE snapshot.save() else: diff --git a/cinder/volume/volume_utils.py b/cinder/volume/volume_utils.py index 4e3460d4e55..3032dbaf87d 100644 --- a/cinder/volume/volume_utils.py +++ b/cinder/volume/volume_utils.py @@ -1312,7 +1312,7 @@ def resolve_hostname(hostname: str) -> str: ip = socket.getaddrinfo(hostname, None)[0][4][0] LOG.debug('Asked to resolve hostname %(host)s and got IP %(ip)s.', {'host': hostname, 'ip': ip}) - return ip + return str(ip) def update_backup_error(backup, diff --git a/test-requirements.txt b/test-requirements.txt index 961185a60d5..0b0e20c6d60 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.14.0 # MIT +mypy>=1.7.0,<1.16.0 # MIT moto>=5.0.0 # Apache-2.0 distro>=1.8.0 # Apache-2.0