X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2Fssh.py;h=cfbc3ca96239e084512c84671806b300390893b7;hb=75a8fe55b3e0932539a6c22a54f387b9e9b3c4f0;hp=1cad8eefa860355f60902532a56a5158e70341e2;hpb=f07176fddfce0e919cc791092cdd968fdf661346;p=yardstick.git diff --git a/yardstick/ssh.py b/yardstick/ssh.py index 1cad8eefa..cfbc3ca96 100644 --- a/yardstick/ssh.py +++ b/yardstick/ssh.py @@ -202,7 +202,7 @@ class SSH(object): start_time = time.time() # encode on transmit, decode on receive - data_to_send = encodeutils.safe_encode("") + data_to_send = encodeutils.safe_encode("", incoming='utf-8') stderr_data = None # If we have data to be sent to stdin then `select' should also @@ -234,8 +234,11 @@ class SSH(object): if session.send_ready(): if stdin is not None and not stdin.closed: if not data_to_send: + stdin_txt = stdin.read(4096) + if stdin_txt is None: + stdin_txt = '' data_to_send = encodeutils.safe_encode( - stdin.read(4096), incoming='utf-8') + stdin_txt, incoming='utf-8') if not data_to_send: # we may need to keep stdin open if not keep_stdin_open: