]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Ensure NVP API connection port is always an integer
authorSalvatore Orlando <salv.orlando@gmail.com>
Wed, 27 Nov 2013 13:06:20 +0000 (05:06 -0800)
committerSalvatore Orlando <salv.orlando@gmail.com>
Wed, 27 Nov 2013 13:06:20 +0000 (05:06 -0800)
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

index 5fe7bbc95ca7798fa2b8c4dca944241214c8fec2..72876f6065792cbb5edb09ef3455881ca8800a06 100644 (file)
@@ -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,