Fix permissions via Filemanager and forward compatible Backups!

This commit is contained in:
usmannasir
2018-02-16 21:05:15 +05:00
parent 23b0e34437
commit 87214cb4eb
6 changed files with 107 additions and 73 deletions

View File

@@ -68,14 +68,10 @@ class mysqlUtilities:
if res == 1:
logging.CyberCPLogFileWriter.writeToFile("Can not create Database User: " + dbuser)
## reverting the db creation which was created earlier
mysqlUtilities.deleteDatabase(dbname,dbuser)
return 0
else:
dropDB = "GRANT ALL PRIVILEGES ON " +dbname+ ".* TO '" +dbuser+ "'@'localhost'"
command = 'sudo mysql -u root -p' + password + ' -e "' + dropDB + '"'
cmd = shlex.split(command)
@@ -86,7 +82,6 @@ class mysqlUtilities:
logging.CyberCPLogFileWriter.writeToFile("Can not grant privileges to user: " + dbuser)
return 0
return 1
except BaseException, msg:
@@ -147,10 +142,12 @@ class mysqlUtilities:
if res == 1:
logging.CyberCPLogFileWriter.writeToFile("Database: "+databaseName + "could not be backed! [createDatabaseBackup]")
return 0
return 1
except BaseException, msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg) + "[createDatabase]")
return 0
@staticmethod
def restoreDatabaseBackup(databaseName, tempStoragePath,dbPassword):