From dd63ca6ef1950b4c2b8f3b2e05e7d7397144cfd4 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Tue, 19 Jul 2016 13:26:27 +0200 Subject: [PATCH] Temporary fix for remote GNS3 VM support Ref #623 --- gns3server/controller/__init__.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gns3server/controller/__init__.py b/gns3server/controller/__init__.py index 61a3b075..d8b977ae 100644 --- a/gns3server/controller/__init__.py +++ b/gns3server/controller/__init__.py @@ -126,7 +126,6 @@ class Controller: with open(config_file) as f: data = json.load(f) for remote in data.get("Servers", {}).get("remote_servers", []): - print("a") yield from self.add_compute( host=remote.get("host", "localhost"), port=remote.get("port", 3080), @@ -166,8 +165,8 @@ class Controller: """ if compute_id not in self._computes: - # We disallow to create from the outside the - if compute_id == 'local': + # We disallow to create from the outside the local and VM server + if compute_id == 'local' or compute_id == 'vm': return None for compute in self._computes.values(): @@ -178,6 +177,13 @@ class Controller: self._computes[compute.id] = compute self.save() self.notification.emit("compute.created", compute.__json__()) + + #FIXME: temporary before the remote GNS3 VM support is back + if "vm" not in self._computes and not hasattr(sys, "_called_from_test"): + compute_vm = Compute(compute_id="vm", controller=self, name="GNS3 VM", **kwargs) + self._computes[compute_vm.id] = compute_vm + self.notification.emit("compute.created", compute_vm.__json__()) + return compute else: self.notification.emit("compute.updated", self._computes[compute_id].__json__())