temporary dir creation fixed
diff --git a/configs/perf1.yaml b/configs/perf1.yaml
index 9428b78..05591fe 100644
--- a/configs/perf1.yaml
+++ b/configs/perf1.yaml
@@ -14,7 +14,6 @@
var_dir_root: /tmp/perf_tests
# sensors:
-# receiver_url: "udp://{ip}:5699"
# roles_mapping:
# ceph-osd: block-io
# cinder: block-io, system-cpu
diff --git a/wally/discover/node.py b/wally/discover/node.py
index c2ae5aa..9f4356f 100644
--- a/wally/discover/node.py
+++ b/wally/discover/node.py
@@ -1,3 +1,5 @@
+import getpass
+
from wally.ssh_utils import parse_ssh_uri
@@ -24,6 +26,14 @@
creds = parse_ssh_uri(self.conn_url[6:])
return "{0.host}:{0.port}".format(creds)
+ def get_user(self):
+ if self.conn_url == 'local':
+ return getpass.getuser()
+
+ assert self.conn_url.startswith("ssh://")
+ creds = parse_ssh_uri(self.conn_url[6:])
+ return creds.user
+
def __str__(self):
templ = "<Node: url={conn_url!r} roles={roles}" + \
" connected={is_connected}>"
diff --git a/wally/report.py b/wally/report.py
index 461c2a0..5c7c277 100644
--- a/wally/report.py
+++ b/wally/report.py
@@ -147,6 +147,12 @@
return hdi
+def make_hdd_report(processed_results, path, lab_info):
+ make_plots(processed_results, path)
+ di = get_disk_info(processed_results)
+ render_html(path, di, lab_info)
+
+
def make_io_report(results, path, lab_url=None, creds=None):
if lab_url is not None:
username, password, tenant_name = parse_creds(creds)
@@ -165,9 +171,10 @@
try:
processed_results = process_disk_info(results)
- make_plots(processed_results, path)
- di = get_disk_info(processed_results)
- render_html(path, di, lab_info)
+ if 'hdd_test_rrd4k' and 'hdd_test_rws4k':
+ make_hdd_report(processed_results, path, lab_info)
+ else:
+ logger.warning("No report generator found for this load")
except Exception as exc:
logger.error("Failed to generate html report:" + str(exc))
else:
diff --git a/wally/sensors_utils.py b/wally/sensors_utils.py
index d4e1af8..1bd2164 100644
--- a/wally/sensors_utils.py
+++ b/wally/sensors_utils.py
@@ -12,6 +12,7 @@
logger = logging.getLogger("wally")
+DEFAULT_RECEIVER_URL = "udp://{ip}:5699"
def save_sensors_data(data_q, mon_q, fd):
@@ -42,7 +43,7 @@
monitored_nodes = []
sensors_configs = []
- receiver_url = cfg["receiver_url"]
+ receiver_url = cfg.get("receiver_url", DEFAULT_RECEIVER_URL)
assert '{ip}' in receiver_url
for role, sensors_str in cfg["roles_mapping"].items():
@@ -75,7 +76,7 @@
def start_sensor_process_thread(ctx, cfg, sensors_configs):
- receiver_url = cfg["receiver_url"]
+ receiver_url = cfg.get('receiver_url', DEFAULT_RECEIVER_URL)
sensors_data_q, stop_sensors_loop = \
start_listener_thread(receiver_url.format(ip='0.0.0.0'))
diff --git a/wally/ssh_utils.py b/wally/ssh_utils.py
index af3424c..ae0f3e4 100644
--- a/wally/ssh_utils.py
+++ b/wally/ssh_utils.py
@@ -74,15 +74,10 @@
while True:
try:
- if creds.user is None:
- user = getpass.getuser()
- else:
- user = creds.user
-
if creds.passwd is not None:
ssh.connect(creds.host,
timeout=tcp_timeout,
- username=user,
+ username=creds.user,
password=creds.passwd,
port=creds.port,
allow_agent=False,
@@ -91,7 +86,7 @@
if creds.key_file is not None:
ssh.connect(creds.host,
- username=user,
+ username=creds.user,
timeout=tcp_timeout,
key_filename=creds.key_file,
look_for_keys=False,
@@ -100,7 +95,7 @@
key_file = os.path.expanduser('~/.ssh/id_rsa')
ssh.connect(creds.host,
- username=user,
+ username=creds.user,
timeout=tcp_timeout,
key_filename=key_file,
look_for_keys=False,
@@ -291,6 +286,7 @@
res.port = "22"
res.key_file = None
res.passwd = None
+ res.user = getpass.getuser()
for rr in uri_reg_exprs:
rrm = re.match(rr, uri)
diff --git a/wally/suits/itest.py b/wally/suits/itest.py
index 57592da..259edf4 100644
--- a/wally/suits/itest.py
+++ b/wally/suits/itest.py
@@ -207,8 +207,19 @@
raise OSError("Can't install - " + str(err))
def pre_run(self):
- with self.node.connection.open_sftp() as sftp:
- ssh_mkdir(sftp, self.remote_dir, intermediate=True)
+ try:
+ cmd = 'mkdir -p "{0}"'.format(self.remote_dir)
+ if self.options.get("use_sudo", True):
+ cmd = "sudo " + cmd
+ cmd += " ; sudo chown {0} {1}".format(self.node.get_user(),
+ self.remote_dir)
+
+ self.run_over_ssh(cmd)
+ except Exception as exc:
+ msg = "Failed to create folder {0} on remote {1}. Error: {2!s}"
+ msg = msg.format(self.remote_dir, self.node.get_conn_id(), exc)
+ logger.error(msg)
+ raise
self.install_utils()