Skip to content

Commit 4a779e3

Browse files
committed
add full_return flag for more information
1 parent 7571dc5 commit 4a779e3

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

src/main/java/com/suse/salt/netapi/calls/LocalCall.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import com.suse.salt.netapi.event.JobReturnEvent;
1818
import com.suse.salt.netapi.event.RunnerReturnEvent;
1919
import com.suse.salt.netapi.parser.JsonParser;
20+
import com.suse.salt.netapi.results.FullReturn;
2021
import com.suse.salt.netapi.results.Result;
2122
import com.suse.salt.netapi.results.Return;
2223
import com.suse.salt.netapi.results.SSHResult;
@@ -424,7 +425,8 @@ private CompletionStage<List<Map<String, Result<R>>>> callSyncHelperNonBlock(
424425
Client clientType = batch.isPresent() ? Client.LOCAL_BATCH : Client.LOCAL;
425426

426427
Type xor = parameterizedType(null, Result.class, getReturnType().getType());
427-
Type map = parameterizedType(null, Map.class, String.class, xor);
428+
Type fullret = parameterizedType(null, FullReturn.class, xor);
429+
Type map = parameterizedType(null, Map.class, String.class, fullret);
428430
Type listType = parameterizedType(null, List.class, map);
429431
Type wrapperType = parameterizedType(null, Return.class, listType);
430432
TypeToken<Return<List<Map<String, Result<R>>>>> typeToken =

src/main/java/com/suse/salt/netapi/client/SaltClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ public <R> CompletionStage<R> call(Call<?> call, Client client, Optional<Target<
214214
});
215215

216216
target.ifPresent(t -> props.putAll(t.getProps()));
217+
props.put("full_return", true);
217218
props.put("client", client.getValue());
218219
props.putAll(call.getPayload());
219220
props.putAll(custom);
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.suse.salt.netapi.results;
2+
3+
public class FullReturn<T> {
4+
5+
private T ret;
6+
private int retcode;
7+
private String jid;
8+
9+
public int getRetcode() {
10+
return retcode;
11+
}
12+
13+
public String getJid() {
14+
return jid;
15+
}
16+
17+
public T getRet() {
18+
return ret;
19+
}
20+
21+
@Override
22+
public String toString() {
23+
return "FullReturn{" + "ret=" + ret + ", retcode=" + retcode + ", jid='" + jid + '\'' + '}';
24+
}
25+
}

0 commit comments

Comments
 (0)