use with open() so the file actually gets closed

This commit is contained in:
Scott King
2023-11-17 10:58:27 -07:00
committed by GitHub
parent 5e23993e5b
commit 03d94d7f44

View File

@@ -120,8 +120,8 @@ class cyberPanel:
websites = Websites.objects.all()
ipFile = "/etc/cyberpanel/machineIP"
f = open(ipFile)
ipData = f.read()
with open(ipFile, 'r') as f:
ipData = f.read()
ipAddress = ipData.split('\n', 1)[0]
json_data = []