first crack at adding ssh host key display to the capsul detail page

This commit is contained in:
2021-01-30 01:39:48 -06:00
parent 29008bc963
commit 50cea6e0b4
13 changed files with 199 additions and 51 deletions

20
capsulflask/shared.py Normal file
View File

@ -0,0 +1,20 @@
from typing import List
# 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, ipv4: str = None, ipv6: str = None, ssh_host_keys: List[dict] = list()):
self.id = id
self.ipv4 = ipv4
self.ipv6 = ipv6
self.ssh_host_keys = ssh_host_keys
def my_exec_info_message(exec_info):
return "{}: {}".format(".".join([exec_info[0].__module__, exec_info[0].__name__]), exec_info[1])