diff --git a/plogical/mysqlUtilities.py b/plogical/mysqlUtilities.py index 225f0edfc..fa06f8fac 100755 --- a/plogical/mysqlUtilities.py +++ b/plogical/mysqlUtilities.py @@ -130,6 +130,15 @@ class mysqlUtilities: def deleteDatabase(dbname, dbuser): try: + ## Remove possible git folder + + dbPath = '/var/lib/mysql/%s/.git' % (dbname) + + command = 'rm -rf %s' % (dbPath) + ProcessUtilities.executioner(command) + + ## + connection, cursor = mysqlUtilities.setupConnection() if connection == 0: diff --git a/websiteFunctions/website.py b/websiteFunctions/website.py index 71c4ee505..8fca955a4 100755 --- a/websiteFunctions/website.py +++ b/websiteFunctions/website.py @@ -3005,8 +3005,16 @@ StrictHostKeyChecking no gitConfFolder = '/home/cyberpanel/git' gitConFile = '%s/%s' % (gitConfFolder, self.domain) - if os.path.exists(gitConFile): - gitConf = json.loads(open(gitConFile, 'r').read()) + if not os.path.exists(gitConfFolder): + os.mkdir(gitConfFolder) + + if not os.path.exists(gitConFile): + os.mkdir(gitConFile) + + finalFile = '%s/%s' % (gitConFile, self.folder.split('/')[-1]) + + if os.path.exists(finalFile): + gitConf = json.loads(open(finalFile, 'r').read()) autoCommitCurrent = gitConf['autoCommit'] autoPushCurrent = gitConf['autoPush'] @@ -3820,7 +3828,12 @@ StrictHostKeyChecking no if not os.path.exists(gitConfFolder): os.mkdir(gitConfFolder) - writeToFile = open(gitConFile, 'w') + if not os.path.exists(gitConFile): + os.mkdir(gitConFile) + + finalFile = '%s/%s' % (gitConFile, self.folder.split('/')[-1]) + + writeToFile = open(finalFile, 'w') writeToFile.write(json.dumps(dic)) writeToFile.close()