VR: remove apache2 config for removed VPC tiers (#7982)

This commit is contained in:
Wei Zhou 2023-09-26 15:25:39 +02:00 committed by GitHub
parent 8aa45c1a98
commit 10d7e6cf6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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")