From 3229ffc138db11bae97eec1df0a8cbb3f17ebe38 Mon Sep 17 00:00:00 2001 From: Anna Khmelnitsky Date: Thu, 26 Mar 2020 08:18:31 -0700 Subject: [PATCH] Fix no-validation init use case For the case of no validation, endpoint state should be assumed to be UP. This is a quick fix to unblock no-validation scenarios. Next patch will deal with cluster DOWN->UP transition. Change-Id: Ia2a47e1a8d8aeb0174377b24b469613d866fc805 --- vmware_nsxlib/v3/cluster.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vmware_nsxlib/v3/cluster.py b/vmware_nsxlib/v3/cluster.py index 89ec57b0..e172c006 100644 --- a/vmware_nsxlib/v3/cluster.py +++ b/vmware_nsxlib/v3/cluster.py @@ -589,7 +589,10 @@ class ClusteredAPI(object): result = self._http_provider.validate_connection(self, endpoint, conn) - if result: + if result or endpoint.state == EndpointState.INITIALIZED: + # If no endpoint validation is configured, we assume + # endpoint is UP on startup, but we shouldn't move it + # to UP from DOWN state endpoint.set_state(EndpointState.UP) except exceptions.ClientCertificateNotTrusted: LOG.warning("Failed to validate API cluster endpoint "