You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When querying for the status of a cmd I was using cmd.is_done("done") and cmd.is_success("done") to see if the cmd is completed and in done state AND cmd is completed and is successful. However these methods simply tell whether the status passed is a 'done' status or a 'success' status. This is an incorrect implementation. Ideally no status need be passed and cmd.is_Xxx() methods are expected to return whether the cmd reached that particular status in its transition or not.
This is the related code block in qds-sdk-py
commands.py@staticmethoddefis_done(status):
""" Does the status represent a completed command Args: ``status``: a status string Returns: True/False """return (status=="cancelled"orstatus=="done"orstatus=="error")
@staticmethoddefis_success(status):
return (status=="done")
The text was updated successfully, but these errors were encountered:
they are used as helper functions when the status is already available.
we can add new instance methods in addition. i am not sure about whether
they can be named the same.
On Tue, Nov 18, 2014 at 2:09 PM, Prasanna Santhanam < [email protected]> wrote:
When querying for the status of a cmd I was using cmd.is_done("done") and
cmd.is_success("done") to see if the cmd is completed and in done state
AND cmd is completed and is successful. However these methods simply tell
whether the status passed is a 'done' status or a 'success' status. This is
an incorrect implementation. Ideally no status need be passed and
cmd.is_Xxx() methods are expected to return whether the cmd reached that
particular status in its transition or not.
This is the related code block in qds-sdk-py
commands.py @staticmethod
def is_done(status):
""" Does the status represent a completed command Args: status: a status string Returns: True/False """
return (status == "cancelled" or status == "done" or status == "error")
When querying for the status of a
cmd
I was usingcmd.is_done("done")
andcmd.is_success("done")
to see if thecmd
is completed and in done state ANDcmd
is completed and is successful. However these methods simply tell whether the status passed is a 'done' status or a 'success' status. This is an incorrect implementation. Ideally nostatus
need be passed andcmd.is_Xxx()
methods are expected to return whether thecmd
reached that particular status in its transition or not.This is the related code block in qds-sdk-py
The text was updated successfully, but these errors were encountered: