mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 14:31:13 +02:00
Create/update project on compute when variables changes
This commit is contained in:
1 parent
83445214be
commit
7b3d5ae5e3
9 files changed
+98
-11
No files matched your search
@@ -25,13 +25,13 @@ import zipfile
|
||||
import json
|
||||
|
||||
from uuid import UUID, uuid4
|
||||
|
||||
from .port_manager import PortManager
|
||||
from .notification_manager import NotificationManager
|
||||
from ..config import Config
|
||||
from ..utils.asyncio import wait_run_in_executor
|
||||
from ..utils.path import check_path_allowed, get_default_project_directory
|
||||
|
||||
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -297,6 +297,17 @@ class Project:
|
||||
yield from node.delete()
|
||||
self._nodes.remove(node)
|
||||
|
||||
@asyncio.coroutine
|
||||
def update(self, variables=None, **kwargs):
|
||||
original_variables = self.variables
|
||||
self.variables = variables
|
||||
|
||||
# we need to update docker nodes when variables changes
|
||||
if original_variables != variables:
|
||||
for node in self.nodes:
|
||||
if hasattr(node, 'update'):
|
||||
yield from node.update()
|
||||
|
||||
@asyncio.coroutine
|
||||
def close(self):
|
||||
"""
|
||||
|
||||
Reference in new issue
Block a user