Merge branch 'master' into multiple-hosts

Conflicts:
	capsulflask/console.py
	capsulflask/db.py
	capsulflask/shared.py
	capsulflask/virt_model.py
This commit is contained in:
2021-02-15 17:52:17 -06:00
23 changed files with 819 additions and 43 deletions

View File

@ -1,18 +1,27 @@
import re
from flask import current_app
from typing import List
class OnlineHost:
def __init__(self, id: str, url: str):
self.id = id
self.url = url
# I decided to just use dict everywhere instead because I have to use dict to read it from json
# class SSHHostKey:
# def __init__(self, key_type=None, content=None, sha256=None):
# self.key_type = key_type
# self.content = content
# self.sha256 = sha256
class VirtualMachine:
def __init__(self, id, host, ipv4=None, ipv6=None):
def __init__(self, id, host, ipv4=None, ipv6=None, ssh_host_keys: List[dict] = list()):
self.id = id
self.host = host
self.ipv4 = ipv4
self.ipv6 = ipv6
self.ssh_host_keys = ssh_host_keys
class VirtualizationInterface:
def capacity_avaliable(self, additional_ram_bytes: int) -> bool: