salt-netapi-client
salt-netapi-client copied to clipboard
Investigate better error detection
Salt seems to have added an option called full_return
which should give more metadata about the result such as success or failure indication. https://docs.saltstack.com/en/latest/ref/clients/#salt.client.LocalClient.cmd with that we should hopefully be able to detect errors more reliably.
with full_return
{"return": [{"minion1": {"jid": "20190318124528105688", "retcode": 0, "ret": true}}]}
without full_return
{"return": [{"minion1": true}]}
We should set full_return
allways to true since we need the information for error detection.
full_return
in the request to the api is on the same level as the client
value for example.
We also need to adjust the gson type adapter responsible for parsing results and take the new error information into account.
One thing unknown is how this effects wheel and runner calls.
My "solution" was to add retcode
to the Return
class and make it accessible in Jobs.Info
. Not sure if this fully makes sense but it was enough for my purposes.