Prevent connection from Cloud to Cloud connection

Ref #1429
This commit is contained in:
Julien Duponchelle
2016-08-23 23:33:19 +02:00
parent bfabf3ddc8
commit 6cad685a08
2 changed files with 57 additions and 15 deletions

View File

@ -19,7 +19,7 @@ import os
import re
import uuid
import asyncio
import aiohttp
import logging
log = logging.getLogger(__name__)
@ -48,6 +48,11 @@ class Link:
Add a node to the link
"""
for other_node in self._nodes:
if node.node_type in ["nat", "cloud"]:
if other_node["node"].node_type in ["nat", "cloud"]:
raise aiohttp.web.HTTPConflict(text="It's not allowed to connect a {} to a {}".format(other_node["node"].node_type, node.node_type))
if label is None:
label = {
"x": -10,