Fix issue with controller config saved before checking current version with previous one

This commit is contained in:
grossmj 2023-09-06 16:48:24 +07:00
parent a69feb3682
commit 709aa46074

View File

@ -191,9 +191,8 @@ class Controller:
Save the controller configuration on disk
"""
if self._config_loaded is False:
return
controller_settings = dict()
if self._config_loaded:
controller_settings = {"computes": [],
"templates": [],
"gns3vm": self.gns3vm.__json__(),
@ -229,8 +228,7 @@ class Controller:
try:
if not os.path.exists(self._config_file):
self._config_loaded = True
self.save()
self.save() # this will create the config file
with open(self._config_file) as f:
controller_settings = json.load(f)
except (OSError, ValueError) as e: