mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-25 00:08:11 +00:00
Fix issue with controller config saved before checking current version with previous one
This commit is contained in:
parent
a69feb3682
commit
709aa46074
@ -191,9 +191,8 @@ class Controller:
|
|||||||
Save the controller configuration on disk
|
Save the controller configuration on disk
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if self._config_loaded is False:
|
controller_settings = dict()
|
||||||
return
|
if self._config_loaded:
|
||||||
|
|
||||||
controller_settings = {"computes": [],
|
controller_settings = {"computes": [],
|
||||||
"templates": [],
|
"templates": [],
|
||||||
"gns3vm": self.gns3vm.__json__(),
|
"gns3vm": self.gns3vm.__json__(),
|
||||||
@ -229,8 +228,7 @@ class Controller:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
if not os.path.exists(self._config_file):
|
if not os.path.exists(self._config_file):
|
||||||
self._config_loaded = True
|
self.save() # this will create the config file
|
||||||
self.save()
|
|
||||||
with open(self._config_file) as f:
|
with open(self._config_file) as f:
|
||||||
controller_settings = json.load(f)
|
controller_settings = json.load(f)
|
||||||
except (OSError, ValueError) as e:
|
except (OSError, ValueError) as e:
|
||||||
|
Loading…
Reference in New Issue
Block a user