Fix: reset hostname for each request

This commit is contained in:
Peter Šurda 2021-07-31 13:55:58 +08:00
parent e5b9d45a59
commit 0ee0ac4936
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -60,7 +60,7 @@ class CloudInitApp:
try: try:
self.hostinfo = socket.gethostbyaddr(self.remoteip) self.hostinfo = socket.gethostbyaddr(self.remoteip)
except socket.herror: except socket.herror:
pass self.hostinfo = ('localhost', )
def _redirect_if_needed(self): def _redirect_if_needed(self):
filepath = os.path.join(PATH, "data", self.hostinfo[0], filepath = os.path.join(PATH, "data", self.hostinfo[0],