mirror of
https://github.com/GNS3/gns3-gui.git
synced 2026-06-03 17:22:03 +03:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5285cd142 | ||
|
|
69482343ba | ||
|
|
d4639c2e61 | ||
|
|
b85ade9dd7 | ||
|
|
e191cb8aa3 | ||
|
|
e6bc75ce26 | ||
|
|
bc1df346f2 | ||
|
|
27c35321f0 | ||
|
|
7b99ba325b |
12
CHANGELOG
12
CHANGELOG
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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):
|
||||
"""
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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':
|
||||
|
||||
Reference in New Issue
Block a user