Commits

theoden committed 9f24a57

* Apache and Nginx now remove config from sites-available, too.

  • Participants
  • Parent commits 5823477
  • Branches multiple web-servers

Comments (0)

Files changed (3)

File fab_deploy/apps.py

         Is prohibited to remove app's code since several appications may share
         single VCS repository.
         """
-        self.frontend.disable_config()
+        self.frontend.remove_config()
 
 
 class WebApp(StaticSite):
         single VCS repository.
         """
         super(WebApp, self).remove()
-        self.backend.disable_config()
+        self.backend.remove_config()
 
     @task_method
     @abstractmethod

File fab_deploy/webserver/apache.py

 
     @task_method
     @utils.run_as_sudo
-    def disable_config(self):
-        """ Disables apache config and reloads apache. """
-        sudo('a2dissite %s' % self._get_server_config_name())
+    def remove_config(self):
+        """ Removes apache config and reloads apache. """
+        name = self._get_server_config_name()
+        sudo('a2dissite %s' % name)
+        sudo('rm -f /etc/apache2/sites-available/'+name)
         sudo('invoke-rc.d apache2 reload')
 
     @task_method

File fab_deploy/webserver/nginx.py

 
     @task_method
     @utils.run_as_sudo
-    def disable_config(self):
-        """ Disables nginx config and reloads nginx. """
-        sudo('rm -f /etc/nginx/sites-enabled/' + self._get_server_config_name())
+    def remove_config(self):
+        """ Removes nginx config and reloads nginx. """
+        name = self._get_server_config_name()
+        sudo('rm -f /etc/nginx/sites-enabled/'+name)
+        sudo('rm -f /etc/nginx/sites-available/'+name)
         sudo('invoke-rc.d nginx reload')