From 5f832754703f3847541f3b0e313ba1cee9418fa9 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 25 Jan 2018 12:37:14 +0100 Subject: [PATCH] fixing req_centos --- install/install.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install/install.py b/install/install.py index 39069a5..8ca0037 100644 --- a/install/install.py +++ b/install/install.py @@ -162,6 +162,8 @@ def install_python_modules(venv): sql_pswd = "DjangoPyros" req = "CREATE DATABASE IF NOT EXISTS pyros; CREATE USER IF NOT EXISTS pyros; GRANT USAGE ON *.* TO 'pyros'; DROP USER 'pyros'; GRANT ALL ON pyros.* TO 'pyros'@'localhost' IDENTIFIED BY 'DjangoPyros'; GRANT ALL ON test_pyros.* TO 'pyros'@'localhost'; GRANT ALL PRIVILEGES ON test_pyros_test.* TO 'pyros'@'localhost';" req_centos = "CREATE DATABASE IF NOT EXISTS pyros; CREATE DATABASE IF NOT EXISTS pyros_test; GRANT USAGE ON *.* TO 'pyros@localhost' IDENTIFIED BY 'DjangoPyros' WITH GRANT OPTION; DROP USER pyros; CREATE USER 'pyros' IDENTIFIED BY 'DjangoPyros'; GRANT ALL PRIVILEGES ON pyros.* TO 'pyros'@'localhost' IDENTIFIED BY 'DjangoPyros' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON test_pyros.* TO pyros@localhost IDENTIFIED BY 'DjangoPyros' WITH GRANT OPTION;" + if platform.dist()[0] == "centos": + req = req_centos sql_request="\"" + req + "\"" + " | mysql -u root -p" if (platform.system() == "Windows"): end_of_line = "\r\n\r\n" @@ -216,8 +218,7 @@ def install_python_modules(venv): sql_pswd = "DjangoPyros" ''' - if platform.dist()[0] == "centos": - req = req_centos + print(Colors.LOG_BLUE + end_of_line+"-----------------------------Launching mysql to create database and create and grant user pyros-----------------------------" + Colors.END) print(Colors.LOG_BLUE +"-----------------------------Please enter your MYSQL root password-----------------------------" + Colors.END) process = subprocess.Popen("echo " + sql_request, shell=True) -- libgit2 0.21.2