Commit 227cd3aa authored by Alex Willmer's avatar Alex Willmer Committed by David Wilson

ssh, sudo: Remove redundant else clause on bootstrap loop

Since the for loops don't contain any break statements the StreamErrors
will always be raised when the loop completes without the method
resturning.

See https://lgtm.com/rules/5980098/

Refs #61
parent cbc20f33
...@@ -126,5 +126,4 @@ class Stream(mitogen.parent.Stream): ...@@ -126,5 +126,4 @@ class Stream(mitogen.parent.Stream):
LOG.debug('sending password') LOG.debug('sending password')
self.transmit_side.write(self.password + '\n') self.transmit_side.write(self.password + '\n')
password_sent = True password_sent = True
else: raise mitogen.core.StreamError('bootstrap failed')
raise mitogen.core.StreamError('bootstrap failed')
...@@ -107,5 +107,4 @@ class Stream(mitogen.parent.Stream): ...@@ -107,5 +107,4 @@ class Stream(mitogen.parent.Stream):
LOG.debug('sending password') LOG.debug('sending password')
os.write(self.transmit_side.fd, self.password + '\n') os.write(self.transmit_side.fd, self.password + '\n')
password_sent = True password_sent = True
else: raise mitogen.core.StreamError('bootstrap failed')
raise mitogen.core.StreamError('bootstrap failed')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment