From aa686dcad68cad7bf95a762b19f38fe2038bcac1 Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Wed, 27 Nov 2013 05:06:20 -0800 Subject: [PATCH] Ensure NVP API connection port is always an integer Convert the 'port' part of a NVP endpoint to int before passing it to the NVP API client. Change-Id: I15137d943ab950cb5cc80d7af2971bce3ac1a265 Closes-Bug: #1255519 --- neutron/plugins/nicira/NeutronPlugin.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/neutron/plugins/nicira/NeutronPlugin.py b/neutron/plugins/nicira/NeutronPlugin.py index 5fe7bbc95c..72876f6065 100644 --- a/neutron/plugins/nicira/NeutronPlugin.py +++ b/neutron/plugins/nicira/NeutronPlugin.py @@ -98,7 +98,11 @@ class NetworkTypes: def create_nvp_cluster(cluster_opts, concurrent_connections, nvp_gen_timeout): cluster = nvp_cluster.NVPCluster(**cluster_opts) - api_providers = [ctrl.split(':') + [True] + + def _ctrl_split(x, y): + return (x, int(y), True) + + api_providers = [_ctrl_split(*ctrl.split(':')) for ctrl in cluster.nvp_controllers] cluster.api_client = NvpApiClient.NVPApiHelper( api_providers, cluster.nvp_user, cluster.nvp_password,