large commit. refactoring, fio code totally reworker, huge improvenent in test time and results, etc
diff --git a/nodes/discover.py b/nodes/discover.py
index b95d306..62da457 100644
--- a/nodes/discover.py
+++ b/nodes/discover.py
@@ -1,4 +1,5 @@
import logging
+import urlparse
import ceph
import fuel
@@ -9,14 +10,11 @@
logger = logging.getLogger("io-perf-tool")
-def discover(cluster_conf):
- if not cluster_conf:
- logger.error("No nodes configured")
-
+def discover(discover, clusters_info):
nodes_to_run = []
- for cluster, cluster_info in cluster_conf.items():
+ for cluster in discover:
if cluster == "openstack":
-
+ cluster_info = clusters_info["openstack"]
conn = cluster_info['connection']
user, passwd, tenant = parse_creds(conn['creds'])
@@ -39,17 +37,31 @@
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']
+ elif cluster == "fuel" or cluster == "fuel+openstack":
+ cluster_info = clusters_info['fuel']
+ url = cluster_info['url']
+ creds = cluster_info['creds']
+ ssh_creds = cluster_info['ssh_creds']
+ # if user:password format us used
+ if not ssh_creds.startswith("ssh://"):
+ ip_port = urlparse.urlparse(url).netloc
- if isinstance(roles, basestring):
- roles = [roles]
+ if ':' in ip_port:
+ ip = ip_port.split(":")[0]
+ else:
+ ip = ip_port
- nodes_to_run.extend(fuel.discover_fuel_nodes(url, creads, roles))
+ ssh_creds = "ssh://{0}@{1}".format(ssh_creds, ip)
- if cluster == "ceph":
+ env = cluster_info['openstack_env']
+
+ nodes_to_run.extend(fuel.discover_fuel_nodes(url, creds, env))
+
+ elif cluster == "ceph":
+ cluster_info = clusters_info["ceph"]
nodes_to_run.extend(ceph.discover_ceph_nodes(cluster_info))
+ else:
+ msg_templ = "Unknown cluster type in 'discover' parameter: {0!r}"
+ raise ValueError(msg_templ.format(cluster))
return nodes_to_run