Compare commits

...

9 Commits

Author SHA1 Message Date
grossmj
b5285cd142 Release v2.2.15 2020-10-07 15:29:52 +10:30
grossmj
69482343ba Fix custom symbol not sent to remote controller when installing appliance 2020-10-07 15:09:08 +10:30
grossmj
d4639c2e61 Development on 2.2.15dev1 2020-09-15 06:49:11 +09:30
grossmj
b85ade9dd7 Release v2.2.14 2020-09-15 05:52:48 +09:30
grossmj
e191cb8aa3 Fix tests. Ref #3002 2020-09-14 00:10:11 +09:30
grossmj
e6bc75ce26 Improvements to add a new version of an appliance from wizard. Fixes #3002. 2020-09-14 00:04:58 +09:30
grossmj
bc1df346f2 Development on 2.2.14dev1 2020-09-05 04:26:16 +09:30
grossmj
27c35321f0 Release v2.2.13 2020-09-04 23:13:28 +09:30
grossmj
7b99ba325b Development on 2.2.13dev1 2020-08-07 21:12:46 +09:30
7 changed files with 41 additions and 21 deletions

View File

@@ -1,5 +1,17 @@
# Change Log
## 2.2.15 07/10/2020
* Fix custom symbol not sent to remote controller when installing appliance
## 2.2.14 14/09/2020
* Improvements to add a new version of an appliance from wizard. Fixes #3002.
## 2.2.13 04/09/2020
* No changes
## 2.2.12 07/08/2020
* Downgrade psutil to version 5.6.7

View File

@@ -51,7 +51,7 @@ class CrashReport:
Report crash to a third party service
"""
DSN = "https://19d5ca7c4cfe447b92ea140f78b01c35:fd234a69afcc490bb7ca37bbb3eefefd@o19455.ingest.sentry.io/38506"
DSN = "https://5120f215040a4d0f8fea454f6baea6a4:3d447073ba874997a4f755ccdfd0f8ed@o19455.ingest.sentry.io/38506"
_instance = None
def __init__(self):

View File

@@ -475,8 +475,24 @@ class ApplianceWizard(QtWidgets.QWizard, Ui_ApplianceWizard):
Allow user to create a new version of an appliance
"""
new_version, ok = QtWidgets.QInputDialog.getText(self, "Creating a new version", "Create a new version for this appliance.\nPlease share your experience on the GNS3 community if this version works.\n\nVersion name:", QtWidgets.QLineEdit.Normal)
current = self.uiApplianceVersionTreeWidget.currentItem()
if current is None:
QtWidgets.QMessageBox.critical(self.parent(), "Base version", "Please select a base version")
return
base_version = current.data(0, QtCore.Qt.UserRole)
new_version_name, ok = QtWidgets.QInputDialog.getText(self, "Creating a new version", "Create a new version for this appliance.\nPlease share your experience on the GNS3 community if this version works.\n\nVersion name:", QtWidgets.QLineEdit.Normal, base_version.get("name"))
if ok:
new_version = {"name": new_version_name}
new_version["images"] = {}
for disk_type in base_version["images"]:
base_filename = base_version["images"][disk_type]["filename"]
filename, ok = QtWidgets.QInputDialog.getText(self, "Image", "Disk image filename for {}".format(disk_type), QtWidgets.QLineEdit.Normal, base_filename)
if not ok:
filename = base_filename
new_version["images"][disk_type] = {"filename": filename, "version": new_version_name}
try:
self._appliance.create_new_version(new_version)
except ApplianceError as e:

View File

@@ -115,22 +115,14 @@ class Appliance(collections.abc.Mapping):
if not found:
raise ApplianceError("Broken appliance missing file {} for version {}".format(filename, version["name"]))
def create_new_version(self, version_name):
def create_new_version(self, new_version):
"""
Duplicate a version in order to create a new version
"""
if 'versions' not in self._appliance.keys() or not self._appliance["versions"]:
if "versions" not in self._appliance.keys() or not self._appliance["versions"]:
raise ApplianceError("Your appliance file doesn't contain any versions")
ref = self._appliance["versions"][0]
new_version = {'name': version_name}
new_version['images'] = {}
for disk_type in ref['images']:
filename = ref['images'][disk_type]['filename']
filename = filename.replace(ref['images'][disk_type]['version'], version_name)
new_version['images'][disk_type] = {'filename': filename, 'version': version_name}
self._appliance['versions'].append(new_version)
self._appliance["versions"].append(new_version)
def search_images_for_version(self, version_name):
"""

View File

@@ -178,8 +178,9 @@ class ApplianceToTemplate:
if symbol_id.startswith(":/symbols/"):
return symbol_id
controller = Controller.instance()
path = os.path.join(Config().symbols_dir, symbol_id)
if os.path.exists(path):
if not controller.isRemote() and os.path.exists(path):
return os.path.basename(path)
if controller_symbols:
@@ -197,7 +198,6 @@ class ApplianceToTemplate:
url = "https://raw.githubusercontent.com/GNS3/gns3-registry/master/symbols/{}".format(symbol_id)
try:
self._downloadApplianceSymbol(url, path)
controller = Controller.instance()
controller.clearStaticCache()
if controller.isRemote():
controller.uploadSymbol(symbol_id, path)

View File

@@ -23,9 +23,9 @@
# or negative for a release candidate or beta (after the base version
# number has been incremented)
__version__ = "2.2.12"
__version_info__ = (2, 2, 12, 0)
# If it's a git checkout try to add the commit
__version__ = "2.2.15"
__version_info__ = (2, 2, 15, 0)
if "dev" in __version__:
try:
import os

View File

@@ -171,8 +171,8 @@ def test_create_new_version():
os.path.dirname(__file__), "appliances", "microcore-linux.gns3a")
a = Appliance(registry, appliance_path)
a.create_new_version("42.0")
new_version = {'images': {'hda_disk_image': {'filename': 'linux-microcore-42.0.img', 'version': '42.0'}}, 'name': '42.0'}
a.create_new_version(new_version)
v = a['versions'][-1:][0]
assert v == {
'images':