nfs: minimal mypy coverage

Add a minimal pass of mypy to nfs.py to
help prevent errors in all of the pending code
changes for this driver.

More complete coverage is in Ide947c8e.

Change-Id: I74bf07f0c5038834c17585245e60000ab6ac8f25
This commit is contained in:
Eric Harney 2025-04-21 11:42:12 -04:00 committed by Fernando Ferraz
parent 9d424c57d5
commit e70362570b
2 changed files with 7 additions and 3 deletions

View File

@ -19,6 +19,7 @@ import errno
import os
import tempfile
import time
import typing
from castellan import key_manager
from os_brick.remotefs import remotefs as remotefs_brick
@ -100,9 +101,9 @@ class NfsDriver(remotefs.RemoteFSSnapDriverDistributed):
self.configuration.append_config_values(nfs_opts)
root_helper = utils.get_root_helper()
# base bound to instance is used in RemoteFsConnector.
self.base = getattr(self.configuration,
'nfs_mount_point_base')
self.base = os.path.realpath(self.base)
base = getattr(self.configuration,
'nfs_mount_point_base')
self.base = os.path.realpath(base)
opts = getattr(self.configuration,
'nfs_mount_options')
@ -533,7 +534,9 @@ class NfsDriver(remotefs.RemoteFSSnapDriverDistributed):
data = self._stats
global_capacity = data['total_capacity_gb']
global_capacity = typing.cast(float, global_capacity)
global_free = data['free_capacity_gb']
global_free = typing.cast(float, global_free)
thin_enabled = self.configuration.nfs_sparsed_volumes
if thin_enabled:

View File

@ -43,6 +43,7 @@ cinder/service.py
cinder/utils.py
cinder/volume/__init__.py
cinder/volume/api.py
cinder/volume/drivers/nfs.py
cinder/volume/drivers/rbd.py
cinder/volume/drivers/remotefs.py
cinder/volume/flows/api/create_volume.py