simplify locations nginx template

This commit is contained in:
VirtuBox
2019-03-27 04:58:25 +01:00
parent 094be12dd8
commit a2e6f02795
21 changed files with 39 additions and 98 deletions

View File

@@ -271,8 +271,8 @@ class WOStackController(CementBaseController):
wo_nginx.close()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/locations-php72.conf')
wo_nginx = open('/etc/nginx/common/locations-php72.conf',
'file /etc/nginx/common/locations-wo.conf')
wo_nginx = open('/etc/nginx/common/locations-wo.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'locations.mustache',
out=wo_nginx)
@@ -321,14 +321,6 @@ class WOStackController(CementBaseController):
# php73 conf
if not os.path.isfile("/etc/nginx/common/php73.conf"):
# data = dict()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/locations-php73.conf')
wo_nginx = open('/etc/nginx/common/locations-php73.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'locations-php7.mustache',
out=wo_nginx)
wo_nginx.close()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/php73.conf')
wo_nginx = open('/etc/nginx/common/php73.conf',
@@ -369,6 +361,15 @@ class WOStackController(CementBaseController):
out=wo_nginx)
wo_nginx.close()
if not os.path.isfile("/etc/nginx/common/locations-wo.conf"):
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/locations-wo.conf')
wo_nginx = open('/etc/nginx/common/locations-wo.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'locations.mustache',
out=wo_nginx)
wo_nginx.close()
# Nginx-Plus does not have nginx
# package structure like this
# So creating directories
@@ -564,13 +565,6 @@ class WOStackController(CementBaseController):
if (os.path.isdir("/etc/nginx/common") and
not os.path.isfile("/etc/nginx/common/php73.conf")):
data = dict()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/locations-php73.conf')
wo_nginx = open('/etc/nginx/common/locations-php73.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'locations-php7.mustache',
out=wo_nginx)
wo_nginx.close()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/php73.conf')