Previously, if wait() had not been called, we didn't have the returncode
attribute set. Set it from within the finished property if it isn't
already.
Signed-off-by: Zack Cerza <zack@redhat.com>
greenlet.get()
status = self._get_exitstatus()
- self.exitstatus = self.returncode = status
for stream in ('stdout', 'stderr'):
if hasattr(self, stream):
stream_obj = getattr(self, stream)
signal, this returns None instead of paramiko's -1.
"""
status = self._stdout_buf.channel.recv_exit_status()
+ self.exitstatus = self.returncode = status
if status == -1:
status = None
return status
@property
def finished(self):
- return self._stdout_buf.channel.exit_status_ready()
+ ready = self._stdout_buf.channel.exit_status_ready()
+ if ready:
+ self._get_exitstatus()
+ return ready
def poll(self):
"""