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

salt.modules.cmdmod additions #253

Merged
merged 4 commits into from
Mar 1, 2019
Merged

Conversation

i-sergienko
Copy link
Contributor

Added cmd.run_all, cmd.script and cmd.script_retcode bindings to com.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).

@lucidd lucidd self-requested a review February 7, 2019 16:24
Copy link
Member

@lucidd lucidd left a 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 {
Copy link
Member

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.

Copy link
Contributor Author

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<>();
Copy link
Member

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.

Copy link
Contributor Author

@i-sergienko i-sergienko Feb 12, 2019

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().

@renner renner added this to the Version 0.16.0 milestone Feb 11, 2019
Renamed CmdArtifacts to CmdResult, replaced empty map creation in Cmd with Collections.emptyMap()
@renner renner requested a review from lucidd February 27, 2019 07:19
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.

None yet

3 participants