blob: 82e7542b2445424f521e115392dc788412f12573 [file] [log] [blame]
# import logging
# import fuel_rest_api
# from node import Node
# logger = logging.getLogger("io-perf-tool")
# def discover_fuel_nodes(root_url, credentials, cluster_name):
# """Discover Fuel nodes"""
# assert credentials.count(':') >= 2
# user, passwd_tenant = credentials.split(":", 1)
# passwd, tenant = passwd_tenant.rsplit(":", 1)
# creds = dict(
# username=user,
# password=passwd,
# tenant_name=tenant,
# )
# connection = fuel_rest_api.KeystoneAuth(root_url, creds)
# fi = fuel_rest_api.FuelInfo(connection)
# logger.debug("wtf")
# clusters_id = fuel_rest_api.get_cluster_id(connection, cluster_name)
# logger.debug("wtf2")
# nodes = []
# for node in fi.nodes:
# if node.cluster == clusters_id:
# nodes.append(node)
# res = [Node(n.ip, n.get_roles()) for n in nodes]
# logger.debug("Found %s fuel nodes for env %r" % (len(res), cluster_name))
# return res