sshtunnels: Remove duplicate error strings

spice can open multiple tunnels, and in certain cases we may get
multiple duplicate errors from each tunnel. Try to strip them out
This commit is contained in:
Cole Robinson 2016-05-16 16:22:35 -04:00
parent adef60211f
commit 0bd73da4bb
1 changed files with 5 additions and 3 deletions

View File

@ -283,10 +283,12 @@ class SSHTunnels(object):
self.unlock()
def get_err_output(self):
errout = ""
errstrings = []
for l in self._tunnels:
errout += l.get_err_output()
return errout
e = l.get_err_output().strip()
if e and e not in errstrings:
errstrings.append(e)
return "\n".join(errstrings)
def _lock(self):
_tunnel_scheduler.lock()