aboutsummaryrefslogtreecommitdiffstats
path: root/app/discover/link_finders/find_links_for_pnics.py
diff options
context:
space:
mode:
authorKoren Lev <korenlev@gmail.com>2017-09-29 01:38:18 +0300
committerKoren Lev <korenlev@gmail.com>2017-09-29 01:38:18 +0300
commitd32f75145676bacefde0d08a14680a5984623451 (patch)
tree4b5eaf1107e6973b1eac636309a99c83074acbfc /app/discover/link_finders/find_links_for_pnics.py
parent0c5426cd309d720db1e30641e43d311ee0b751b0 (diff)
release 1.0 calipso for opnfv apex
Change-Id: I3e63cd27c5f4d3756e67a07c749863a68e84dde2 Signed-off-by: Koren Lev <korenlev@gmail.com>
Diffstat (limited to 'app/discover/link_finders/find_links_for_pnics.py')
-rw-r--r--app/discover/link_finders/find_links_for_pnics.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/discover/link_finders/find_links_for_pnics.py b/app/discover/link_finders/find_links_for_pnics.py
index 1f02426..94eba7b 100644
--- a/app/discover/link_finders/find_links_for_pnics.py
+++ b/app/discover/link_finders/find_links_for_pnics.py
@@ -41,6 +41,18 @@ class FindLinksForPnics(FindLinks):
def add_pnic_network_links(self, pnic):
host = pnic["host"]
+ if self.configuration.get_env_config()['type_drivers'] == "vlan":
+ # take this pnic only if we can find matching vedge-pnic links
+ matches = self.inv.find({
+ "environment": self.get_env(),
+ "link_type": "vedge-host_pnic",
+ "host": host,
+ "target_id": pnic["id"]},
+ projection={"_id": 1},
+ collection="links",
+ get_single=True)
+ if not matches:
+ return
# find ports for that host, and fetch just the network ID
ports = self.inv.find_items({
"environment": self.get_env(),