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

Fix bugs related to shell requests #49

Merged
merged 5 commits into from
Jan 23, 2025
Merged

Fix bugs related to shell requests #49

merged 5 commits into from
Jan 23, 2025

Conversation

mchitre
Copy link
Member

@mchitre mchitre commented Jan 22, 2025

Overview

This PR fixes 2 problems:

  1. ShellExecReq property name should be command and not cmd. The latter worked because of the way GSON worked in Java, but now we have fixed the naming in Java and so the corresponding Julia message needed update.
  2. The iterator on a GenericMessage had a bug, causing printing of GenericMessages to throw exceptions. We now have a better iterator.

What was broken

using Fjage

gw = Gateway("localhost", 1100)   # with fjage master running on localhost:1100
sh = agent(gw, "shell")

This was failing with a REFUSE:

sh << ShellExecReq(cmd="ps")

and this was not allowed:

sh << ShellExecReq(command="ps")

With cmd replaced by command in the message definition, this worked:

sh << ShellExecReq(command="ps")

but this was failing with an exception:

sh << ShellExecReq(command="ps", ans=true)

All of this works after this PR!

@mchitre mchitre marked this pull request as ready for review January 22, 2025 15:46
@mchitre mchitre requested a review from ymtoo January 22, 2025 15:46
@mchitre mchitre self-assigned this Jan 22, 2025
Copy link

@ymtoo ymtoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mchitre mchitre merged commit 5af5b65 into master Jan 23, 2025
2 checks passed
@mchitre mchitre deleted the bugfixes branch January 30, 2025 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants