diff --git a/python/spdk/sma/device/device.py b/python/spdk/sma/device/device.py index bc18e74d7..47fb06d28 100644 --- a/python/spdk/sma/device/device.py +++ b/python/spdk/sma/device/device.py @@ -8,8 +8,9 @@ class DeviceException(Exception): class DeviceManager: - def __init__(self, name, client): + def __init__(self, name, protocol, client): self._client = client + self.protocol = protocol self.name = name def init(self, config): diff --git a/python/spdk/sma/device/nvmf_tcp.py b/python/spdk/sma/device/nvmf_tcp.py index 86313a560..4e869c5e2 100644 --- a/python/spdk/sma/device/nvmf_tcp.py +++ b/python/spdk/sma/device/nvmf_tcp.py @@ -10,7 +10,7 @@ from ..proto import nvmf_tcp_pb2 class NvmfTcpDeviceManager(DeviceManager): def __init__(self, client): - super().__init__('nvmf_tcp', client) + super().__init__('nvmf_tcp', 'nvmf_tcp', client) def init(self, config): self._has_transport = self._create_transport() diff --git a/python/spdk/sma/sma.py b/python/spdk/sma/sma.py index 9fa921fe1..a268bb0a4 100644 --- a/python/spdk/sma/sma.py +++ b/python/spdk/sma/sma.py @@ -22,7 +22,7 @@ class StorageManagementAgent(pb2_grpc.StorageManagementAgentServicer): return wrapper def register_device(self, device_manager): - self._devices[device_manager.name] = device_manager + self._devices[device_manager.protocol] = device_manager def run(self): self._server.start()