From f540dd320b7ecd68b38b7f51a44fb5700beae115 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Tue, 15 Jun 2021 00:27:01 -0400 Subject: [PATCH] Allow VNI for "direct" type vNICs --- daemon-common/common.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/daemon-common/common.py b/daemon-common/common.py index 335c6afe..b9c0e38d 100644 --- a/daemon-common/common.py +++ b/daemon-common/common.py @@ -397,9 +397,13 @@ def getDomainNetworks(parsed_xml, stats_data): net_wr_packets = net_stats.get('wr_packets', 0) net_wr_errors = net_stats.get('wr_errors', 0) net_wr_drops = net_stats.get('wr_drops', 0) + if net_type in ['direct']: + net_vni = device.source.attrib.get('dev') + else: + net_vni = re_match(r'[vm]*br([0-9a-z]+)', net_bridge).group(1) net_obj = { 'type': net_type, - 'vni': re_match(r'[vm]*br([0-9a-z]+)', net_bridge).group(1), + 'vni': net_vni, 'mac': net_mac, 'source': net_bridge, 'model': net_model,