Skip to content

Commit

Permalink
Compat fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
failys committed May 18, 2024
1 parent 8167544 commit 8dfc9f1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cairis/core/MySQLDatabaseProxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4610,7 +4610,7 @@ def createDatabase(self,dbName,session_id):
userName = ses_settings['userName']
dbPasswd = ses_settings['dbPasswd']
dbName = dbUser + '_' + dbName
createDatabaseAndPrivileges(rPasswd,dbHost,dbPort,userName,dbPasswd,dbName)
createDatabaseAndPrivileges(rPasswd,dbHost,dbPort,dbUser,dbPasswd,dbName)
b.settings[session_id]['dbName'] = dbName
self.clearDatabase(session_id)
self.reconnect(True,session_id)
Expand Down
1 change: 1 addition & 0 deletions cairis/core/dba.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def createDatabaseAndPrivileges(rPasswd,dbHost,dbPort,email,dbPasswd,dbName):
stmts = ['drop database if exists `' + dbName + '`',
'delete from cairis_owner.db_owner where db = "' + dbName + '"',
'create database ' + dbName,
"create user if not exists '" + dbUser + "'@'" + "%' identified by '" + dbPasswd + "'",
"grant all privileges on `" + dbName + "`.* TO '" + dbUser + "'@'%'",
'alter database ' + dbName + ' default character set utf8mb4',
'alter database ' + dbName + ' default collate utf8mb4_' + collationString + '_ci',
Expand Down
1 change: 0 additions & 1 deletion cairis/data/ProjectDAO.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ def create_new_database(self,db_name, pathValues = []):
dbName = dbUser + '_' + canonicalDbName(db_name)
if (dbExists(dbName)):
raise ARMException(db_name + " already exists")

self.db_proxy.createDatabase(db_name,self.session_id)
return 'New database successfully created'
except DatabaseProxyException as ex:
Expand Down
2 changes: 1 addition & 1 deletion cairis/test/test_ProjectAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ProjectAPITests(CairisDaemonTestCase):
def setUpClass(cls):
b = Borg()
createDbOwnerDatabase(b.rPasswd,b.dbHost,b.dbPort)
createDatabaseAccount(b.rPasswd,b.dbHost,b.dbPort,'cairis_test','cairis_test')
createDatabaseAccount(b.rPasswd,b.dbHost,b.dbPort,'cairis_test','cairis_test','cairis_test')
createDatabaseAndPrivileges(b.rPasswd,b.dbHost,b.dbPort,'cairis_test','cairis_test','cairis_test_default')
createDatabaseSchema(b.cairisRoot,b.dbHost,b.dbPort,'cairis_test','cairis_test','cairis_test_default')
importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/NeuroGrid/NeuroGrid.xml',1,'test')
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ RUN apt-get install -y build-essential \
RUN pip3 install wheel
#Installing Python modules
COPY requirements.txt /
RUN pip3 install -r requirements.txt
RUN pip3 install -r requirements.txt --break-system-packages
COPY wsgi_requirements.txt /
RUN pip3 install -r wsgi_requirements.txt
RUN pip3 install -r wsgi_requirements.txt --break-system-packages

#Environment Variable starts from here
ENV CAIRIS_SRC=/cairis/cairis
Expand Down

0 comments on commit 8dfc9f1

Please sign in to comment.