Fix WOSite
This commit is contained in:
@@ -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 = ''
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user