Skip to content

Python wrapper for AMDC doesn't always report full response from the AMDC #403

Answered by Known4225
Adonay4 asked this question in Q&A
Discussion options

You must be logged in to vote

I have found another solution. The problem lies in the fact that calling ctrl stats print will output two instances of SUCCESS. One at the top right after the command is called, and another at the bottom after all of the output has been printed.

The python code waits until one of the key phrases is detected to stop listening:

# Only read until valid response!
valid_cmd_resp = ['SUCCESS', 'FAILURE', 'INVALID ARGUMENTS', 'INPUT TOO LONG', 'UNKNOWN CMD', 'UNKNOWN ERRROR']
for valid_resp_str in valid_cmd_resp:
    for line in output:
        if line.find(valid_resp_str) != -1:
            # Found a valid response!
            looking_for_cmd_resp_code = False
            break
    
    if not…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@npetersen2
Comment options

Answer selected by npetersen2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
help wanted Anyone can jump in and assist on this issue.
3 participants