Save the GNS3 VM settings even if the GNS3 VM cannot be stopped.

This commit is contained in:
grossmj committed 2019-03-18 15:30:59 +07:00
1 parent 3a73d01547
commit 4e396ac690
2 files changed
+7 -3

No files matched your search

+5 -3
View File
@@ -212,9 +212,11 @@ class GNS3VM:
new_settings = copy.copy(self._settings)
new_settings.update(settings)
if self.settings != new_settings:
await self._stop()
self._settings = settings
self._controller.save()
try:
await self._stop()
finally:
self._settings = settings
self._controller.save()
if self.enable:
await self.start()
else:
@@ -239,6 +239,8 @@ class HyperVGNS3VM(BaseGNS3VM):
log.info("GNS3 VM has been started")
# Get the guest IP address
# LIS (Linux Integration Services) must be installed on the guest
# See https://oitibs.com/hyper-v-lis-on-ubuntu-18-04/ for details.
trial = 120
guest_ip_address = ""
log.info("Waiting for GNS3 VM IP")