From 1be23db75fae7188911bda8e759b78036de2f068 Mon Sep 17 00:00:00 2001 From: Dominic Hamon Date: Tue, 20 Oct 2015 12:28:14 -0700 Subject: [PATCH] Back to exception and add more information. --- py/vttest/local_database.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/py/vttest/local_database.py b/py/vttest/local_database.py index 6a227b8d88..176d30f3e6 100644 --- a/py/vttest/local_database.py +++ b/py/vttest/local_database.py @@ -102,9 +102,11 @@ class LocalDatabase(object): for keyspace in set([shard.keyspace for shard in self.shards]): keyspace_dir = os.path.join(self.schema_dir, keyspace) if not os.path.isdir(keyspace_dir): - logging.warn('No subdirectory found in schema dir %s for keyspace %s.', - keyspace, keyspace_dir) - continue + raise Exception('No subdirectory found in schema dir %s for keyspace %s. ' + 'For keyspaces without an initial schema, create the ' + 'directory %s and leave a README file to explain why the ' + 'directory exists.' % + (self.schema_dir, keyspace, keyspace_dir)) for filepath in glob.glob(os.path.join(keyspace_dir, '*.sql')): logging.info('Loading schema for keyspace %s from file %s',