From c962c126c60f3272dd27f509b9a564526bf65ab2 Mon Sep 17 00:00:00 2001 From: harshadyeola Date: Fri, 13 Feb 2015 13:41:43 +0530 Subject: [PATCH 1/2] added quotes for sql queries --- ee/cli/plugins/site_functions.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index 379f9d89..4de87e68 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -112,15 +112,15 @@ def setupdatabase(self, data): # create MySQL database Log.info(self, "Setting up database\t\t", end='') Log.debug(self, "Creating databse {0}".format(ee_db_name)) - EEMysql.execute(self, "create database {0}" + EEMysql.execute(self, "create database `{0}`" .format(ee_db_name), errormsg="Cannot create database") # Create MySQL User Log.debug(self, "Creating user {0}".format(ee_db_username)) - Log.debug(self, "create user {0}@{1} identified by ''" + Log.debug(self, "create user `{0}`@`{1}` identified by ''" .format(ee_db_username, ee_mysql_grant_host)) EEMysql.execute(self, - "create user {0}@{1} identified by '{2}'" + "create user `{0}`@`{1}` identified by '{2}'" .format(ee_db_username, ee_mysql_grant_host, ee_db_password), errormsg="Cannot setup database user", log=False) @@ -128,7 +128,7 @@ def setupdatabase(self, data): # Grant permission Log.debug(self, "Setting up user privileges") EEMysql.execute(self, - "grant all privileges on {0}.* to {1}@{2}" + "grant all privileges on `{0}`.* to `{1}`@`{2}`" .format(ee_db_name, ee_db_username, ee_mysql_grant_host), errormsg="Cannot setup database user privileges") Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]") From c4e301d106ecfff859b02231b6a7f392e8ea72d2 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 13 Feb 2015 13:46:39 +0530 Subject: [PATCH 2/2] Improved Nginx reinstallation --- ee/cli/plugins/stack.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 56535fb1..1d3fff20 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -155,8 +155,8 @@ class EEStackController(CementBaseController): EEService.reload_service(self, 'postfix') if set(EEVariables.ee_nginx).issubset(set(apt_packages)): - if ((not os.path.isfile('/etc/nginx/conf.d/ee-nginx.conf')) and - os.path.isfile('/etc/nginx/nginx.conf')): + if ((not EEShellExec.cmd_exec(self, "grep -Hr EasyEngine " + "/etc/nginx")) and os.path.isfile('/etc/nginx/nginx.conf')): nc = NginxConfig() Log.debug(self, 'Loading file /etc/nginx/nginx.conf ') nc.loadf('/etc/nginx/nginx.conf')