mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Save image size + start to automatic template creation based on image checksum.
This commit is contained in:
1 parent
f13b4e89b7
commit
078c42f185
7 files changed
+39
-9
No files matched your search
@@ -56,6 +56,14 @@ class Appliance:
|
||||
def name(self):
|
||||
return self._data.get("name")
|
||||
|
||||
@property
|
||||
def images(self):
|
||||
return self._data.get("images")
|
||||
|
||||
@property
|
||||
def versions(self):
|
||||
return self._data.get("versions")
|
||||
|
||||
@symbol.setter
|
||||
def symbol(self, new_symbol):
|
||||
self._data["symbol"] = new_symbol
|
||||
|
||||
@@ -77,6 +77,20 @@ class ApplianceManager:
|
||||
os.makedirs(appliances_path, exist_ok=True)
|
||||
return appliances_path
|
||||
|
||||
#TODO: finish
|
||||
def find_appliance_with_image(self, image_checksum):
|
||||
|
||||
for appliance in self._appliances.values():
|
||||
if appliance.images:
|
||||
for image in appliance.images:
|
||||
if image["md5sum"] == image_checksum:
|
||||
print(f"APPLIANCE FOUND {appliance.name}")
|
||||
version = image["version"]
|
||||
print(f"IMAGE VERSION {version}")
|
||||
if image.versions:
|
||||
for version in image.versions:
|
||||
pass
|
||||
|
||||
def load_appliances(self, symbol_theme="Classic"):
|
||||
"""
|
||||
Loads appliance files from disk.
|
||||
|
||||
Reference in new issue
Block a user