SSH: Do not rely on the .closed attribute
This patch is updating the logic in the SSH module to not rely on the
"closed" attribute of the channel object when polling the data. The
"closed" attribute may not set to True as part of the exec_command()
execution stack and in that case would cause the exec_command() (from
the tempest SSH module) to hang.
This patch also uses the context manager when creating the channel so
it gets properly closed at the end of the execution scope.
Closes-Bug: #1571492
Change-Id: I5169faf25c36cfb494c9c1fafb14fb4f7f82cd9e
2 files changed