fix indentation
This commit is contained in:
@@ -359,10 +359,11 @@ class WOStackController(CementBaseController):
|
||||
out=wo_nginx)
|
||||
wo_nginx.close()
|
||||
|
||||
# Nginx-Plus does not have nginx package structure like this
|
||||
# Nginx-Plus does not have nginx
|
||||
# package structure like this
|
||||
# So creating directories
|
||||
if set(["nginx-plus"]).issubset(set(apt_packages)) or
|
||||
set(["nginx"]).issubset(set(apt_packages)):
|
||||
if (set(["nginx-plus"]).issubset(set(apt_packages)) or
|
||||
set(["nginx"]).issubset(set(apt_packages))):
|
||||
Log.info(self,
|
||||
"Installing WordOpsConfigurations for" "NGINX")
|
||||
if not os.path.exists('/etc/nginx/sites-available'):
|
||||
@@ -474,8 +475,8 @@ class WOStackController(CementBaseController):
|
||||
WOGit.add(self,
|
||||
["/etc/nginx"], msg="Adding Nginx into Git")
|
||||
WOService.reload_service(self, 'nginx')
|
||||
if set(["nginx-plus"]).issubset(set(apt_packages)) or
|
||||
set(["nginx"]).issubset(set(apt_packages)):
|
||||
if (set(["nginx-plus"]).issubset(set(apt_packages)) or
|
||||
set(["nginx"]).issubset(set(apt_packages))):
|
||||
WOShellExec.cmd_exec(self, "sed -i -e 's/^user/#user/'"
|
||||
" -e '/^#user/a user"
|
||||
"\ www-data\;'"
|
||||
@@ -509,7 +510,8 @@ class WOStackController(CementBaseController):
|
||||
WOService.restart_service(self, 'nginx')
|
||||
|
||||
if WOAptGet.is_installed(self, 'redis-server'):
|
||||
if os.path.isfile("/etc/nginx/nginx.conf") and (not os.path.isfile("/etc/nginx/common/redis-php72.conf")):
|
||||
if (os.path.isfile("/etc/nginx/nginx.conf") and
|
||||
not os.path.isfile("/etc/nginx/common/redis-php72.conf")):
|
||||
|
||||
data = dict()
|
||||
Log.debug(self, 'Writting the nginx configuration to '
|
||||
@@ -521,7 +523,7 @@ class WOStackController(CementBaseController):
|
||||
wo_nginx.close()
|
||||
|
||||
if (WOVariables.wo_platform_distro == 'ubuntu'):
|
||||
if os.path.isfile("/etc/nginx/nginx.conf") and (not os.path.isfile("/etc/nginx/common/redis-php73.conf")):
|
||||
if (os.path.isfile("/etc/nginx/nginx.conf") and not os.path.isfile("/etc/nginx/common/redis-php73.conf")):
|
||||
data = dict()
|
||||
Log.debug(self, 'Writting the nginx configuration to '
|
||||
'file /etc/nginx/common/redis-php73.conf')
|
||||
@@ -541,7 +543,8 @@ class WOStackController(CementBaseController):
|
||||
" server 127.0.0.1:6379;\n"
|
||||
" keepalive 10;\n}\n")
|
||||
|
||||
if os.path.isfile("/etc/nginx/nginx.conf") and (not os.path.isfile("/etc/nginx/conf.d/redis.conf")):
|
||||
if (os.path.isfile("/etc/nginx/nginx.conf") and
|
||||
not os.path.isfile("/etc/nginx/conf.d/redis.conf")):
|
||||
with open("/etc/nginx/conf.d/redis.conf", "a") as redis_file:
|
||||
redis_file.write("# Log format Settings\n"
|
||||
"log_format rt_cache_redis '$remote_addr $upstream_response_time $srcache_fetch_status [$time_local] '\n"
|
||||
@@ -549,8 +552,8 @@ class WOStackController(CementBaseController):
|
||||
"'\"$http_referer\" \"$http_user_agent\"';\n")
|
||||
# setup nginx common folder for php7
|
||||
if self.app.pargs.php73:
|
||||
if os.path.isdir("/etc/nginx/common") and
|
||||
(not os.path.isfile("/etc/nginx/common/php73.conf")):
|
||||
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')
|
||||
@@ -592,8 +595,8 @@ class WOStackController(CementBaseController):
|
||||
out=wo_nginx)
|
||||
wo_nginx.close()
|
||||
|
||||
if os.path.isdir("/etc/nginx/common") and
|
||||
(not os.path.isfile("/etc/nginx/common/redis-php73.conf")):
|
||||
if (os.path.isdir("/etc/nginx/common") and
|
||||
not os.path.isfile("/etc/nginx/common/redis-php73.conf")):
|
||||
data = dict()
|
||||
Log.debug(self, 'Writting the nginx configuration to '
|
||||
'file /etc/nginx/common/redis-php73.conf')
|
||||
@@ -611,8 +614,8 @@ class WOStackController(CementBaseController):
|
||||
"upstream debug73 {\nserver 127.0.0.1:9173;\n}\n")
|
||||
|
||||
if set(WOVariables.wo_redis).issubset(set(apt_packages)):
|
||||
if os.path.isfile("/etc/nginx/nginx.conf") and
|
||||
(not os.path.isfile("/etc/nginx/common/redis-php72.conf")):
|
||||
if (os.path.isfile("/etc/nginx/nginx.conf") and
|
||||
not os.path.isfile("/etc/nginx/common/redis-php72.conf")):
|
||||
|
||||
data = dict()
|
||||
Log.debug(self, 'Writting the nginx configuration to '
|
||||
|
||||
Reference in New Issue
Block a user