From 81e6eadb438374922ab0398110686049f83643ac Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Wed, 1 May 2019 13:46:39 +0200 Subject: [PATCH] add vhostonly option --- wo/cli/plugins/site.py | 16 +++++++++++----- wo/cli/plugins/site_functions.py | 8 +++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/wo/cli/plugins/site.py b/wo/cli/plugins/site.py index a21c198..e6e90b0 100644 --- a/wo/cli/plugins/site.py +++ b/wo/cli/plugins/site.py @@ -404,12 +404,14 @@ class WOSiteCreateController(CementBaseController): "{0} already exists".format(wo_domain)) if stype == 'proxy': - data['site_name'] = wo_domain - data['www_domain'] = wo_www_domain + data = dict(site_name=wo_domain, www_domain=wo_www_domain, + static=True, basic=False, php73=False, wp=False, + wpfc=False, wpsc=False, multisite=False, + wpsubdir=False, webroot=wo_site_webroot) data['proxy'] = True data['host'] = host data['port'] = port - wo_site_webroot = WOVariables.wo_webroot + wo_domain + data['basic'] = True if self.app.pargs.php73: data = dict(site_name=wo_domain, www_domain=wo_www_domain, @@ -418,6 +420,9 @@ class WOSiteCreateController(CementBaseController): wpsubdir=False, webroot=wo_site_webroot) data['basic'] = True + if self.app.pargs.vhostonly: + data['vhostonly'] = True + if stype in ['html', 'php']: data = dict(site_name=wo_domain, www_domain=wo_www_domain, static=True, basic=False, php73=False, wp=False, @@ -583,11 +588,12 @@ class WOSiteCreateController(CementBaseController): "and please try again") # Setup WordPress if Wordpress site - if data['wp']: + if (data['wp'] and (not data['vhostonly'])): try: wo_wp_creds = setupwordpress(self, data) # Add database information for site into database - updateSiteInfo(self, wo_domain, db_name=data['wo_db_name'], + updateSiteInfo(self, wo_domain, + db_name=data['wo_db_name'], db_user=data['wo_db_user'], db_password=data['wo_db_pass'], db_host=data['wo_db_host']) diff --git a/wo/cli/plugins/site_functions.py b/wo/cli/plugins/site_functions.py index e23ee87..716dd0e 100644 --- a/wo/cli/plugins/site_functions.py +++ b/wo/cli/plugins/site_functions.py @@ -49,8 +49,7 @@ def pre_run_checks(self): def check_domain_exists(self, domain): if getSiteInfo(self, domain): return True - else: - return False + return False def setupdomain(self, data): @@ -1202,9 +1201,8 @@ def deleteWebRoot(self, webroot): Log.debug(self, "Removing {0}".format(webroot)) WOFileUtils.rm(self, webroot) return True - else: - Log.debug(self, "{0} does not exist".format(webroot)) - return False + Log.debug(self, "{0} does not exist".format(webroot)) + return False def removeNginxConf(self, domain):