-
Notifications
You must be signed in to change notification settings - Fork 95
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
salt.modules.cmdmod additions #253
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks you for the PR. Aside from some minor things it looks good 👍
*/ | ||
public class CmdExecCodeAll { | ||
public class CmdArtifacts { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would suggest naming this something like CmdResult
since we use the Result suffix quite a bit already for values returned by salt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to CmdResult
as suggested.
@@ -29,6 +31,13 @@ private Cmd() { } | |||
new TypeToken<String>(){}); | |||
} | |||
|
|||
public static LocalCall<CmdArtifacts> runAll(String cmd) { | |||
LinkedHashMap<String, Object> args = new LinkedHashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we could replace this in all methods with Collections.emptyMap
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced empty map creation with Collections.emptyMap()
, and also replaced single pair map creations with Collections.singletonMap()
.
Renamed CmdArtifacts to CmdResult, replaced empty map creation in Cmd with Collections.emptyMap()
Added
cmd.run_all
,cmd.script
andcmd.script_retcode
bindings tocom.suse.salt.netapi.calls.modules.Cmd
. Added related tests.Moved common stub logic in
com.suse.salt.netapi.calls.modules.CmdTest
to a separate method (mockOkResponseWith
).