diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 9c3dfaec..8aa160d1 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -250,7 +250,7 @@ class EESiteCreateController(CementBaseController): ee_db_name='', ee_db_user='', ee_db_pass='') setup_domain(self, data) - if 'ee_db_name' in data.keys(): + if 'ee_db_name' in data.keys() and not data['wp']: data = setup_database(self, data) if data['wp']: setup_wordpress(self, data) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index f001ca8f..ba1c42f6 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -127,8 +127,8 @@ def setup_wordpress(self, data): ee_random = (''.join(random.sample(string.ascii_uppercase + string.ascii_lowercase + string.digits, 15))) print("Downloading Wordpress, please wait...") - EEShellExec.cmd_exec(self, "wp --allow-root core download" - "--path={0}/htdocs/".format(ee_site_webroot)) + EEFileUtils.chdir(self, '{0}/htdocs/'.format(ee_site_webroot)) + EEShellExec.cmd_exec(self, "wp --allow-root core download") setup_database(self, data) if prompt_wpprefix == 'True': diff --git a/ee/core/mysql.py b/ee/core/mysql.py index dbc58421..5b19661f 100644 --- a/ee/core/mysql.py +++ b/ee/core/mysql.py @@ -2,6 +2,7 @@ import pymysql import configparser from os.path import expanduser +import sys class EEMysql(): @@ -29,18 +30,17 @@ class EEMysql(): cur = conn.cursor() except Exception as e: self.app.log.error('Unable to connect to database: {0}' - .format(e.strerror)) - return False + .format(e)) + sys.exit(1) try: cur.execute(statement) except Exception as e: self.app.log.error('Error occured while executing: {0}' - .format(e.strerror)) - self.app.log.info("Error occured while executing "+statement) + .format(e)) cur.close() conn.close() - return False + sys.exit(1) cur.close() conn.close()