mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-08 06:16:08 +01:00
use with open() so the file actually gets closed
This commit is contained in:
@@ -120,7 +120,7 @@ class cyberPanel:
|
|||||||
|
|
||||||
websites = Websites.objects.all()
|
websites = Websites.objects.all()
|
||||||
ipFile = "/etc/cyberpanel/machineIP"
|
ipFile = "/etc/cyberpanel/machineIP"
|
||||||
f = open(ipFile)
|
with open(ipFile, 'r') as f:
|
||||||
ipData = f.read()
|
ipData = f.read()
|
||||||
ipAddress = ipData.split('\n', 1)[0]
|
ipAddress = ipData.split('\n', 1)[0]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user