Revert "Check manager status for policy using passthough healthcheck api"

This reverts commit 44d0cb5e0f.

Change-Id: I893eb52b55746ae8edfbe43a7fda175ffc890cc5
This commit is contained in:
Kobi Samoray 2019-04-23 17:36:25 +00:00 committed by Anna Khmelnitsky
parent aac80cab30
commit 1d7e01ae20
2 changed files with 3 additions and 19 deletions

View File

@ -32,6 +32,7 @@ class NsxLibBase(object):
def __init__(self, nsxlib_config):
self.nsx_version = None
self.nsx_api = None
self.set_config(nsxlib_config)
# create the Cluster

View File

@ -20,7 +20,6 @@ from oslo_log import log
from vmware_nsxlib import v3
from vmware_nsxlib.v3 import client
from vmware_nsxlib.v3 import exceptions
from vmware_nsxlib.v3 import lib
from vmware_nsxlib.v3 import nsx_constants
@ -120,24 +119,8 @@ class NsxPolicyLib(lib.NsxLibBase):
@property
def validate_connection_method(self):
"""Return a method that will validate the NSX manager status"""
def check_manager_status_passthrough(client, manager_url):
# Try to get the status silently and with no retries
status = client.get('reverse-proxy/node/health',
silent=True, with_retries=False)
if (not status or not status.get('healthy', False)):
msg = _("Manager is not in working state: %s") % status
LOG.warning(msg)
raise exceptions.ResourceNotFound(
manager=manager_url, operation=msg)
def check_manager_status(client, manager_url):
# Decide on the healthcheck by the passthrough status
if self.nsx_api:
return check_manager_status_passthrough(
self.nsx_api.client, manager_url)
return check_manager_status
# TODO(asarfaty): Find an equivalent api to check policy status
pass
def get_version(self):
"""Get the NSX Policy manager version