mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-05 06:41:13 +02:00
Handle password configuration change on remote servers
Fix https://github.com/GNS3/gns3-gui/issues/1942
This commit is contained in:
2 files changed
+30
-10
No files matched your search
@@ -50,6 +50,7 @@ class Config:
|
||||
|
||||
# Monitor configuration files for changes
|
||||
self._watched_files = {}
|
||||
self._watch_callback = []
|
||||
|
||||
if sys.platform.startswith("win"):
|
||||
|
||||
@@ -116,6 +117,12 @@ class Config:
|
||||
self.clear()
|
||||
self._watch_config_file()
|
||||
|
||||
def listen_for_config_changes(self, callback):
|
||||
"""
|
||||
Call the callback when the configuration file change
|
||||
"""
|
||||
self._watch_callback.append(callback)
|
||||
|
||||
@property
|
||||
def profile(self):
|
||||
"""
|
||||
@@ -143,6 +150,8 @@ class Config:
|
||||
self.read_config()
|
||||
for section in self._override_config:
|
||||
self.set_section_config(section, self._override_config[section])
|
||||
for callback in self._watch_callback:
|
||||
callback()
|
||||
|
||||
def reload(self):
|
||||
"""
|
||||
|
||||
Reference in new issue
Block a user