From 0a8dca82f854677fd0a68eb1a15ea9f0930ccfb7 Mon Sep 17 00:00:00 2001 From: bikegeek Date: Sat, 22 Jul 2023 19:45:58 -0600 Subject: [PATCH] fix syntax on drop and create database, terminating single quote should enclose the db name --- METdbLoad/sql/scripts/db_prep.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/METdbLoad/sql/scripts/db_prep.py b/METdbLoad/sql/scripts/db_prep.py index 6a74458f..9b6506bb 100644 --- a/METdbLoad/sql/scripts/db_prep.py +++ b/METdbLoad/sql/scripts/db_prep.py @@ -107,7 +107,7 @@ def create_database(self): # Command to create the database, set up permissions, and load the schema. uname_pass_list = [ '-u', self.user_name, ' -p', self.password, ' -e '] uname_pass = ''.join(uname_pass_list) - create_list = [ "'create database' ", self.db_name] + create_list = [ "'create database ", self.db_name, "'"] create_str = ''.join(create_list) create_cmd = uname_pass + create_str @@ -150,7 +150,7 @@ def delete_database(self): # Command to delete the database uname_pass_list = ['-u', self.user_name, ' -p' , self.password, ' -e '] uname_pass = ''.join(uname_pass_list) - drop_list = ["'drop database' ", self.db_name ] + drop_list = ["'drop database ", self.db_name, "'" ] drop_str = ''.join(drop_list) drop_cmd = uname_pass + drop_str logging.debug(f'Drop database command: {drop_cmd}')