def get_cluster_version(cluster):
 uri = '/ws.v1/control-cluster/node?_page_length=1&fields=uuid'
 try:
  res = do_single_request(HTTP_GET, uri, cluster=cluster)
  res = json.loads(res)
 except NvpApiClient.NvpApiException:
  raise exception.QuantumException()
 if (res['result_count'] == 0):
  return None
 node_uuid = res['results'][0]['uuid']
 uri = ('/ws.v1/control-cluster/node/%s/status' % node_uuid)
 try:
  res = do_single_request(HTTP_GET, uri, cluster=cluster)
  res = json.loads(res)
 except NvpApiClient.NvpApiException:
  raise exception.QuantumException()
 version_parts = res['version'].split('.')
 version = ('%s.%s' % tuple(version_parts[:2]))
 LOG.info(_('NVP controller cluster version: %s'), version)
 return version

def get_cluster_version ( cluster ) : uri = '/ws.v1/control-cluster/node?_page_length=1&fields=uuid' try : res = do_single_request ( HTTP_GET , uri , cluster = cluster ) res = json . loads ( res ) except NvpApiClient . NvpApiException : raise exception . QuantumException ( ) if ( res [ 'result_count' ] == 0 ) : return None node_uuid = res [ 'results' ] [ 0 ] [ 'uuid' ] uri = ( '/ws.v1/control-cluster/node/%s/status' % node_uuid ) try : res = do_single_request ( HTTP_GET , uri , cluster = cluster ) res = json . loads ( res ) except NvpApiClient . NvpApiException : raise exception . QuantumException ( ) version_parts = res [ 'version' ] . split ( '.' ) version = ( '%s.%s' % tuple ( version_parts [ : 2 ] ) ) LOG . info ( _ ( 'NVP controller cluster version: %s' ) , version ) return version
return major/minor version # .