some changes to git configration file

This commit is contained in:
Usman Nasir
2020-03-16 21:22:04 +05:00
parent a994c82efc
commit bae625a2d2
2 changed files with 25 additions and 3 deletions

View File

@@ -130,6 +130,15 @@ class mysqlUtilities:
def deleteDatabase(dbname, dbuser): def deleteDatabase(dbname, dbuser):
try: try:
## Remove possible git folder
dbPath = '/var/lib/mysql/%s/.git' % (dbname)
command = 'rm -rf %s' % (dbPath)
ProcessUtilities.executioner(command)
##
connection, cursor = mysqlUtilities.setupConnection() connection, cursor = mysqlUtilities.setupConnection()
if connection == 0: if connection == 0:

View File

@@ -3005,8 +3005,16 @@ StrictHostKeyChecking no
gitConfFolder = '/home/cyberpanel/git' gitConfFolder = '/home/cyberpanel/git'
gitConFile = '%s/%s' % (gitConfFolder, self.domain) gitConFile = '%s/%s' % (gitConfFolder, self.domain)
if os.path.exists(gitConFile): if not os.path.exists(gitConfFolder):
gitConf = json.loads(open(gitConFile, 'r').read()) 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'] autoCommitCurrent = gitConf['autoCommit']
autoPushCurrent = gitConf['autoPush'] autoPushCurrent = gitConf['autoPush']
@@ -3820,7 +3828,12 @@ StrictHostKeyChecking no
if not os.path.exists(gitConfFolder): if not os.path.exists(gitConfFolder):
os.mkdir(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.write(json.dumps(dic))
writeToFile.close() writeToFile.close()