Skip to content

Commit

Permalink
Change 'expr_form' to 'tgt_type'
Browse files Browse the repository at this point in the history
  • Loading branch information
renner committed Apr 23, 2018
1 parent 5793e44 commit ff037da
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public T getTarget() {
public Map<String, Object> getProps() {
Map<String, Object> props = new HashMap<>();
props.put("tgt", getTarget());
props.put("expr_form", getType().getValue());
props.put("tgt_type", getType().getValue());
return props;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public interface Target<T> {

/**
* Return the properties that belong in a request body.
* This will include the `tgt` and `expr_form` properties.
* This will include the `tgt` and `tgt_type` properties.
* and optionally the `delimiter` property.
*
* @return a map of property keys and values
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.suse.salt.netapi.datatypes.target;

/**
* Possible values for the tgt_type or expr_form parameter in salt netapi calls.
* Possible values for the tgt_type parameter in salt netapi calls.
*/
public enum TargetType {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ private void defaultDelimiterTestHelper(DictionaryTarget target) {
assertEquals(key, target.getKey());
assertEquals(value, target.getValue());
assertTrue(target.getProps().containsKey("tgt"));
assertTrue(target.getProps().containsKey("expr_form"));
assertTrue(target.getProps().containsKey("tgt_type"));
assertFalse(target.getProps().containsKey("delimiter"));
assertEquals(DictionaryTarget.DEFAULT_DELIMITER, target.getDelimiter());
}
Expand All @@ -253,7 +253,7 @@ private void alternateDelimiterTestHelper(DictionaryTarget target) {
assertEquals(key, target.getKey());
assertEquals(value, target.getValue());
assertTrue(target.getProps().containsKey("tgt"));
assertTrue(target.getProps().containsKey("expr_form"));
assertTrue(target.getProps().containsKey("tgt_type"));
assertTrue(target.getProps().containsKey("delimiter"));
assertEquals(alt_delim, target.getDelimiter());
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/async_via_event_test_ping_request.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"tgt": "*",
"client": "local_async",
"fun": "test.ping",
"expr_form": "glob"
"tgt_type": "glob"
}
]
2 changes: 1 addition & 1 deletion src/test/resources/call_sync_batch_ping_request.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"tgt": "*",
"eauth": "auto",
"password": "pa55wd",
"expr_form": "glob",
"tgt_type": "glob",
"batch": "1",
"client": "local_batch",
"fun": "test.ping",
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/call_sync_ping_request.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"tgt": "*",
"eauth": "auto",
"password": "pa55wd",
"expr_form": "glob",
"tgt_type": "glob",
"client": "local",
"fun": "test.ping",
"username": "user"
}
]
]
3 changes: 1 addition & 2 deletions src/test/resources/minions_request.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"expr_form": "glob",
"tgt_type": "glob",
"tgt": "*",
"fun": "pkg.install",
"arg": ["i3"],
Expand All @@ -10,4 +10,3 @@
}
}
]

2 changes: 1 addition & 1 deletion src/test/resources/run_request.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"password": "pass",
"eauth": "pam",
"client": "local",
"expr_form": "glob",
"tgt_type": "glob",
"tgt": "*",
"fun": "pkg.install",
"arg": ["i3"],
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/ssh_ping_request.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"expr_form": "glob",
"tgt_type": "glob",
"tgt": "*",
"client": "ssh",
"fun": "test.ping",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/ssh_raw_run_request.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"client": "ssh",
"tgt": "*",
"expr_form": "glob",
"tgt_type": "glob",
"raw_shell": true,
"fun": "uptime"
}
Expand Down

0 comments on commit ff037da

Please sign in to comment.