self.assertRaises(exception.InvalidInput,
self.driver.check_for_setup_error)
+ def test_no_storage_pools(self):
+ """No storage pools."""
+ self.driver.storage_pools = None
+ self.assertRaises(exception.InvalidInput,
+ self.driver.check_for_setup_error)
+
def test_volume_size_round_true(self):
self.driver._check_volume_size(1)
'user': self.server_username,
'verify_cert': self.verify_server_certificate})
- self.storage_pools = [e.strip() for e in
- self.configuration.sio_storage_pools.split(',')]
+ self.storage_pools = None
+ if self.configuration.sio_storage_pools:
+ self.storage_pools = [
+ e.strip() for e in
+ self.configuration.sio_storage_pools.split(',')
+ ]
+
self.storage_pool_name = self.configuration.sio_storage_pool_name
self.storage_pool_id = self.configuration.sio_storage_pool_id
if self.storage_pool_name is None and self.storage_pool_id is None:
msg = _("Must specify storage pool name or id.")
raise exception.InvalidInput(reason=msg)
+ if not self.storage_pools:
+ msg = _(
+ "Must specify storage pools. Option: sio_storage_pools."
+ )
+ raise exception.InvalidInput(reason=msg)
+
def _find_storage_pool_id_from_storage_type(self, storage_type):
# Default to what was configured in configuration file if not defined.
return storage_type.get(STORAGE_POOL_ID,