From 8577096e19af4ad2efd55a58c8861941960c3ee5 Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Mon, 23 Nov 2020 08:55:46 -0500 Subject: [PATCH] opencas: Use BrickException instead of Exception Raise BrickException instead of Exception for errors here. This makes it easier for callers to handle failures correctly. Change-Id: I8e433ad5d11873b39f578c98278e5d3b34cf7012 --- os_brick/caches/opencas.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/os_brick/caches/opencas.py b/os_brick/caches/opencas.py index 8bd799e6a..fee3c9919 100644 --- a/os_brick/caches/opencas.py +++ b/os_brick/caches/opencas.py @@ -88,7 +88,7 @@ class OpenCASEngine(executor.Executor, caches.CacheEngineBase): fields = line.split() return fields[5] - raise Exception('Cannot find emulated device.') + raise exception.BrickException('Cannot find emulated device.') def _get_mapped_coredev(self, casdev): cmd = ['casadm', '-L'] @@ -102,7 +102,7 @@ class OpenCASEngine(executor.Executor, caches.CacheEngineBase): fields = line.split() return (fields[1], fields[2]) - raise Exception('Cannot find core device.') + raise exception.BrickException('Cannot find core device.') def _map_casdisk(self, core): cmd = ['casadm', '-A', '-i', self.cache_id, '-d', core]