From 993f058dfe6f2f2e8721815d1b4e9733fbf887ce Mon Sep 17 00:00:00 2001 From: Alex Yang Date: Sat, 30 Sep 2017 16:09:20 +0800 Subject: [PATCH] Convert vlan_id from unicode to int Temporary solution for opnfv CI job https://build.opnfv.org/ci/job/daisy-deploy-baremetal-daily-master/169/ Change-Id: I0aa68442067d3416e9a0665648b204b669d44816 Signed-off-by: Alex Yang --- code/daisy/daisy/api/v1/networks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/daisy/daisy/api/v1/networks.py b/code/daisy/daisy/api/v1/networks.py index 16094d13..b771dc63 100755 --- a/code/daisy/daisy/api/v1/networks.py +++ b/code/daisy/daisy/api/v1/networks.py @@ -575,12 +575,12 @@ class Controller(controller.BaseController): for network in networks: if network['cidr'] and network['vlan_id']: if cidr == network['cidr'] \ - and vlan_id != network['vlan_id'] \ + and vlan_id != eval(network['vlan_id']) \ and network['id'] != network_id: msg = (_('Networks with the same cidr must have ' 'the same vlan_id')) raise HTTPBadRequest(explanation=msg) - if vlan_id == network['vlan_id'] \ + if vlan_id == eval(network['vlan_id']) \ and cidr != network['cidr'] \ and network['id'] != network_id: msg = (_('Networks with the same vlan_id must '