use `with open()` so the file actually gets closed
This commit is contained in:
parent
5e23993e5b
commit
03d94d7f44
|
|
@ -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 = []
|
||||
|
|
|
|||
Loading…
Reference in New Issue