This is an automated email from the ASF dual-hosted git repository.

dahn pushed a commit to branch 4.18
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.18 by this push:
     new 10d7e6cf6ff VR: remove apache2 config for removed VPC tiers (#7982)
10d7e6cf6ff is described below

commit 10d7e6cf6ff04cdb59ef293e13273f432ddf028d
Author: Wei Zhou <[email protected]>
AuthorDate: Tue Sep 26 15:25:39 2023 +0200

    VR: remove apache2 config for removed VPC tiers (#7982)
---
 systemvm/debian/opt/cloud/bin/cs/CsAddress.py | 8 ++++++--
 systemvm/debian/opt/cloud/bin/cs/CsApp.py     | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/systemvm/debian/opt/cloud/bin/cs/CsAddress.py 
b/systemvm/debian/opt/cloud/bin/cs/CsAddress.py
index 7c7f5e48d64..a8634a75ae3 100755
--- a/systemvm/debian/opt/cloud/bin/cs/CsAddress.py
+++ b/systemvm/debian/opt/cloud/bin/cs/CsAddress.py
@@ -668,8 +668,12 @@ class CsIP:
                 logging.info("Not making dns publicly available")
 
             if self.config.has_metadata():
-                app = CsApache(self)
-                app.setup()
+                if method == "add":
+                    app = CsApache(self)
+                    app.setup()
+                elif method == "delete":
+                    app = CsApache(self)
+                    app.remove()
 
                 # If redundant then this is dealt with
                 # by the primary backup functions
diff --git a/systemvm/debian/opt/cloud/bin/cs/CsApp.py 
b/systemvm/debian/opt/cloud/bin/cs/CsApp.py
index d8b3223f017..123171a09c0 100755
--- a/systemvm/debian/opt/cloud/bin/cs/CsApp.py
+++ b/systemvm/debian/opt/cloud/bin/cs/CsApp.py
@@ -34,7 +34,7 @@ class CsApache(CsApp):
     """ Set up Apache """
 
     def remove(self):
-        file = "/etc/apache2/sites-enabled/vhost-%s.conf" % self.dev
+        file = "/etc/apache2/sites-enabled/vhost-%s.conf" % self.ip
         if os.path.isfile(file):
             os.remove(file)
             CsHelper.service("apache2", "restart")

Reply via email to