From 633c7e2eba5067bf2220c0800c6452d9087a7646 Mon Sep 17 00:00:00 2001 From: lloretgalleg Date: Tue, 2 Jun 2020 07:17:17 +0200 Subject: [PATCH] Corrected bug: If vlan provided is None raise an error Change-Id: Ide943ed5a2ae5e03028b90c266144a8051e616c7 Signed-off-by: lloretgalleg --- .../osm_rosdn_juniper_contrail/sdn_assist_juniper_contrail.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RO-SDN-juniper_contrail/osm_rosdn_juniper_contrail/sdn_assist_juniper_contrail.py b/RO-SDN-juniper_contrail/osm_rosdn_juniper_contrail/sdn_assist_juniper_contrail.py index b3d3eb49..2fcdb1d6 100644 --- a/RO-SDN-juniper_contrail/osm_rosdn_juniper_contrail/sdn_assist_juniper_contrail.py +++ b/RO-SDN-juniper_contrail/osm_rosdn_juniper_contrail/sdn_assist_juniper_contrail.py @@ -398,6 +398,8 @@ class JuniperContrail(SdnConnectorBase): if len(vlans) == 1: vlan = vlans.pop() self.logger.debug("Provided vlan: {}".format(vlan)) + if not vlan: + raise SdnConnectorError("No vlan provided") else: raise SdnConnectorError("Provided more than one vlan") -- 2.25.1