1. Sven Grunewaldt
  2. dev-services-launcher

Commits

Sven Grunewaldt  committed ace98dc

Only parse Nginx upstreams when PHP is active

  • Participants
  • Parent commits f3b6d13
  • Branches master

Comments (0)

Files changed (1)

File services/Nginx.py

View file
 
         self.nginx_config = open(self.config_path).read()
 
-        self.parse_upstreams()
+        if settings.START_PHP:
+            self.parse_upstreams()
 
-        if not self.upstreams.__contains__('php'):
-            sys.exit("Could not find upstream php in nginx config")
+            if not self.upstreams.__contains__('php'):
+                sys.exit("Could not find upstream php in nginx config")
 
     def start(self):
         self.process = subprocess.Popen(
         return stderr.strip().decode('utf-8')
 
     def get_php_upstream(self):
+        if not settings.START_PHP:
+            raise Exception('Upstreams are only parsed when START_PHP is True')
         return self.upstreams.get("php")
 
     def parse_upstreams(self):