open-iscsi / targetd

Remote configuration of a LIO-based storage appliance
GNU General Public License v3.0
71 stars 28 forks source link

Exception if block pool name is incorrect #17

Closed tasleson closed 5 years ago

tasleson commented 7 years ago

I incorrectly used vg-targetd/thinpool instead of vg-targetd/thin_pool in the configuration file. When I started the service it came up OK, but when I exercised the service I would get the following exception:

DEBUG:root:Traceback (most recent call last):
  File "/home/tasleson/projects/targetd-master/targetd/main.py", line 117, in do_POST
    result = mapping[method](self)
  File "/home/tasleson/projects/targetd-master/targetd/main.py", line 247, in pool_list
    return list(itertools.chain(block.block_pools(req), fs.fs_pools(req)))
  File "/home/tasleson/projects/targetd-master/targetd/block.py", line 340, in block_pools
    thinp = vg.lvFromName(tp_name)
LibLVMError: (0, '')

This should be improved so that we catch this as start-up and we exit with a nice error message instead of a cryptic stack exception.