mirror of
https://github.com/GNS3/gns3-server
synced 2025-02-17 18:42:00 +00:00
Reset project auto start, auto close, auto open at project import
This commit is contained in:
parent
ac085126fc
commit
9e81994adc
@ -76,6 +76,10 @@ def import_project(controller, project_id, stream, location=None, name=None, kee
|
|||||||
|
|
||||||
topology = load_topology(os.path.join(path, "project.gns3"))
|
topology = load_topology(os.path.join(path, "project.gns3"))
|
||||||
topology["name"] = project_name
|
topology["name"] = project_name
|
||||||
|
# To avoid unexpected behavior (project start without manual operations just after import)
|
||||||
|
topology["auto_start"] = False
|
||||||
|
topology["auto_open"] = False
|
||||||
|
topology["auto_close"] = False
|
||||||
|
|
||||||
# Modify the compute id of the node depending of compute capacity
|
# Modify the compute id of the node depending of compute capacity
|
||||||
if not keep_compute_id:
|
if not keep_compute_id:
|
||||||
|
@ -232,7 +232,7 @@ class WebServer:
|
|||||||
data = json.dumps(server_info)
|
data = json.dumps(server_info)
|
||||||
sock.sendto(data.encode(), address)
|
sock.sendto(data.encode(), address)
|
||||||
log.debug("Sent server info to {}:{} {}".format(address[0], address[1], data))
|
log.debug("Sent server info to {}:{} {}".format(address[0], address[1], data))
|
||||||
time.sleep(1) # this is to prevent too many request to slow down the server
|
time.sleep(1) # this is to prevent too many request to slow down the server
|
||||||
log.debug("UDP server discovery stopped")
|
log.debug("UDP server discovery stopped")
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
@ -305,9 +305,9 @@ class WebServer:
|
|||||||
asyncio.async(self.start_shell())
|
asyncio.async(self.start_shell())
|
||||||
|
|
||||||
if sys.platform.startswith("linux") and server_config.getboolean("server_discovery"):
|
if sys.platform.startswith("linux") and server_config.getboolean("server_discovery"):
|
||||||
# UDP discovery is only supported on Linux
|
# UDP discovery is only supported on Linux
|
||||||
udp_server_discovery = threading.Thread(target=self._udp_server_discovery, daemon=True)
|
udp_server_discovery = threading.Thread(target=self._udp_server_discovery, daemon=True)
|
||||||
udp_server_discovery.start()
|
udp_server_discovery.start()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self._loop.run_forever()
|
self._loop.run_forever()
|
||||||
|
Loading…
Reference in New Issue
Block a user