Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[zos-tso] issue_command should loop and concatenate multiple responses #260

Closed
t1m0thyj opened this issue Apr 25, 2024 · 1 comment · Fixed by #277
Closed

[zos-tso] issue_command should loop and concatenate multiple responses #260

t1m0thyj opened this issue Apr 25, 2024 · 1 comment · Fixed by #277
Assignees
Labels

Comments

@t1m0thyj
Copy link
Member

Describe the bug

The Python SDK is lacking the smarts to continue issuing GET requests to obtain more TSO input until the command completes, which is present in the Node SDK used by Zowe CLI.

To Reproduce

Issue a TSO command with a lot of output (>100 lines) with the issue_command method of the TSO SDK and notice that the response is truncated.

Expected behavior

All output from the TSO command should be returned to match the behavior of zowe zos-tso issue command.

Describe your environment

macOS 14.4.1, Python 3.9.6

Additional context

Until the Python SDK officially supports it, here is a workaround to collect all TSO output:

my_tso = Tso(zosmf_profile, tso_profile)
tso_session = my_tso.start_tso_session()
response_json = my_tso.send_tso_message(tso_session, cmd)
response_lines = my_tso.retrieve_tso_messages(response_json)
while not any("TSO PROMPT" in message for message in response_json) or not response_lines:
    custom_args = my_tso._create_custom_request_arguments()
    custom_args["url"] = "{}/{}".format(my_tso.request_endpoint, tso_session)
    response_json = my_tso.request_handler.perform_request("GET", custom_args)["tsoData"]
    response_lines += my_tso.retrieve_tso_messages(response_json)
my_tso.end_tso_session(tso_session)
print("\n".join(response_lines))
@t1m0thyj t1m0thyj added the bug Something isn't working label Apr 25, 2024
@github-project-automation github-project-automation bot moved this to New Issues in Zowe CLI Squad Apr 25, 2024
Copy link

Thank you for creating a bug report.
We will investigate the bug and evaluate its impact on the product.
If you haven't already, please ensure you have provided steps to reproduce the bug and as much context as possible.

@zowe-robot zowe-robot moved this from New Issues to Medium Priority in Zowe CLI Squad Apr 29, 2024
@zFernand0 zFernand0 added this to the z/OSMF Enhancements milestone May 17, 2024
@pem70 pem70 self-assigned this Jun 3, 2024
@pem70 pem70 mentioned this issue Jun 5, 2024
4 tasks
@t1m0thyj t1m0thyj linked a pull request Jun 17, 2024 that will close this issue
4 tasks
@github-project-automation github-project-automation bot moved this from Medium Priority to Closed in Zowe CLI Squad Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants