If the connection is alive, do nothing. If not, reconnect. Allow any
exceptions to bubble up to the caller. This is intended to fix unhelpful
'Bad File Descriptor' errors we were seeing when VMs go down.
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
Make sure that uri is defined for debian upgrades.
Use master as default.
Added _get_uri_() which consolidates checking and assignment of
sha1, tags, and branch values.
Fixes: 7707
Signed-off-by: Warren Usui <warren.usui@inktank.com>
Many errors in yaml configurations cause ValueError to get thrown
with the message 'too many values to unpack.' A previously reverted
change tried to handle all these situations and print an appropriate
message.
The current behavior of throwing the ValueError exception and exiting
is probably what we still want in these cases. So instead of handling
the error, the code now checks for the exception at the top-most call
and displays appropriate messages in log.error and in the ctx.summary
data itself.
Fixes: 7510
Signed-off-by: Warren Usui <warren.usui@inktank.com>
Modified remote.py to use the paramiko SFTPClient get
method to extract long files (mostly tar files) from
the remote host. The code formerly saved the data
in a long local string which was very inefficient.
Fixes: 8261
Signed-off-by: Warren Usui <warren.usui@inktank.com>
If we leave the weights adjusted, we can get PGs stuck in a remapped state
because we are probabilistically rejecting placement. Avoid this by
setting on in osds to 1.0 before waiting for clean.
Signed-off-by: Sage Weil <sage@inktank.com>
Fixed method names to be non-redundant (remote_mktemp in remote is
now just mktemp, for example), and made some parameters be more
self descriptive. Added some docstrings. Fixed sudo setting in
get_file method.
Made chmod independent of the actual sftp file getting.
Do not do extra file copy if non-sudo read is needed.
Fixed some parameter names. Made sure temp files are removed.
Paramiko 1.13.0 checks data in the Channel and fails if
invalid UTF-8 characters are sent. The teuthology/misc.py
functions that piped cat output (get_file) and piped tar
output (pull_directory and pull_directory_tarball) formerly
did not work for Paramiko 1.13.0.
Code was changed to use SFTPClient to copy raw data. The
remote_mktemp and function was changed to be a method of the
remote object. Remote object methods to copy files and write
tar files were also added.
In misc.py, get_file() was changed to be a wrapper around the
remote object call. Pull_directory() and pull_directory_tarball
were changed to use the remote object methods as well.
The remote methods used to send the data makes use of the
SFTPClient interface in Paramiko.
The remote_mktemp function was also modified slightly to insure
that new-lines do not appear in temp file names.
Fixes: 8116
Signed-off-by: Warren Usui <warren.usui@inktank.com>