Skip to content

Commit

Permalink
TFA: regression issue with long_running method
Browse files Browse the repository at this point in the history
Incorrect check was performed when evaluating maximum allocated
run duration. This patch fixes the patch statement.

Signed-off-by: Pragadeeswaran Sathyanarayanan <[email protected]>
  • Loading branch information
psathyan committed Jul 18, 2024
1 parent 1d8391a commit 18e600d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ceph/ceph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1518,6 +1518,7 @@ def long_running(self, **kw):

try:
channel = ssh().get_transport().open_session()
channel.settimeout(timeout)

# A mismatch between stdout and stderr streams have been observed hence
# combining the streams and logging is set to debug level only.
Expand All @@ -1542,7 +1543,7 @@ def long_running(self, **kw):
data = channel.recv(1024)

# time check - raise exception when exceeded.
if timeout is not None and _end_time > datetime.datetime.now():
if timeout and datetime.datetime.now() > _end_time:
channel.close()
raise SocketTimeoutException(
f"{cmd} failed to complete within {timeout}s"
Expand Down

0 comments on commit 18e600d

Please sign in to comment.