Skip to content

Commit

Permalink
update logging messages
Browse files Browse the repository at this point in the history
  • Loading branch information
bikegeek committed Jul 23, 2023
1 parent 6af3670 commit cdd5a2b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion METdbLoad/sql/scripts/db_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,25 @@ def create_database(self):
create_list = ["'create database ", self.db_name, "'"]
create_str = ''.join(create_list)
create_cmd = uname_pass + create_str
logging.debug(f'database create string: {create_cmd}')

# Permissions
perms_list = ["GRANT INSERT, DELETE, UPDATE, INDEX, DROP ON ", self.db_name,
".*", " to '", self.user_name, "'@'%'"]

perms_str = ''.join(perms_list)
perms_cmd = uname_pass + perms_str
logging.debug(f'database grant permissions string: {perms_cmd}')

logging.debug(f'database create string: {create_cmd}')

# Schema
schema_list = ['', self.db_name, ' < ', self.schema_path]
schema_str = ''.join(schema_list)
schema_cmd = uname_pass + schema_str
logging.debug(f'Schema command: {schema_cmd}')



try:
self.delete_database()
except subprocess.CalledProcessError:
Expand Down

0 comments on commit cdd5a2b

Please sign in to comment.