NSX|V3: add in a method for getting the NSX version

Provide method that returns the NSX version.

Change-Id: I9ff59c63a776034a8be138ce2ef389d7aa787d55
This commit is contained in:
Gary Kotton 2016-05-18 03:53:24 -07:00
parent 539833fff4
commit c48cccebb8
2 changed files with 7 additions and 1 deletions

View File

@ -25,6 +25,12 @@ from vmware_nsx.nsxlib.v3 import client
LOG = log.getLogger(__name__)
def get_version():
node = client.get_resource("node")
version = node.get('node_version')
return version
def get_edge_cluster(edge_cluster_uuid):
resource = "edge-clusters/%s" % edge_cluster_uuid
return client.get_resource(resource)

View File

@ -147,7 +147,7 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
def __init__(self):
super(NsxV3Plugin, self).__init__()
LOG.info(_LI("Starting NsxV3Plugin"))
LOG.info(_LI("NSX Version: %s"), nsxlib.get_version())
self._api_cluster = nsx_cluster.NSXClusteredAPI()
self._nsx_client = nsx_client.NSX3Client(self._api_cluster)
nsx_client._set_default_api_cluster(self._api_cluster)