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
This commit is contained in:
parent
4d4c5e82c9
commit
8577096e19
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user