From fa4c7c04f6ea2f2ad7be5d887a3619eb48d3ed6f Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Wed, 2 Oct 2019 16:14:43 +0200 Subject: [PATCH] Fix WOSite --- wo/cli/plugins/site.py | 14 ++++++++++++-- wo/core/fileutils.py | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/wo/cli/plugins/site.py b/wo/cli/plugins/site.py index 27c89a7..ab4e12c 100644 --- a/wo/cli/plugins/site.py +++ b/wo/cli/plugins/site.py @@ -57,6 +57,7 @@ class WOSiteController(CementBaseController): pargs.site_name = pargs.site_name.strip() # validate domain name wo_domain = WODomain.validate(self, pargs.site_name) + wo_www_domain = "www.{0}".format(wo_domain) # check if site exists if not check_domain_exists(self, wo_domain): @@ -94,6 +95,7 @@ class WOSiteController(CementBaseController): Log.error(self, 'could not input site name') pargs.site_name = pargs.site_name.strip() wo_domain = WODomain.validate(self, pargs.site_name) + wo_www_domain = "www.{0}".format(wo_domain) # check if site exists if not check_domain_exists(self, wo_domain): Log.error(self, "site {0} does not exist".format(wo_domain)) @@ -134,6 +136,7 @@ class WOSiteController(CementBaseController): Log.error(self, 'could not input site name') pargs.site_name = pargs.site_name.strip() wo_domain = WODomain.validate(self, pargs.site_name) + wo_www_domain = "www.{0}".format(wo_domain) (wo_domain_type, wo_root_domain) = WODomain.getlevel( self, wo_domain) wo_db_name = '' @@ -187,6 +190,7 @@ class WOSiteController(CementBaseController): pargs = self.app.pargs pargs.site_name = pargs.site_name.strip() wo_domain = WODomain.validate(self, pargs.site_name) + wo_www_domain = "www.{0}".format(wo_domain) wo_site_webroot = getSiteInfo(self, wo_domain).site_path if not check_domain_exists(self, wo_domain): @@ -209,6 +213,7 @@ class WOSiteController(CementBaseController): # TODO Write code for wo site edit command here pargs.site_name = pargs.site_name.strip() wo_domain = WODomain.validate(self, pargs.site_name) + wo_www_domain = "www.{0}".format(wo_domain) if not check_domain_exists(self, wo_domain): Log.error(self, "site {0} does not exist".format(wo_domain)) @@ -240,6 +245,7 @@ class WOSiteController(CementBaseController): pargs.site_name = pargs.site_name.strip() wo_domain = WODomain.validate(self, pargs.site_name) + wo_www_domain = "www.{0}".format(wo_domain) if not check_domain_exists(self, wo_domain): Log.error(self, "site {0} does not exist".format(wo_domain)) @@ -280,7 +286,7 @@ class WOSiteEditController(CementBaseController): pargs.site_name = pargs.site_name.strip() wo_domain = WODomain.validate(self, pargs.site_name) - + wo_www_domain = "www.{0}".format(wo_domain) if not check_domain_exists(self, wo_domain): Log.error(self, "site {0} does not exist".format(wo_domain)) @@ -430,6 +436,7 @@ class WOSiteCreateController(CementBaseController): pargs.site_name = pargs.site_name.strip() wo_domain = WODomain.validate(self, pargs.site_name) + wo_www_domain = "www.{0}".format(wo_domain) if not wo_domain.strip(): Log.error(self, "Invalid domain name, " "Provide valid domain name") @@ -984,6 +991,7 @@ class WOSiteUpdateController(CementBaseController): pargs.site_name = pargs.site_name.strip() wo_domain = WODomain.validate(self, pargs.site_name) + wo_www_domain = "www.{0}".format(wo_domain) wo_site_webroot = WOVar.wo_webroot + wo_domain check_site = getSiteInfo(self, wo_domain) @@ -1133,7 +1141,8 @@ class WOSiteUpdateController(CementBaseController): if pargs.php73: if not data: data = dict( - site_name=wo_domain, www_domain=wo_www_domain, + site_name=wo_domain, + www_domain=wo_www_domain, currsitetype=oldsitetype, currcachetype=oldcachetype, webroot=wo_site_webroot) @@ -1950,6 +1959,7 @@ class WOSiteDeleteController(CementBaseController): pargs.site_name = pargs.site_name.strip() wo_domain = WODomain.validate(self, pargs.site_name) + wo_www_domain = "www.{0}".format(wo_domain) wo_db_name = '' wo_prompt = '' wo_nginx_prompt = '' diff --git a/wo/core/fileutils.py b/wo/core/fileutils.py index ca3ae00..6a9b505 100644 --- a/wo/core/fileutils.py +++ b/wo/core/fileutils.py @@ -43,7 +43,7 @@ class WOFileUtils(): Log.debug(self, "Creating Symbolic link, Source:{0}, Dest:{1}" .format(src, dst)) os.symlink(src, dst) - except Exception as e: + except OSError as e: Log.debug(self, "{0}{1}".format(e.errno, e.strerror)) Log.error(self, "Unable to create symbolic link ...\n ") else: