large refactoring of new code
diff --git a/nodes/discover.py b/nodes/discover.py
index 17aa1e7..d36e517 100644
--- a/nodes/discover.py
+++ b/nodes/discover.py
@@ -1,9 +1,10 @@
import logging
-import openstack
import ceph
import fuel
+import openstack
+from disk_perf_test_tool.utils import parse_creds
logger = logging.getLogger("io-perf-tool")
@@ -15,23 +16,37 @@
nodes_to_run = []
for cluster, cluster_info in cluster_conf.items():
if cluster == "openstack":
- conn = cluster_info.get('connection')
+
+ conn = cluster_info['connection']
+ user, passwd, tenant = parse_creds(conn['creds'])
+
+ auth_data = dict(
+ auth_url=conn['auth_url'],
+ username=user,
+ api_key=passwd,
+ project_id=tenant)
+
if not conn:
logger.error("No connection provided for %s. Skipping"
% cluster)
continue
+
logger.debug("Discovering openstack nodes "
"with connection details: %r" %
conn)
- nodes_to_run.extend(openstack.discover_openstack_nodes(
- conn, cluster_info))
+ os_nodes = openstack.discover_openstack_nodes(auth_data,
+ cluster_info)
+ nodes_to_run.extend(os_nodes)
+
if cluster == "fuel":
url = cluster_info['connection'].pop('url')
creads = cluster_info['connection']
roles = cluster_info['discover']
+
if isinstance(roles, basestring):
roles = [roles]
+
nodes_to_run.extend(fuel.discover_fuel_nodes(url, creads, roles))
if cluster == "ceph":