Support dualstack ipv6 in the console controller

This commit updates the console controller logic and
a few bits in the model in order to support multiple
address families (ipv4 and ipv6)
This commit is contained in:
2021-08-04 14:55:29 +00:00
parent 8a6d558402
commit 17c915c1bf
2 changed files with 31 additions and 23 deletions

View File

@ -179,10 +179,14 @@ class DBModel:
self.cursor.fetchall()
))
def update_vm_ip(self, email, id, ipv4):
def update_vm_ipv4(self, email, id, ipv4):
self.cursor.execute("UPDATE vms SET public_ipv4 = %s WHERE email = %s AND id = %s", (ipv4, email, id))
self.connection.commit()
def update_vm_ipv6(self, email, id, ipv6):
self.cursor.execute("UPDATE vms SET public_ipv6 = %s WHERE email = %s AND id = %s", (ipv6, email, id))
self.connection.commit()
def update_vm_ssh_host_keys(self, email, id, ssh_host_keys):
for key in ssh_host_keys:
self.cursor.execute("""